glimmer-vm
glimmer-vm copied to clipboard
Willing to incorporate changes adding support for additional Handlebars features to parser v1?
Hello! I’m working on improving the Handlebars support in Prettier, which uses @glimmer/syntax (specifically, the preprocess function) to parse .hbs files. As you’re probably aware, Glimmer doesn’t support all Handlebars features. However, it wasn’t that difficult to add support for parsing them correctly, at least in the first pass. Would you be willing to accept a PR that adds support for the missing features (including decorators, partials, and slash paths) to the first level of the parser (perhaps via an option, or by throwing an error in the v2-a level of the parser, to match the current behavior)?
My fork with the changes (which include a removal of the packages Prettier doesn’t need) is here: https://github.com/j-f1/forked-glimmer-vm/tree/prettier
@j-f1 thanks for opening this! Sorry it got missed and I'll make sure it gets some attention ASAP.
I think in general, adding support for things in @glimmer/syntax is fine as long as we ensure that @glimmer/compiler properly errors for those constructs.
Is there any news on this?
No, I ultimately ended up realizing that getting formatting for handlebars to actually work correctly for most/all input that produces valid output is basically impossible. As a result I switched my project to use a different template language and so gave up on the changes to Glimmer. Sorry I don’t have anything more positive :(