Skip to content

Releases: line/tsr

v0.6.0

23 Oct 05:54
0a1eda6
Compare
Choose a tag to compare

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.

image

(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

🧹 Chores

📖 Docs

Full Changelog: v0.5.2...v0.6.0

v0.5.2

23 Sep 14:02
8dff534
Compare
Choose a tag to compare

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

Full Changelog: v0.5.1...v0.5.2

v0.5.1

22 Sep 15:18
876b8fa
Compare
Choose a tag to compare

We now supports handling dynamic imports. If a file is import() ed, it won't be deleted.

What's Changed

🐛 Bug Fixes

Full Changelog: v0.5.0...v0.5.1

v0.5.0

21 Sep 15:26
66aaed3
Compare
Choose a tag to compare

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!

screenshot

What's Changed

🚀 Features

  • feat: Use relative paths, clean up asserted output by @Dimava in #26

🧹 Chores

📖 Docs

New Contributors

Full Changelog: v0.4.0...v0.5.0

v0.4.0

16 Sep 07:14
55fdd7f
Compare
Choose a tag to compare

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

🧹 Chores

📖 Docs

Full Changelog: v0.3.2...v0.4.0

v0.3.2

11 Sep 16:28
a38f344
Compare
Choose a tag to compare

What's Changed

🏕 Features

Full Changelog: v0.3.1...v0.3.2

v0.3.1

11 Sep 05:57
16fc7ea
Compare
Choose a tag to compare

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

29 Aug 01:41
da2798a
Compare
Choose a tag to compare

What's Changed

🏕 Features

Full Changelog: v0.2.0...v0.3.0

v0.2.0

22 Sep 10:46
a3f7c60
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: https://github.com/line/ts-remove-unused/commits/v0.2.0