You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the methods for adding sources files from the file system are synchronous and the ones for writing back to the file system are asynchronous by default (with sync api available via -Sync methods).
This was done because the compiler api reads from the file system synchronously. That said, methods like addSourceFilesAtPaths, addSourceFileAtPath, etc... could all be asynchronous. addSourceFilesAtPaths in particular could get a huge performance boost by parallelizing the work.
The existing api would be moved to -Sync methods. For example, addSourceFilesAtPaths would become addSourceFilesAtPathsSync and then be replaced with an asynchronous addSourceFilesAtPaths. The downside to this change is that if someone doesn't read the breaking changes doc and is not inspecting the return value, then they might not notice this has become asynchronous.
BREAKING CHANGE: @ts-morph/bootstrap now has an asynchronous input API. All methods for adding source files are asynchronous with corresponding synchronous methods. Also, creating a project is now created by either `createProject` or `createProjectSync` functions.
BREAKING CHANGE: @ts-morph/bootstrap now has an asynchronous input API. All methods for adding source files are asynchronous with corresponding synchronous methods. Also, creating a project is now created by either `createProject` or `createProjectSync` functions.
BREAKING CHANGE: @ts-morph/bootstrap now has an asynchronous input API. All methods for adding source files are asynchronous with corresponding synchronous methods. Also, creating a project is now created by either `createProject` or `createProjectSync` functions.
hi, would it be possible to introduce asynchronous input API also for ts-morph (like in ts-morph/bootstrap)? i have found out it on private repo with ~400 files, it's up to 900% slower (100ms vs 1000ms) to load the files into project in synchronous manner.
Right now the methods for adding sources files from the file system are synchronous and the ones for writing back to the file system are asynchronous by default (with sync api available via
-Sync
methods).This was done because the compiler api reads from the file system synchronously. That said, methods like
addSourceFilesAtPaths
,addSourceFileAtPath
, etc... could all be asynchronous.addSourceFilesAtPaths
in particular could get a huge performance boost by parallelizing the work.The existing api would be moved to
-Sync
methods. For example,addSourceFilesAtPaths
would becomeaddSourceFilesAtPathsSync
and then be replaced with an asynchronousaddSourceFilesAtPaths
. The downside to this change is that if someone doesn't read the breaking changes doc and is not inspecting the return value, then they might not notice this has become asynchronous.Relates to #702.
The text was updated successfully, but these errors were encountered: