Conversation
janechu
added a commit
that referenced
this pull request
Apr 6, 2026
The JSON array/object literal attribute parsing belongs on the fix-json-literal-attributes branch (PR #7395), not here. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
janechu
added a commit
that referenced
this pull request
Apr 6, 2026
The JSON array/object literal attribute parsing belongs on the fix-json-literal-attributes branch (PR #7395), not here. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0a6ad93 to
c95a71a
Compare
76b235b to
74d8f4b
Compare
janechu
commented
Apr 7, 2026
change/@microsoft-fast-build-fix-json-attrs-72c1b67a-84b2-484c-90bd-9e9f9a065e6c.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Updates @microsoft/fast-build SSR custom element rendering so :prop (FAST property bindings) are forwarded into the child element’s SSR rendering state while being stripped from the emitted HTML, enabling typed values (arrays/objects) to flow into child templates (e.g., for f-repeat) without polluting attributes.
Changes:
- Forward
:propbindings into custom element child state (lowercased key,:removed) while continuing to omit them from rendered HTML. - Add/adjust tests validating
:proptyped forwarding (string/object/array) and verifying the attribute is absent from output HTML. - Update documentation (README + DESIGN) to reflect the new attribute-to-state behavior; add a patch change file.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/microsoft-fast-build/src/directive.rs | Implements forwarding of :prop bindings into child SSR state while keeping @event skipped. |
| crates/microsoft-fast-build/tests/custom_elements.rs | Adds coverage for :prop state forwarding (including arrays/objects for f-repeat) and stripping from HTML. |
| crates/microsoft-fast-build/README.md | Updates attribute→state mapping and guidance for using :prop to pass structured data without rendering attributes. |
| crates/microsoft-fast-build/DESIGN.md | Updates the SSR design notes to match the new :prop handling. |
| change/@microsoft-fast-build-fix-json-attrs-72c1b67a-84b2-484c-90bd-9e9f9a065e6c.json | Adds a patch change entry for the behavior update. |
…binding
f-repeat works with arrays passed via :prop={{binding}} expressions on the
custom element's opening tag. The binding resolves the array from the
parent state and forwards it as the child element's state entry, which
f-repeat then looks up by name.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d049091 to
288f6f4
Compare
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
Attributes with a
:prefix (FAST property bindings) are now forwarded to the child element's SSR rendering state but are stripped from the rendered HTML output. Previously,:propbindings were skipped entirely — not added to child state and not rendered in HTML.This change enables structured data (arrays, objects) to be passed from the parent state to a custom element's SSR template — for use with
f-repeatand similar directives — without the value appearing as a visible string attribute (e.g.[Object]) in the rendered HTML.:items="{{items}}"{"items": <array from parent state>}items="{{items}}"{"items": <array from parent state>}@click="{handler()}"f-ref,f-slotted,f-childrenExample
state.jsonsupplies{"items": ["a", "b", "c"]}. The:itemsbinding resolves the typed array from the parent state and places it in the child state without rendering it as an HTML attribute.📑 Test Plan
test_custom_element_colon_property_in_state_not_html— verifies:propresolves into child state and is absent from rendered HTMLtest_custom_element_repeat_from_colon_binding— verifiesf-repeatiterates an array passed via:proptest_custom_element_repeat_empty_array_from_colon_binding— empty array casetest_custom_element_object_from_colon_binding— object passed via:propresolves in child templateAll existing tests pass (
cargo testincrates/microsoft-fast-build).✅ Checklist
General
$ npm run change