feat: add opt-in v2 hydration marker support - #7689
Open
Jane Chu (janechu) wants to merge 13 commits into
Open
Jane Chu (janechu) wants to merge 13 commits into
Jane Chu (janechu) wants to merge 13 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c66c1387-9a1b-4386-8d0f-a115ef5706db
Jane Chu (janechu)
requested review from
Chris Holt (chrisdholt) and
John Kreitlow (radium-v)
as code owners
September 3, 2026 20:45
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c66c1387-9a1b-4386-8d0f-a115ef5706db
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c66c1387-9a1b-4386-8d0f-a115ef5706db
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c66c1387-9a1b-4386-8d0f-a115ef5706db
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c66c1387-9a1b-4386-8d0f-a115ef5706db
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c66c1387-9a1b-4386-8d0f-a115ef5706db
…ration-markers # Conflicts: # packages/fast-element/SIZES.md # packages/fast-element/src/hydration/target-builder.ts # packages/fast-element/test/main.ts # sites/website/src/docs/3.x/resources/export-sizes.md
…y lint - Document that the default v3 hydration marker reader now accepts legacy FAST Element 2.x indexed markers as an interoperability fallback, and that markers_v2 is the opt-in export for strict v2-only parsing. - Update the fast-element DESIGN.md, README.md, and hydration migration guide accordingly, and refresh the markers_v2 changeset description. - Add a missing type="button" to the hydration-markers-v2 fixture buttons to satisfy lint/a11y/useButtonType, and regenerate the fixture output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The default HydrationMarkup strategy no longer falls back to legacy
FAST Element 2.x indexed marker parsing. Only the opt-in markers_v2
strategy recognizes that format, so its parsing logic is tree-shaken
out of the bundle unless explicitly imported. Server output that
still emits legacy indexed markers will fail to hydrate unless
markers_v2 is installed via enableHydration({ markers: markers_v2 }).
Updates documentation (DESIGN.md, README.md, migration guide, JSDoc)
and the changeset to describe the corrected, strict-by-default
contract, and replaces the target-builder.pw.spec.ts test that
asserted the previous fallback behavior with tests confirming the
default reader rejects legacy markers and that markers_v2 resolves
them directly.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ckend The webui-todo-app example's `webui --plugin=fast` backend still emits FAST Element 2.x indexed hydration markers. Now that the default hydration reader is strict v3-only, this example must explicitly install markers_v2 to keep hydrating correctly. Verified against the actual server output locally (data-fe-b-*, data-fe-c-*, fe-b$$start/end markers) and confirmed all 7 ssr-webui-todo Playwright tests pass with this opt-in in place. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve conflicts in packages/fast-element/SIZES.md and sites/website/src/docs/3.x/resources/export-sizes.md, both of which are generated bundle-size reports. Instead of picking a side, rebuilt @microsoft/fast-element against the merged code and regenerated the tables via `npm run build:sizes` so the committed numbers reflect the actual merged output, then synced the website copy to match. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f8d8fde6-1261-4dc4-8023-be1559c48bfa
Resolve conflict in packages/fast-build/DESIGN.md's "Validation" section: combine this branch's `markers_v2` build config key with main's `type-source`/`type-source-import` convert config keys (both landed independently) into one accurate description of the allowed config keys per packages/fast-build/bin/fast.js. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f8d8fde6-1261-4dc4-8023-be1559c48bfa
This branch has not been deployed
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.
Pull Request
📖 Description
Adds coordinated, opt-in support for FAST Element 2.x indexed hydration markers while retaining FAST Element 3.x data-free markers as the default.
markers_v2from@microsoft/fast-element/hydration.jsfor use withenableHydration({ markers: markers_v2 }).markers_v2option to@microsoft/fast-buildacross its Rust, WASM, CLI, and configuration APIs.👩💻 Reviewer Notes
The v2 compatibility path is explicitly opt-in on both sides:
{ "markers_v2": true }The client and renderer settings must match. Calls without these options continue using FAST Element 3.x data-free hydration markers.
📑 Test Plan
microsoft-fast-buildRust crate.@microsoft/fast-build, including CLI/config option forwarding.@microsoft/fast-element.✅ Checklist
General
$ npm run changeAgents