Skip to content

[BUGFIX lts] Include renderComponent roots in captureRenderTree (lts-6-12) - #21638

Open
NullVoxPopuli-ai-agent wants to merge 1 commit into
emberjs:lts-6-12from
NullVoxPopuli-ai-agent:nvp/capture-render-tree-render-component-lts-6-12
Open

NullVoxPopuli-ai-agent wants to merge 1 commit into
emberjs:lts-6-12from
NullVoxPopuli-ai-agent:nvp/capture-render-tree-render-component-lts-6-12

Conversation

@NullVoxPopuli-ai-agent

Copy link
Copy Markdown
Contributor

Backport of #21623 to lts-6-12. captureRenderTree now includes components that renderComponent rendered, whatever their owner.

On 6.8 and newer, @ember/test-helpers 5.5.0 renders through renderComponent, so captureRenderTree in a rendering test returns nothing on 6.12 today. release and beta already have this fix.

The fix is the same as on main: captureRenderTree reads the renderers list, which every renderer joins at its first root. lts-6-12 already has that list with the same register and deregister logic, so no other PR needs to come first.

Differences from the main commit:

  • The list moves out of renderer.ts. There is no base-renderer.ts on this branch.
  • @ember/-internals/package.json gets an explicit ./glimmer/lib/renderers export. This branch has no ./* export.
  • The tests use defComponent with named templateOnlyComponent definitions. Without a name, this branch shows (unknown template-only component) in the tree.
  • The expected nodes keep the template field.

Checked locally:

  • The four new tests fail without the fix and pass with it.
  • The full browser suite passes: 8698 passed, 13 skipped, 0 failed.
  • tsc, eslint, prettier, and pnpm build pass. The build has one shared renderers list.

🤖 Generated with Claude Code

`captureRenderTree` only read the owner's `renderer:-dom`.
`renderComponent` renders with its own renderer, and accepts any
object as the owner, so its components never showed up.

`@ember/test-helpers` 5.5.0 renders through `renderComponent` on
Ember 6.8 and newer, so `captureRenderTree` in a rendering test
returned nothing. This broke the nightly smoke tests on `beta`
and `release`. Tools that pass a wrapper owner, like the limber
repl, were missing from Ember Inspector for the same reason.

Every renderer already joins the `renderers` list at its first root
and leaves it after its last root. `captureRenderTree` now reads
that list, so it covers each application and every `renderComponent`
call, whatever the owner. The list moved into its own module so
`@ember/debug` can import it without importing the renderer.

Differences from the main commit on lts-6-12:

- The list moves out of `renderer.ts`. There is no `base-renderer.ts`.
- `@ember/-internals` gets an explicit `./glimmer/lib/renderers`
  export, because it has no `./*` export.
- The tests use `defComponent` with named `templateOnlyComponent`
  definitions, and the expected nodes keep the `template` field.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 990e15b)

This branch has not been deployed

No deployments
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