Repository navigation
fix: share dev and production hydration payload serialization - #1162
Merged
domgan-oai merged 2 commits intoSep 19, 2026
Merged
domgan-oai merged 2 commits into
domgan-oai merged 2 commits into
Conversation
domgan-oai
marked this pull request as ready for review
September 19, 2026 22:09
This was referenced Sep 19, 2026
Closed
15 of 24 tasks
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.
Summary
Development SSR puts client-build metadata before route fields, while production puts it after them. Share script-safe route serialization so both handlers emit the same field order, defaults and escaping, with request-specific document identities preserved. Expose the shared serializer through the existing app-core HTML entry point.
Addresses the route hydration serializer finding in #967; that compound audit has other remaining work.
Validation
pnpm sync; no generated changes.CI
The current head
6e19dbc56d77cf8339213c63efe909e1053a04e8merges maindc8f3cdb. The original eight-file payload diff is byte-identical after the merge. After refresh, 36 focused tests on Node 24.13.0, scoped typechecks and formatting, andpnpm syncpass. Current-head CI passed all 26 jobs on this exact head. Cursor Bugbot also passed without findings. The PR was subsequently merged as5f4b258d80701d70f17790d14c6ac39ec9cb3d0b.Prior head
23e4e35aa1d2a82ae903fa51ece298ab45a0254fpassed Cursor Bugbot and CI run 35472520028, with all 26 jobs passing.The first run failed TanStack Query's existing SSR error hydration case with missing QueryClient context. One failed-job retry passed on the same commit, with no source, assertion or deadline changes. The retry does not establish the underlying context failure's cause.
Risk / follow-ups
The serializer adds one temporary object per rendered route request; no component, node or signal hot path changes. Matched neutral server-bundle checks with esbuild 0.28.1 measured production +261 raw / +45 gzip / +57 Brotli bytes and dev -82 raw / -20 gzip / -22 Brotli bytes. These are focused bundle measurements, with no CPU or production performance claim.
Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Touches inline script JSON and XSS escaping on every SSR render; scope is narrow and covered by new dev/production parity tests.
Overview
Unifies how dev and production SSR build the inline
#__octane_datahydration script so both paths emit the same JSON shape, field defaults, key order (including whenclientBuildmetadata is present), and</>escaping.Adds shared
serializeRouteDatain app-core (withRouteHydrationDatatypes), exports it from@octanejs/app-core/html, and wires devhandleRenderRouteand productioncreateHandlerthrough it—removing duplicated localescapeScripthelpers. Adds matrix tests that dev and production responses match byte-for-byte aside from per-requestdocumentId.Reviewed by Cursor Bugbot for commit 6e19dbc. Bugbot is set up for automated code reviews on this repo. Configure here.