Closed tomdale closed 8 years ago
It looks like CJS commits were disabled in https://github.com/tildeio/htmlbars/commit/0c51a428dd0aa8358c075d73d82fd90df9d6536f but no rationale for why was provided in that commit. Presumably it was for a good reason, but it means I couldn't write a test for this case.
I think it's OK because this is implicitly tested in Ember anyway and this implementation of the DOM Helper is EOL once Glimmer2 lands.
It looks like CJS commits were disabled in 0c51a42 but no rationale for why was provided in that commit. Presumably it was for a good reason, but it means I couldn't write a test for this case.
They where breaking the build, I did not have time to fix them, and we needed to get some critical work out to ember. I intended to address this, unfortunately have not had a chance.
Maybe someone else can.
seems good! :+1:
@stefanpenner
Maybe someone else can
Basically EOL at this point, not sure it's worth anyone putting effort in here that could be put into glimmer.
Basically EOL at this point, not sure it's worth anyone putting effort in here that could be put into glimmer.
@tomdale c
@stefanpenner @krisselden @chancancode Replaced detecting the environment with a feature detection. How does this approach look?
@tomdale I would feel better doing the test before the prototype member is set, rather then replacing the SharedFunction during invocation. Is this possible, or is it lazy fora specific reason?
@chancancode @stefanpenner I updated the implementation to install the methods on the instance, and also added support for raw HTML sections. That last change let's us remove all of the monkeypatches from Ember/FastBoot.
Gonna merge this, @stefanpenner let me know if you've got any issues and I will fix.
The current implementation of the DOM helper’s
protocolForURL
relies on the implicit parsing and normalization that the browser’s DOM does when setting the A element’shref
property.However, the DOM helper is often used with subset DOM implementations like simple-dom. In those cases, we cannot rely on this normalization.
This commit detects when the DOM Helper is running in Node and uses the built-in URL package to parse the protocol instead.
/cc @wycats @chancancode @rwjblue @stefanpenner