-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Transform type exports to "export type" in order to comply with isolatedModules #278
Conversation
When the TypeScript option isolatedModules is used, re-exported types must be exported as `export type { ... }` or `export { type ... }`. This fixup determines the kind of export (type or anything else) and adapts the export statement accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a pragmatic solution that works, great job!
@Swatinem it seems that export { type T } is only supported since Typescript 4.5. Would you be willing to raise the minimum compatible ts version to 4.5, or would you prefer we split type exports from value exports? Going to 4.5 also fixes the issue with
that we see in the ci logs. |
Also, support for node 14 can probably be dropped since it is end-of-life since May of this year. |
This would probably mean a 6.0.0 release, right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do see both sides of bumping version requirements.
From a consumer point of view, bumping versions in most cases is as easy as a oneliner. If it isn’t, and someone is stuck on older versions, it does not make a difference being stuck on an older version of this plugin either.
From a maintainers point of view, lowering the maintenance burden by not having to support older versions is definitely a plus. Given than backwards compatibility to older Rollup versions was already broken by accident recently, might as well bump that up as well in accordance with that. For the Typescript version itself, not sure what a reasonable version requirement there would be. 4.5
sounds reasonable, as that was released end of 2021. Might as well bump higher, as I really don’t see a point supporting TS older than a year.
@Swatinem thanks for the merge :-) Do you have any plans yet for when to do a release? |
Hi @Swatinem |
Done, sorry for the delay. |
Fixes #276