Conversation
src/plugin.ts
Outdated
| }, | ||
| }, | ||
|
|
||
| Identifier(path: NodePath<t.Identifier>) { |
There was a problem hiding this comment.
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.
this identifiers are also added by babel import util
There was a problem hiding this comment.
This is only a problem because we do this in pre
There was a problem hiding this comment.
This is running in pre as well. So it only affects identifiers added during ast transform
There was a problem hiding this comment.
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