v0.6.0
v0.6.0
introduces performance improvements!
Uses worker_threads for performance
ts-remove-unused now uses worker_threads to calculate edits for each file in parallel. Internally, the logic has been modified to calculate a dependency graph of files beforehand to delegate small tasks containing a subgraph of files to each worker.
(Tested on Macbook Pro 2021 – M1 Pro, 32GB)
The chart above shows the performance differences when ts-remove-unused is used for some examples. We can expect a 4x boost for large scale repositories like exclidraw.
breaking change: remove()
is asynchronous
Due to this change, the remove()
API will return a Promise. All parameters previously available will continue to work.
--experimental-recursive
option
Some unused code may not be detected if it's a result of the modification of another file in the project. --experimental-recursive
mode will detect files that need to be processed again due to an edit made by another file being processed and make sure that all unused code will be fixed/edited in one command.
Note that the recursive logic will result in a significantly longer execution time for large scale apps with lots of unused code. It's still in experimental phase and is not recommended for daily use.
What's Changed
🚀 Features
- feat: use worker_threads for performance by @kazushisan in #44
🧹 Chores
- chore: exit with 1 when test fails by @kazushisan in #40
📖 Docs
- docs: update README by @kazushisan in #39
Full Changelog: v0.5.2...v0.6.0