glimmer-vm icon indicating copy to clipboard operation
glimmer-vm copied to clipboard

Willing to incorporate changes adding support for additional Handlebars features to parser v1?

Open j-f1 opened this issue 3 years ago • 5 comments
trafficstars

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)?

j-f1 avatar Jan 02 '22 20:01 j-f1

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 avatar Jan 04 '22 14:01 j-f1

@j-f1 thanks for opening this! Sorry it got missed and I'll make sure it gets some attention ASAP.

chriskrycho avatar May 18 '22 14:05 chriskrycho

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.

rwjblue avatar May 19 '22 20:05 rwjblue

Is there any news on this?

websolutions-hamburg avatar Sep 03 '22 21:09 websolutions-hamburg

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 :(

j-f1 avatar Sep 04 '22 02:09 j-f1