Skip to content

Fix the template plugin under Embroider - #18

Open
aklkv wants to merge 2 commits into
mainmatter:mainfrom
aklkv:fix/template-plugin-embroider
Open

aklkv wants to merge 2 commits into
mainmatter:mainfrom
aklkv:fix/template-plugin-embroider

Conversation

@aklkv

@aklkv aklkv commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Part of splitting up #16.

babel-plugin-ember-template-compilation v4, which Embroider uses, only sets env.filename, so the template plugin threw on every template. It now checks filename as well as the module names, with the old precedence kept so classic output doesn't change.

The template plugin had no tests. The first commit adds them against v2 (what ember-cli-htmlbars uses), and the fix runs them against v4 as well.

aklkv added 2 commits October 20, 2026 03:45
It had no tests. These run it through
babel-plugin-ember-template-compilation v2, which is what
ember-cli-htmlbars uses, and pin down how it rewrites and which modules
it treats as the app's.
babel-plugin-ember-template-compilation v4, which Embroider uses, sets
neither env.meta.moduleName nor env.moduleName, only env.filename, so
every template threw. Check all three, keeping the old precedence for
the path that feeds the id pattern, so classic output is unchanged.

The template tests now run against v4 as well as v2.
@aklkv
aklkv force-pushed the fix/template-plugin-embroider branch 2 times, most recently from f9b1018 to 2514d65 Compare October 22, 2026 08:37
@aklkv aklkv changed the title Fix the template plugin under Embroider and in strict-mode templates Fix the template plugin under Embroider Oct 22, 2026
@aklkv

aklkv commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

I dropped the strict-mode commit. .gjs/.gts files use the imported formatMessage, which already works, so injecting t only served {{format-message}} in strict templates, which nobody should write.

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