Closed buschtoens closed 4 years ago
Definitely seems like a reasonable start, happy to help tweak it in a PR...
My team recently ran into this as well when creating a new engine within our older application at ember@2.18.2. We wanted to install this as a way to start using some of the newer ember syntax, since the engine would be a greenfield project.
Happy to help with anything needed to get this fix in!
https://github.com/rwjblue/ember-angle-bracket-invocation-polyfill/pull/48 seems to have stalled a bit, any folks looking for this functionality willing to pick it up?
I opened a new PR (#91) that's just the changes from #48 applied to current master
. Tried it out in an Ember 3.1 app that uses engines and it seems to work.
Only tested this with a lazy-loaded engine, but I would assume that eagerly bundled engines are also affected.
Since the runtime polyfill only patches the
buildRegistry
method of theApplication
class, it has no effect on engines:https://github.com/rwjblue/ember-angle-bracket-invocation-polyfill/blob/53afc725e13d8db63bf8006c0c906969441482de/vendor/angle-bracket-invocation-polyfill/runtime-polyfill.js#L57-L60
Which is why it causes this error:
I understand that
Application
extendsEngine
, but that this polyfill has to patchApplication
instead ofEngine
, because it needs to override some registry entries only defined inApplication
:https://github.com/emberjs/ember.js/blob/v3.4.1/packages/%40ember/application/lib/application.js#L1091-L1093
I now tried running the same polyfill for
Engine
in addition toApplication
and so far it seems to work. 🤷♂️This is not ideal for
Application
though, because the polyfill is:Engine
Application
Application
Do you still think that this is a valid solution going forward? I will submit a PR then.