Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce size of typescript plugin #16393

Merged
merged 4 commits into from
Jun 13, 2024
Merged

Reduce size of typescript plugin #16393

merged 4 commits into from
Jun 13, 2024

Conversation

fisker
Copy link
Member

@fisker fisker commented Jun 13, 2024

Description

After I merge #16388, the typescript is transformed as ES module, but it's still not removing dead code.
I realized that there is something preventing it been tree-shaked, then I found ts-api-utils is using "property" in typescript.

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@fisker
Copy link
Member Author

fisker commented Jun 13, 2024

Finally, the size of typescript plugin is under 1M

Size Change: -347 kB (-4.28%)

Total Size: 7.77 MB

Filename Size Change
./dist/plugins/typescript.js 913 kB -174 kB (-15.97%) 👏
./dist/plugins/typescript.mjs 913 kB -174 kB (-15.98%) 👏

@fisker fisker marked this pull request as ready for review June 13, 2024 01:55
@fisker fisker merged commit a8a0f2f into prettier:main Jun 13, 2024
26 checks passed
@fisker fisker deleted the ts-treeshake branch June 13, 2024 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant