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

Properly elide or preserve empty imports/exports #810

Merged
merged 1 commit into from
Jul 13, 2023

Conversation

alangpierce
Copy link
Owner

Fixes #801

Sucrase previously had a somewhat unified approach to import/export elision, but this caused an issue with import {} statements, which should be removed in TypeScript, but not in Flow or with neither transform enabled. Now, we plumb the full configuration to both transforms and use the configuration to decide which strategy is relevant.

Fixes #801

Sucrase previously had a somewhat unified approach to import/export elision, but
this caused an issue with `import {}` statements, which should be removed in
TypeScript, but not in Flow or with neither transform enabled. Now, we plumb the
full configuration to both transforms and use the configuration to decide which
strategy is relevant.
@github-actions
Copy link

Benchmark results

Before this PR: 377.8 thousand lines per second
After this PR: 378.1 thousand lines per second

Measured change: 0.09% faster (0.19% slower to 0.21% faster)
Summary: Likely no significant difference

@alangpierce alangpierce merged commit a924d84 into main Jul 13, 2023
6 checks passed
@alangpierce alangpierce deleted the fix-import-export-empty branch July 13, 2023 21:36
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.

Incorrect elision of import {} with TS transform disabled
1 participant