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
[QUEST] Glimmer #4908
Comments
Maybe I missed some discussion/context. In which case you can point me to some reading :) |
We can officially release it once it's able to prettier all the supported syntaxes (i.e., every cases mentioned in its spec or its official test cases), I'm not familiar with handlebars so I'm not sure if it's ready. |
It's not :) |
@rwjblue what is the most up to date document with all the Glimmer syntaxes? Also, do you have any idea on why |
@tchak Can anything be done to help get all the issues for this fixed? |
On a related note, I brought up the above syntax in discord and it apparently shouldn't work in Ember templates: ember-template-lint/ember-cli-template-lint#437 |
@Alonski I think the best thing you can do is to try it and report any issues/suggestions in here. I will remove the |
@tchak So it seems that maybe this is more ready than we though? I am in the process of getting my dev team to start using it and to autofix all templates. Maybe all that is missing is some tests around various templates before/after? |
I think some new stuff (like modifiers) was added to glimmer since last time I looked and would need to be checked. |
@GavinJoyce is working through some changes, if you want to collaborate. |
@tchak @GavinJoyce et al. we (Heroku) are also motivated to improve Glimmer support in Prettier. Shall we try to coordinate our efforts somehow? Quest issue? ⚔️ 😅 |
@jgwhite nice one! A quest issue would be good, there are certainly some currently actionable items and I know that many people in Intercom have also expressed an interest in helping out too. I believe that there are some changes required in @rwjblue, perhaps you know of others? In addition to this, cataloging and possibly fixing issues with the current prettier hbs printer would be really useful. |
While we're working on improving glimmer support, here's a little snippet to add a let select = document.querySelectorAll('select')[0];
let option = document.createElement("option");
option.text = "glimmer";
select.append(option); |
@tchak we could potentially re-purpose this issue as a quest issue. What do you think? (assuming the prettier team are OK with the increased noise) |
I wonder if there's a particular discord server channel that we should use to coordinate our efforts? We could create |
No problem with that
This sounds good. We used to have something in "Gitter", but never took off, I think. Feel free to PR changes advertising it in docs/README/CONTRIBUTING/etc if you do it |
@GavinJoyce I am working on getting a Currently, what we have available is |
@jgwhite sure. It was kinda my intention when I created it. |
one more issue: trying to format {{#let (query-node "#exercise-steps-slot") as |node|}}
{{#if node}}
{{#in-element node}}
{{#unless this.justEnteredTask}}
<ExerciseSteps
@activeStep={{this.mode}}
@onClick={{this.onModeChange}}
/>
{{/unless}}
{{/in-element}}
{{/if}}
{{/let}} getting error and: {{#let (query-node "#exercise-steps-slot") as |node|}}
{{#if node}}
{{#in-element node guid="%cursor:0%" nextSibling=null}}
{{#unless this.justEnteredTask}}
<ExerciseSteps
@activeStep={{this.mode}}
@onClick={{this.onModeChange}}
/>
{{/unless}}
{{/in-element}}
{{/if}}
{{/let}}
|
@lifeart - That issue was fixed in glimmerjs/glimmer-vm#1086 and is included in |
I tried Prettier 2.1.0 and there are a few issues that I encountered. Both can be seen in this playground link.
<a>foobar</a>
barbaz
To become:
<a>
foobar
</a>
barbaz Because that leads to a different HTML output (the link contains a whitespace at the end). Changing the parser in the playground link to Are these going to be fixed? Is there anything I can do about the second issue right now? |
@boris-petrov PR welcome, 1. should be easy to solve, 2. is more hard, but you can find a lot of example for HTML |
@boris-petrov whitespace issue is known and is not trivial #8527 Probably the only major bug before glimmer could be considered stable in Prettier. Is |
@kangax - I see. The whitespace issue is pretty much a show-stopper for any real project so until then, Prettier is unusable unfortunately. Hopefully someone will come up with a solution. As for <div>
{{~!~}}
<span></span>
{{~!~}}
</div> Is the same as: <div><span></span></div> Note that |
@boris-petrov I talked a little bit about possible solutions in the ticket for the whitespace issue. I'd love to hear your feedback there. Haven't had time to work on it lately, unfortunately. As far as |
@kangax - I added a comment on the other issue. As for By the way, I also forgot a third issue. Prettier actually blew up on: |
@boris-petrov made a PR (#9082) for the tilde issue, just need to add a changelog file there if core team agrees this is an acceptable approach. |
@boris-petrov where can I find more information on |
^ That From discord I guess the closest thing to this being documented is this issue: ember-template-lint/ember-template-lint#787 There is https://github.com/mahirshah/ember-array-index-template-codemod to migrate your code |
Oh, I didn't know that it's invalid. 😄 Thanks for pointing that out @chrisrng @kangax - it's strange that the playground "works". What I've done is I've installed
The code is actually |
👋🏼 can we get a release cut that has all the features we've landed for Glimmer lately included (totally fine to leave them still in "beta" mode for now)? That'd help unblock a major effort at LinkedIn. |
If it's really urgent, just install Prettier directly from GitHub. Prettier supports that: |
@thorn0 Yep, thank you for raising it in case we didn't know, but in this case I'm very well aware! That's a great solution in many contexts, but in many large corporate contexts it's not easily possible: for example, if all your packages need to be re-hosted on an internal repo, in which case it needs to actually be published. (We can work around that temporarily, but with difficulty at best.) |
Objective
We want to get Prettier’s support for Ember templates up to the point where it is complete and maintainable enough to be officially released.
This quest issue was created to track the outstanding work required to meet this objective and to help volunteers coordinate to get the work done.
Contributing
You can follow and participate in the work on the collaborative issue
The text was updated successfully, but these errors were encountered: