-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
The Road to Stable #35
Comments
To catch folks up, In the eslint plugin, the current approach is:
pre/post processors run "automatically" based on file extension when a plugin provides a file extension<->processor mapping Thanks, @chriskrycho !! |
Thanks for the clarification – that’s super helpful! |
Thanks as well to @wycats, @bmish, and @rwjblue for helping get those various efforts across the line. I’ll make sure we follow up on this in one of the next few Framework Core team meetings—this is amazing progress, and represents a huge step toward stabilizing this and eventually making it the recommended way of writing Ember templates. (Keep your eyes open for code-mods coming soon™!) |
This is done. We will keep polishing, but all the hard blockers are wrapped; now we need to (a) do that polish work, (b) write an RFC for route templates, and (c) start the path to documenting it as a supported path (though not yet a recommended one). |
The Road to Stable
Background
RFC #0779: First-Class Component Templates picked one of the formats from this repo as the the ability for Ember (and Glimmer) developers to write components with
template
tags embedded in their JS, like so:This is not only a general win for ease of working with Ember: it is also a key part of our TypeScript story, because it makes things like go-to-definition, documentation hovers, autocomplete, auto-import, etc. all much easier to manage. So: what do we need to do to finish unblocking its adoption?
Work to be done
There are only three fundamental blockers to adoption:1
Prettier support
Thanks to @wondersloth at LinkedIn, there is an existing Prettier plugin for one of the alternatives to the final first-class component templates design, which used
hbs
tags (like you see in tests), as used by Play/Glimmer. You can find that here. In this case, the work to be done is building on that and using the preprocessor from ember-template-imports to get the contents of the template, with the existing indentation, run Prettier on that, apply appropriate indentation, and replace it in the<template>
tag.ESLint support
This is really two things:
Help land this PR by @NullVoxPopuli (who would welcome the help)! It may be helpful to compare with the eslint plugin for GlimmerX, which works with
hbs
tagged template literals and would need similar updates as the Prettier plugin, but may be useful input.See the next section about ember-template-lint: we want to basically make
ember-template-lint
an embedded ESLint reporter.ember-template-lint support
For
ember-template-lint
, we need to integrate it with ESLint, so that from the end user’s perspective, they just have one linter giving them feedback on their.There is a branch of this work started here, but again, @NullVoxPopuli does not currently have time to finish it and would love help!
Footnotes
Beyond this, the specification working group is also working on nailing down what we want the exact design constraints for
<template>
tags (as well as any other future tags in the same direction), which we expect to publish as and we take that design to be a blocker for making it the recommended and default experience for Ember developers, but not a blocker for folks adopting and using it. ↩The text was updated successfully, but these errors were encountered: