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

Use export type to avoid broken imports when types are transpiled away #239

Merged
merged 3 commits into from
Mar 11, 2021

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented Mar 11, 2021

The meat of this PR is the one line change in 31317db.

To make that work though I had to upgrade prettier, which required me to reformat a lot of the repo, and upgrade ember-cli-typescript and ember-cli-babel to make sure we would get a new enough version of @babel/plugin-transform-typescript to handle type-only exports.

The motivation for this change is that without marking these are type-only exports, the export statement ends up staying in the Javascript even though the corresponding type definitions got deleted. That mismatch is a SyntaxError when you're using a system that respects ES modules.

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I'll try to land and release in the AM

@rwjblue rwjblue merged commit 1ba78cc into master Mar 11, 2021
@rwjblue rwjblue deleted the types-leak branch March 11, 2021 03:49
@rwjblue rwjblue added the bug Something isn't working label Mar 11, 2021
@rwjblue rwjblue changed the title Broken type imports leak into Javascript Use export type to avoid broken imports when types are transpiled away Mar 11, 2021
@rwjblue
Copy link
Member

rwjblue commented Mar 11, 2021

@ef4
Copy link
Contributor Author

ef4 commented Mar 11, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants