Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
j-f1 opened this issue Jan 2, 2022 · 5 comments
Labels

Comments

@j-f1
Copy link

j-f1 commented Jan 2, 2022

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
Copy link
Author

j-f1 commented Jan 4, 2022

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

@chriskrycho
Copy link
Contributor

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

@rwjblue
Copy link
Member

rwjblue commented May 19, 2022

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.

@websolutions-hamburg
Copy link

Is there any news on this?

@j-f1
Copy link
Author

j-f1 commented Sep 4, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants