emberjs / babel-plugin-ember-template-compilation

Babel implementation of Ember's low-level template-compilation API
9 stars 11 forks source link

fix gts ts imports issue #34

Closed patricklx closed 6 months ago

patricklx commented 8 months ago

run the processing in pre to ensure we have the imports before other plugin runs.

fixes https://github.com/embroider-build/ember-auto-import/issues/611

ef4 commented 7 months ago

Can we add a test that runs our plugin and babel-plugin-transform-typescript together so that we don't regress on this bug?

patricklx commented 7 months ago

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 https://github.com/emberjs/babel-plugin-ember-template-compilation/blob/5fceb59b20bc8cf688d8f18fefde1c774eaa1b76/__tests__/tests.ts#L1847

We probably would need another plugin that wants to use the imports.

NullVoxPopuli commented 7 months ago

We have it already

it wasn't failing? :sweat_smile:

patricklx commented 7 months ago

We have it already

it wasn't failing? 😅

No, because it's not a problem of ts plugin + this plugin. But a problem of ts plugin + other plugin+ this plugin.

Updated the description

ef4 commented 7 months ago

Let me rephrase my question: can we add a test they would fail without these changes?

patricklx commented 7 months ago

@ef4 added a test

ef4 commented 6 months ago

Thanks, I found a way to use babel's scope.crawl() to update bindings for only the sub-trees of the AST that we're altering.