Skip to content

fix(runtime-tags): compare renderer owners so dynamic tags distinguish instances of the same content - #3378

Open
DylanPiercey wants to merge 1 commit into
mainfrom
claude/dynamic-tag-owner-compare-u3iv4b
Open

fix(runtime-tags): compare renderer owners so dynamic tags distinguish instances of the same content#3378
DylanPiercey wants to merge 1 commit into
mainfrom
claude/dynamic-tag-owner-compare-u3iv4b

Conversation

@DylanPiercey

Copy link
Copy Markdown
Contributor

Description

The dynamic tag change checks compared renderer?.[RendererProp.Id] || renderer, but the id is the template/section resume id — identical for every instance of the same content section with different RendererProp.Owner scopes. Switching a dynamic tag between two instances of the same content (two <define> contents from two instances of one provider tag, or the list-detail pattern <${selected.content}/>) was a silent no-op: no teardown/re-render, and closures stayed subscribed to the old owner's scope. A control case with distinct tag files behaved correctly, pinning the defect to the id comparison.

The three change checks (_dynamic_tag, _dynamic_tag_content, and the DOM _attr_content) now share a rendererChanged helper comparing (id, owner) — content renderer objects are recreated per render, so identity alone would over-fire, while the owner scope is stable per instance. To keep the resume handshake instance-aware (and avoid spurious teardowns that would reset branch state on the first post-resume update), the SSR side now serializes a renderer registered with a scope as its registered reference — which resumes as the owned client renderer — falling back to the bare id exactly as before for instance-less renderers. +24 bytes brotli total.

Checklist:

  • I have read the CONTRIBUTING document and have signed (or will sign) the CLA.
  • I have updated/added documentation affected by my changes.
  • I have added tests to cover my changes.

Generated by Claude Code

@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7a12d0a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@marko/runtime-tags Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 28 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 34ba3a4d-a825-4dd8-ac30-6ec755692c4a

📥 Commits

Reviewing files that changed from the base of the PR and between 1aeec4b and 7a12d0a.

⛔ Files ignored due to path filters (56)
  • packages/runtime-tags/src/__tests__/fixtures/basic-nested-params/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/basic-nested-params/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-args/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-args/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-attributes/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-attributes/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-single-arg/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-single-arg/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/destructure-input-with-assignment/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/destructure-input-with-assignment/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-content-attr/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-content-attr/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-native-dynamic-tag/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-native-dynamic-tag/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-native-tag-events/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-native-tag-events/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-content-instance-swap/__snapshots__/dom.bundle.debug.js is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-content-instance-swap/__snapshots__/dom.bundle.js is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-content-instance-swap/__snapshots__/html.bundle.debug.js is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-content-instance-swap/__snapshots__/html.bundle.js is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-content-instance-swap/__snapshots__/render.debug.md is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-content-instance-swap/__snapshots__/render.md is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-content-instance-swap/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-content-instance-swap/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-var-in-body/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-var-in-body/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-with-updating-body/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-with-updating-body/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/namespaced-tags/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/namespaced-tags/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-attr-tag-also-custom/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-attr-tag-also-custom/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content-also-custom/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content-also-custom/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content-handler-read/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content-handler-read/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content-opaque/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content-opaque/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-custom-tag/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-custom-tag/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-define-tag/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-define-tag/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/spread-to-known-content-rest/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/spread-to-known-content-rest/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/tag-name-type-unions/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/tag-name-type-unions/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/tag-param-if-closure/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/tag-param-if-closure/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/unused-dynamic-tag-body-serialize-reason/__snapshots__/writes.debug.html is excluded by !**/__snapshots__/** and included by **
  • packages/runtime-tags/src/__tests__/fixtures/unused-dynamic-tag-body-serialize-reason/__snapshots__/writes.html is excluded by !**/__snapshots__/** and included by **
📒 Files selected for processing (76)
  • .changeset/dynamic-tag-owner-compare.md
  • .sizes.json
  • .sizes/dom.js
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-basic-class-to-tags/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-basic-tags-to-class/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-class-to-tags-import/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-dynamic-tag-class-to-tags/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-dynamic-tag-conditional-class-to-tags/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-emit-inline-tags-to-class/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-emit-split-tags-to-class/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-event-class-to-tags/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-event-handler-render-body-tags-to-class/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-event-split-class-to-tags/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-events-tags-to-class/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-mixed-inert-and-stateful-tags-to-class/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-attr-tags-class-to-tags/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-class-to-tags/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-tags-to-class/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-reactive-split-tags-to-class/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-rerender-inert-class/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-roundtrip-split-tags-to-class/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-stateless-tags-to-class/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-tag-params-class-to-tags/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures-interop/interop-tag-params-tags-to-class/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic-with-params/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/basic-nested-params/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/controllable-dialog-open-spread/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/controllable-select-dynamic-spread/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/controllable-select-spread/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-args/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-attributes/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-single-arg/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/define-tag-content-conditional/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/define-tag-for-attribute-tag/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/destructure-input-with-assignment/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-content-attr/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-native-dynamic-tag/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-native-tag-events/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-args-tag-var/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-args/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-content-conditional/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-content-instance-swap/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-content-instance-swap/tags/panel.marko
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-content-instance-swap/template.marko
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-content-instance-swap/test.ts
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-custom-native/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-custom-tags/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-input-intersection/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-single-arg/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-sometimes-null/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-var-in-body/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-with-updating-body/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/hoist-custom-tag-var-from-dynamic/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var-from-dynamic/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-from-dynamic/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/namespaced-tags/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-attr-tag-also-custom/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content-also-custom/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content-handler-read/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content-opaque/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-custom-tag/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-define-tag/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/spread-to-known-content-rest/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/spread-to-known-rest-input-with-attr-tags-deopt/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/static-content-conditional-consumer/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/tag-name-type-unions/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/tag-param-if-closure/sizes.json
  • packages/runtime-tags/src/__tests__/fixtures/unused-dynamic-tag-body-serialize-reason/sizes.json
  • packages/runtime-tags/src/dom/control-flow.ts
  • packages/runtime-tags/src/dom/dom.ts
  • packages/runtime-tags/src/html/dynamic-tag.ts
  • packages/runtime-tags/src/html/writer.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/dynamic-tag-owner-compare-u3iv4b

Comment @coderabbitai help to get the list of available commands.

@DylanPiercey
DylanPiercey force-pushed the claude/dynamic-tag-owner-compare-u3iv4b branch 3 times, most recently from 4c1746e to 692774c Compare July 11, 2026 00:17
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.28%. Comparing base (3ea130d) to head (7a12d0a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3378   +/-   ##
=======================================
  Coverage   94.27%   94.28%           
=======================================
  Files         390      390           
  Lines       54084    54155   +71     
  Branches     4386     4392    +6     
=======================================
+ Hits        50988    51059   +71     
+ Misses       3062     3061    -1     
- Partials       34       35    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DylanPiercey
DylanPiercey force-pushed the claude/dynamic-tag-owner-compare-u3iv4b branch from 692774c to 9578ccd Compare July 11, 2026 01:40
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