Releases: line/tsr
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
v0.5.2
What's Changed
🐛 Bug Fixes
- fix: don't strip async keyword from function declaration by @kazushisan in #35
- Fix:
import * as foo from './foo'
is not detected as usage when used with reexport by @kazushisan in #36
🧹 Chores
- chore: use js api for node test runner by @kazushisan in #37
Full Changelog: v0.5.1...v0.5.2
v0.5.1
We now supports handling dynamic imports. If a file is import()
ed, it won't be deleted.
What's Changed
🐛 Bug Fixes
- fix: add support for dynamic imports by @kazushisan in #34
Full Changelog: v0.5.0...v0.5.1
v0.5.0
ts-remove-unused v0.5.0 is out!
Show paths relative to cwd in the output
ts-remove-unused now shows paths relative to cwd in the output. It will still be recognized as links in VS Code for easy navigation. Thanks @Dimava!
What's Changed
🚀 Features
🧹 Chores
- chore: run action for pull requests by @kazushisan in #31
📖 Docs
- docs: fix library name in npx example by @pafry7 in #22
- docs: update readme by @kazushisan in #30
- docs: add diff example by @kazushisan in #32
- docs: update screenshot by @kazushisan in #33
New Contributors
Full Changelog: v0.4.0...v0.5.0
v0.4.0
ts-remove-unused v0.4.0 is released!
Support for re-exports
ts-remove-unused can now handle re-exports correctly. Let's say you have the following two files a.ts
and a_reexport.ts
// a.ts
export const a = 'a';
export const a2 = 'a2';
// a_rexport.ts
export { a, a2 } from './a.js';
If a2
is not used across the whole project, ts-remove-unused will modify the files:
// a.ts
export const a = 'a';
// a_reexport.ts
export { a } from "./a.js";
Handling empty lines nicely
ts-remove-unused will handle empty lines with the following rules:
- removes leading empty lines from files that were edited
- removes trailing empty lines from files that were edited (limits the line break to max of 1)
- if the edit results in 3 or more consecutive line breaks, it will limit the line break to 2
What's Changed
🚀 Features
- feat: handle reexports by @kazushisan in #18
- feat: remove empty lines by @kazushisan in #19
🧹 Chores
- chore: update release note format by @kazushisan in #20
📖 Docs
- docs: add explanation about skip option by @kazushisan in #21
Full Changelog: v0.3.2...v0.4.0
v0.3.2
What's Changed
🏕 Features
- fix: handle execution in non tty by @kazushisan in #14
- docs: update readme by @kazushisan in #15
- docs: update install section of README by @kazushisan in #16
- chore: upgrade ESLint and Prettier by @kazushisan in #17
Full Changelog: v0.3.1...v0.3.2
v0.3.1
What's Changed
🏕 Features
- docs: add intro section by @kazushisan in #11
- bugfix: remove export keyword for locally used declaration by @kazushisan in #12
- bugfix: correctly auto fix when there are multiple export specifiers by @kazushisan in #13
Full Changelog: v0.3.0...v0.3.1
v0.3.0
What's Changed
🏕 Features
- rewrite ts-remove-unused by @kazushisan in #9
- feat: add yml for release notes by @kazushisan in #10
Full Changelog: v0.2.0...v0.3.0
v0.2.0
What's Changed
- add github actions by @kazushisan in #1
- migrate from jest to node test runner by @kazushisan in #4
- add include-d-ts option by @pandanoir in #3
- docs: update issue command that won't work by @kazushisan in #5
- bump version to 0.2.0 by @kazushisan in #6
- set repository field in package json for provenance publish by @kazushisan in #7
New Contributors
- @pandanoir made their first contribution in #3
Full Changelog: https://github.com/line/ts-remove-unused/commits/v0.2.0