Closed rwjblue closed 5 years ago
While its easy to polyfill the {{in-element someEl insertBefore=null}}
case (thats effectively what the private -in-element
does by default), it will take a bit more work to support the new "replace by default" semantics.
An easy first step is to have the AST transform enforce always having insertBefore=null
(and stripping it), that still doesn't fix the "replace by default" semantics but it would make the authored templates correct.
@rwjblue yeah, I am aware this needs some updates when the final public API arrives, but wanted to wait till things are more settled. I remember there were some discussions on Discord with @cibernox regarding the final semantics of insertBefore
and specifically changing them a bit compared to the RFC.
Can you bring me up to date, is the RFC you linked to still the "source of truth", or were there some changes during the implementation? (Seems this was the Glimmer PR: https://github.com/glimmerjs/glimmer-vm/pull/918)
And is there already an ETA (version) for when this will land in Ember?
I remember having some objections to the "insertBefore" part because it feels a little like reverse thinking to me, but there was technical reasons for that in the glimmer VM.
The RFC is correct for Ember usage, but the glimmer-vm was changed a bit more in https://github.com/glimmerjs/glimmer-vm/pull/931 (because Glimmer.js needed non-null insertBefore
values).
And is there already an ETA (version) for when this will land in Ember?
Not specifically, but I think we'd hope for Ember 3.12 or 3.13. Exact timing is hard to tell though.
Here's a first stab at it: #7. The relevant commit is this one: https://github.com/kaliber5/ember-in-element-polyfill/pull/7/commits/3e5cb7c82f0782f5faec57a158d8e325ea07386d
@rwjblue would love your 👀!
Open question: this polyfill supports even pre-Glimmer versions through ember-wormhole. Not sure if it's really worth the effort to continue with that nowadays, given the additional steps required to implement the changes here? I would tend to drop it...
given that in-element
has existed for around 18 ember minor versions, I don't think it's necessary to support older versions than that.
I mentioned in #6, I'd personally drop support for < 2.18 (though I suspect it doesn't cost us much to keep support for 2.10+, so 2.12 is probably fine too).
This polyfill is not conforming to the final public API from the RFC, specifically this section: