Skip to content

fix: producer inlining should add data-hf-authored-root-id to host element #969

Closed

Description

@miguel-heygen

Context

When the producer path inlines a sub-composition (inlineSubCompositions.ts:307), it takes innerRoot.innerHTML when compId matches, stripping the wrapper div and its id attribute. The CSS/GSAP scoping layer rewrites #ID selectors to [data-hf-authored-root-id=ID], but no element in the producer output has that attribute.

The bundler path preserves it via flattenInnerRoot + data-hf-inner-root.

Fix

In the producer inlining path, when the inner root has an id attribute, add data-hf-authored-root-id to the host element (or to a generated wrapper) so that rewritten #ID selectors resolve in both preview and render.

Tracking

Divergence documented in PR #965 with characterization tests in inlineSubCompositions.test.ts.

Activity

  1. added 2 commits that reference this issue on May 19, 2026
  2. added 2 commits that reference this issue on Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions