Repository navigation
Keep executor when chained page contributions end with a non-hydrated component (7.x) - #2324
Open
alansemenov wants to merge 1 commit into
Open
alansemenov wants to merge 1 commit into
alansemenov wants to merge 1 commit into
Conversation
… component #2322 getAndMerge strips the executor from incoming page contributions so it can be appended last, but only re-added it when the current rendering needed JS. A chain ending with an SSR-only component therefore lost the executor that an earlier hydrated component depended on. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 7.x #2324 +/- ##
=======================================
Coverage 22.85% 22.85%
=======================================
Files 1 1
Lines 35 35
=======================================
Hits 8 8
Misses 27 27 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix addresses the reported regression and is adequately covered by tests.
Review effort: Balanced
Findings: None
What changed in this PR
Preserves the hydration executor across chained page contributions when later components suppress JavaScript.
Changes:
- Retains and repositions an existing executor last.
- Adds regression and deduplication tests.
| File | Description |
|---|---|
getAndMerge.ts |
Preserves the executor during chained merges. |
getAndMerge.test.ts |
Tests retention, ordering, suppression, and deduplication. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2322
Forward-port of #2323 to
7.x. The affected code ingetAndMergeis identical on both branches.Problem
In the custom flow, when the result of one
renderPageContributionscall is passed aspageContributionsinto the next, the executor script is dropped as soon as a later call is for a component that does not need JS (ssrwithouthydrate, or Content Studio edit mode). A hydratedHeaderfollowed by a staticFooterleavesHeaderun-hydrated.Fix
Re-append the executor when the current call needs it or the incoming
bodyEndalready contained it. The executor still lands last and is never duplicated.Tests
New
src/jest/server/pageContributions/getAndMerge.test.ts, same as in #2323. The chained case fails without the fix and passes with it.🤖 Generated with Claude Code