-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add a new --strict-template
option to the route generator
#20835
base: main
Are you sure you want to change the base?
Add a new --strict-template
option to the route generator
#20835
Conversation
blueprints/route/files/__root__/__templatepath__/__templatename__.gts
Outdated
Show resolved
Hide resolved
@@ -29,6 +29,11 @@ module.exports = { | |||
name: 'reset-namespace', | |||
type: Boolean, | |||
}, | |||
{ | |||
name: 'strict-template', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is the best name for the option. Suggestions?
The component version is called --strict
. We could use the same setup here, but in that case it will no longer be possible to only use strict templates for components but not routes by adding the option to the ember-cli config file. Both would then be strict by default. Not sure if we want these to be separate or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option could be to name it something like --strict-route-template
but also add a --strict
alias. That way people can add the more verbose version to their ember-cli file in (the unlikely) case they don't want to use the strict option for the components version.
ember-cli is used in the tests, and some tests need the newer features to work as expected. We also need a version that uses the `babel-remove-types` package that includes the fixes for .gts detyping to work. Because of this update, some slight adjustments are needed to some pod related tests. The `usePods` option of ember-cli-blueprint-test-helpers' `setupPodConfig` util isn't compatible with newer ember-cli versions. As a workaround we use the `--pod` argument when generating files.
This allows users to generate .gjs/.gts templates instead of .hbs templates.
14cad41
to
9a0a990
Compare
I've added this to the agenda for us to discuss a name on tuesday. thanks for working on this!!! |
Now that #20800 is merged, it would also be nice if we could generate new routes with a .gjs / .gts template already.
or by setting
strictTemplate: true
in .ember-cliTODOs