Skip to content

Post-merge-review: Fix template-no-outlet-outside-routes false positive on imported outlet#2671

Merged
NullVoxPopuli merged 1 commit intoember-cli:masterfrom
johanrd:night_fix/template-no-outlet-outside-routes
Apr 13, 2026
Merged

Post-merge-review: Fix template-no-outlet-outside-routes false positive on imported outlet#2671
NullVoxPopuli merged 1 commit intoember-cli:masterfrom
johanrd:night_fix/template-no-outlet-outside-routes

Conversation

@johanrd
Copy link
Copy Markdown
Contributor

@johanrd johanrd commented Apr 13, 2026

What's broken on master

Flags {{outlet}} in non-route templates. Doesn't check whether outlet resolves to a JS binding — in GJS/GTS a user could import outlet from '…' and use it in any component.

Fix

Add JS scope check alongside the existing route-template filename check.

Test plan

25/25 tests pass. 2 new GJS valid tests with imported outlet fail on master.


Co-written by Claude.

@johanrd johanrd marked this pull request as ready for review April 13, 2026 10:32

const routeTemplate = isRouteTemplate(filename);

function isJsScopeVariable(node) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this could probably be a shared utility as well, but I feel like there would be a better way to do this -- it's a lot of code and iirc there was a nicer API on the scope to get your answer here

@NullVoxPopuli NullVoxPopuli merged commit f8255e4 into ember-cli:master Apr 13, 2026
10 of 11 checks passed
@johanrd johanrd deleted the night_fix/template-no-outlet-outside-routes branch April 14, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants