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 4 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.

This version is used in the tests, and some tests need the newer features to work as expected.
We dropped node 16 support in https://github.com/emberjs/ember.js/pull/20716/files already but the volta config was still using v16.
This allows users to generate .gjs/.gts templates instead of .hbs templates.
package.json Outdated
@@ -128,7 +128,7 @@
"babel-plugin-ember-template-compilation": "^2.1.1",
"dag-map": "^2.0.2",
"decorator-transforms": "2.0.0",
"ember-cli": "^4.10.0",
"ember-cli": "^5.12.0",
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.

This bump is needed because the .gts -> .gjs conversion is only available since ember-cli 5.5. I took 5.12 since it's the current LTS, but I can switch to a different version if needed (or to a different solution, if bumping this isn't the correct fix).

Copy link
Contributor Author

@Windvis Windvis Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this bump also causes other test failures related to pods, need to look into this further but the failures are unrelated to the new code here.

Edit: Found the next blocker... ember-cli/ember-cli-blueprint-test-helpers#395

@@ -396,7 +396,7 @@
},
"packageManager": "pnpm@8.10.0",
"volta": {
"node": "16.20.0",
"node": "18.20.6",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node 16 support was already dropped (#20716) so this simply updates the volta config to match that.

Without this the content-tag package doesn't work correctly (Webassembly related errors).

@@ -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.

This release uses the `babel-remove-types` package that includes the fixes for .gts detyping to work.
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.

1 participant