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

Support gjs/gts / <template> #41

Closed
NullVoxPopuli opened this issue Jul 6, 2022 · 4 comments
Closed

Support gjs/gts / <template> #41

NullVoxPopuli opened this issue Jul 6, 2022 · 4 comments

Comments

@NullVoxPopuli
Copy link
Collaborator

The current babel config doesn't allow gjs/gts.

We should add that babel plugin.
The babel plugin lives in the dist'd files from: https://github.com/ember-template-imports/ember-template-imports

@NullVoxPopuli NullVoxPopuli changed the title Suppert gjs/gts / <template> Support gjs/gts / <template> Jul 6, 2022
@NullVoxPopuli NullVoxPopuli mentioned this issue Jul 6, 2022
2 tasks
@ef4
Copy link
Contributor

ef4 commented Jul 19, 2022

This requires more than just the babel plugin, because babel can't parse GJS / GTS until after a preprocessing step. It's going to require a dedicated rollup plugin.

The preprocessor lives here: https://github.com/ember-template-imports/ember-template-imports/blob/c1dfa62b2de91775b1a353d914dae049b88af6cc/src/preprocess-embedded-templates.ts#L180

At the moment, the output format of the preprocessor is an implementation detail between the preprocessor and the corresponding babel plugin. However, I don't think we should keep things that way. I think we should move ahead with something like https://github.com/emberjs/rfcs/blob/35a9e8150596a7bf37034b095c3c574eb43c0e22/text/0813-template-layering.md which would give us a streamlined pure-JS representation of the <template> syntax.

Then the preprocessor gets simpler and the babel implementation can move directly into babel-plugin-ember-templat-compilation.

@NullVoxPopuli
Copy link
Collaborator Author

any chance that RFC can get on the agenda for this week's core team meeting <3

@NullVoxPopuli
Copy link
Collaborator Author

@NullVoxPopuli
Copy link
Collaborator Author

I think this is implemented now, in 2.4.

There are still some safeguards to explore, such as #187

but that's def a polish thing.

I'd declare this done, closing.

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

No branches or pull requests

2 participants