Use the require system instead of copy/pasting the generated runtime.#3
Use the require system instead of copy/pasting the generated runtime.#3kamicane wants to merge 1 commit intoesamattis:masterfrom kamicane:master
Conversation
The package now depends on Handlebars and requires the needed parts for the runtime only, producing the generated runtime at runtime. This way, both browserify (and similar tools!) and the handlebars-runtime package can use the same Handlebar installation, avoiding potential version conflicts.
We'll now use the handlebars module directly. Thanks to @kamicane esamattis/node-handlebars-runtime#3
|
This is great! Thou I think this should be implemented directly by the packages that use the Handlebars runtime. I'm doing that for hbsfy. It's much better that way because then the actual package using the Handlebars runtime can decide which version to use. The hbsfy package was the reason why I created handlebars-runtime. This means that this package is now obsolete for me and I won't be no longer maintaining this. Although I see that there are few other packages on npm that depend on this: If anyone wants to maintain this package I can give npm and github access rights. The runtime access in hbsfy is implemented here: |
|
This is definitely feels cleaner, but is not intrinsically less brittle than what I've done here: In both cases we're exposing interior parts of another module that are outside our control. Longterm, this makes upkeep a pain. Case in point, handlebars-runtime (and hbsfy) is currently incompatible with the latest version of handlebars, because @kpdecker has moved to using an ES6 transpiler. The most ideal solution (that I can see) is for @kpdecker to maintain handlebars-runtime as a separate, but simultaneously released module. I know he's willing, and we're obviously all trying to implement our own stopgaps anyway. |
The package now depends on Handlebars and requires the needed parts for the runtime only, producing the generated runtime at runtime.
This way, both browserify (and similar tools!) and the handlebars-runtime package can use the same Handlebar installation, avoiding potential version conflicts.