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
I tried to see if we can support the config file proposed in this experimental addon to be ESM-based (i.e. config/addons.mjs). However I failed to do so.
AFAIU, the constraints here are:
our "addon-main" module (index.js) has to be CJS
you cannot require() an ESM module from CJS
you can do so using import(), but that makes it async
as it seems, you cannot use that when this would need to happen synchronously during the included hook (that's also when @embroider/macros does all its Ember-CLI plumbing work). When done asynchronously (trying that here), the setConfig() calls seems to happen too late in time to have an effect
So without introducing support for async included in EmberCLI itself, I wouldn't know how to make this work with the constraints we have here!? 🤔
Also, when looking at upstreaming this feature to @embroider/macros, I wouldn't know if that makes things any easier, as again the blocker seems that we have to do the setup work synchronously within the included hook...
The text was updated successfully, but these errors were encountered:
I tried to see if we can support the config file proposed in this experimental addon to be ESM-based (i.e.
config/addons.mjs
). However I failed to do so.AFAIU, the constraints here are:
index.js
) has to be CJSrequire()
an ESM module from CJSimport()
, but that makes it asyncincluded
hook (that's also when@embroider/macros
does all its Ember-CLI plumbing work). When done asynchronously (trying that here), thesetConfig()
calls seems to happen too late in time to have an effectSo without introducing support for async
included
in EmberCLI itself, I wouldn't know how to make this work with the constraints we have here!? 🤔Also, when looking at upstreaming this feature to
@embroider/macros
, I wouldn't know if that makes things any easier, as again the blocker seems that we have to do the setup work synchronously within theincluded
hook...The text was updated successfully, but these errors were encountered: