fix: missing serialisation when child tag has its own state#3198
Conversation
The static-content optimisation in getSectionRegisterReasons incorrectly
skipped registering the section renderer when all of: downstreamReasons
was specific (not true), the content section had no own serialize reasons,
and neither did its parent section. This was too broad — it also fired
when the downstream component had its own reactive state that caused it to
unconditionally write input.content into its serialized scope, making
the renderer unresolvable on the client.
The fix tightens the guard to only skip when downstreamReasons is
param/input-driven (isReasonDynamic), which covers the purely iterative
case from known-rest-attr-tag but not the case where the consumer's own
state (e.g. <let/show>) forces the content reference into its scope
regardless of what the parent passes.
Adds a fixture static-content-conditional-consumer to cover the broken
scenario: a consumer with <let/show=false> that conditionally renders
<${input.content}/> where the passed content is entirely static.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 2700582 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (8)
📒 Files selected for processing (5)
WalkthroughThis PR fixes content renderer registration when a downstream component has its own state. The core change modifies the condition in 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3198 +/- ##
=======================================
Coverage 92.78% 92.78%
=======================================
Files 372 372
Lines 47324 47324
Branches 3387 3387
=======================================
Hits 43911 43911
Misses 3380 3380
Partials 33 33 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
#3183 introduced a regression whereby some client-only components were not serialised correctly. This fixes it.
Details
The static-content optimisation in
getSectionRegisterReasonsincorrectly skipped registering the section renderer when all of:downstreamReasonswas specific (not true), the content section had no own serialize reasons, and neither did its parent section. This was too broad — it also fired when the downstream component had its own reactive state that caused it to unconditionally write input.content into its serialized scope, making the renderer unresolvable on the client.The fix tightens the guard to only skip when
downstreamReasonsis param/input-driven (isReasonDynamic), which covers the purely iterative case fromknown-rest-attr-tagbut not the case where the consumer's own state (e.g.<let/show>) forces the content reference into its scope regardless of what the parent passes.Checklist: