Open simonihmig opened 1 year ago
Under embroider there is only one babel config during the final stage app build. So it's true that a transform added to the app is also going to run over the addons. In general babel plugins should try not to break code that doesn't need the feature they add.
We offer skipBabel
to disable all babel transpilation of a given package, but that is rather extreme as you also lose preset-env, etc.
Perhaps the cached decorator polyfill could behave more like @babel/runtime
, which has the option to emit an absolute or relative path in the import, so that it's resolvable regardless of which package it appear in.
Context:
ember-cached-decorator-polyfill
(it wouldn't need to actually, but also it shouldn't do any harm, right?)ember-headless-form
uses@cached
, but only supports Ember >= 4.4, so has no need forember-cached-decorator-polyfill
and no reference to it whatsoeverReproduction:
cached-decorator-polyfill-reproduction
(main
was fixed by https://github.com/CrowdStrike/ember-toucan-core/pull/168)pnpm i
+pnpm start:docs
While debugging, I found:
@cached
here. I believe this is unexpected, as the polyfill should only run on the app's code, shouldn't it?... importSync('ember-cached-decorator-polyfill').cached
)ember-headless-form is trying to import from ember-cached-decorator-polyfill but that is not one of its explicit dependencies