-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix gts ts imports issue #34
Conversation
src/plugin.ts
Outdated
@@ -194,6 +174,15 @@ export function makePlugin<EnvSpecificOptions>(loadOptions: (opts: EnvSpecificOp | |||
}, | |||
}, | |||
|
|||
Identifier(path: NodePath<t.Identifier>) { |
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 ensures that newly added identifiers do actually reference the import binding. Otherwise ts plugin will remove the import
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 identifiers are also added by babel import util
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 is only a problem because we do this in pre
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 is running in pre as well. So it only affects identifiers added during ast transform
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 could also have my own custom plugins that do some babel ast changes during template transform
Can we add a test that runs our plugin and babel-plugin-transform-typescript together so that we don't regress on this bug? |
We have it already
We probably would need another plugin that wants to use the imports. |
it wasn't failing? 😅 |
No, because it's not a problem of ts plugin + this plugin. But a problem of Updated the description |
Let me rephrase my question: can we add a test they would fail without these changes? |
@ef4 added a test |
Thanks, I found a way to use babel's |
run the processing in pre to ensure we have the imports before other plugin runs.
fixes embroider-build/ember-auto-import#611