Skip to content

Preserve server-rendered DOM when hydrating CLI-built pages - #64

Draft
elemdos wants to merge 4 commits into
masterfrom
fix/static-section-hydration
Draft

elemdos wants to merge 4 commits into
masterfrom
fix/static-section-hydration

Conversation

@elemdos

@elemdos elemdos commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

CLI-built pages rendered all sections inside one SSR page root, then called hydrate separately for each section. Valid interactive blocks therefore replaced existing DOM and duplicated head tags. The build now renders the page head separately and gives each section its own server-rendered root, preserving the existing zone wrappers, field props, styles, and client bundles.

Refs primocms/primo#1309. This is the CLI counterpart to primocms/primo#1325.

Validation: a new test invokes the actual built CLI to initialize a workspace and build a site, serves the resulting files, and checks them in Chromium. It verifies unchanged SSR body/head nodes, one copy of head tags, scoped CSS, each blocks, a head-only block, and a working counter. It fails on upstream and passes with the fix. CI installs Chromium before running the suite. Playwright is a development dependency only.

Exact-package follow-up: normal npm installs hoist Svelte beside primo-cli. Static build previously searched hardcoded paths, missed that location and failed with “Could not find svelte package.” Resolve svelte/package.json through createRequire(import.meta.url), matching the compiler import. Added an actual npm-pack/extract/hoisted-dependency regression: fails before the fix and passes after. The revised CLI candidate passes all 161 installed-package tests on Node 22.13 (zero skips), including static browser hydration and three disposable CMS contracts. Full handoff retains 5/5 SSR nodes and all content/IDs. Final Node 24 verification also passes all 161 installed-package tests with zero skips, plus the complete handoff and six compiler regressions. A first-run hosted-library mock assertion failure did not reproduce in isolated or full repeated runs; cause remains unproven and evidence is retained. No merge or publication.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

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

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