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

Add a new --strict-template option to the route generator #20835

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Windvis
Copy link
Contributor

@Windvis Windvis commented Jan 23, 2025

Now that #20800 is merged, it would also be nice if we could generate new routes with a .gjs / .gts template already.

ember g route foo --strict-template

or by setting strictTemplate: true in .ember-cli

TODOs

  • decide on the final argument name

@@ -29,6 +29,11 @@ module.exports = {
name: 'reset-namespace',
type: Boolean,
},
{
name: 'strict-template',
Copy link
Contributor Author

@Windvis Windvis Jan 23, 2025

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.

Copy link
Contributor Author

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.
@Windvis Windvis force-pushed the strict-route-templates-blueprint-support branch from 14cad41 to 9a0a990 Compare February 28, 2025 10:26
@NullVoxPopuli
Copy link
Contributor

I've added this to the agenda for us to discuss a name on tuesday. thanks for working on this!!!

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

Successfully merging this pull request may close these issues.

2 participants