You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the polyfill's babel plugin is only added once to the "parent" here, and parent is the app (as expected)
putting a breakpoint here in the babel plugin shows that the plugin also runs for the v2 addons use of @cachedhere. I believe this is unexpected, as the polyfill should only run on the app's code, shouldn't it?
you can clearly see that the addon's code is transformed afterwards, applying the stuff the polyfill does (... importSync('ember-cached-decorator-polyfill').cached)
when the module resolver run, it throws with ember-headless-form is trying to import from ember-cached-decorator-polyfill but that is not one of its explicit dependencies
The text was updated successfully, but these errors were encountered:
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 chore: remove unused ember-cached-decorator-polyfill CrowdStrike/ember-toucan-core#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
The text was updated successfully, but these errors were encountered: