chore(fast-html): use @microsoft/fast-build to build test fixtures#7364
Merged
chore(fast-html): use @microsoft/fast-build to build test fixtures#7364
Conversation
193add6 to
393e034
Compare
0f41ae7 to
7e16c43
Compare
7e16c43 to
65a787d
Compare
radium-v
reviewed
Apr 2, 2026
janechu
added a commit
that referenced
this pull request
Apr 3, 2026
…po (#7372) ## Summary Addresses the review comment in #7364 — compiled binary files (wasm + generated JS bindings) should not be committed to the repository. ## Changes ### Package - **`packages/fast-build/package.json`**: Replaced `build:wasm` with a `build` script so `npm run build` at the workspace level generates the wasm files - **Deleted**: `packages/fast-build/wasm/microsoft_fast_build_bg.wasm`, `microsoft_fast_build.js`, `microsoft_fast_build.d.ts`, `microsoft_fast_build_bg.wasm.d.ts` (all generated files removed from tracking) - **`.gitignore`**: Added `packages/fast-build/wasm/` to ignore the generated output directory ### Docs - **`packages/fast-build/CONTRIBUTING.md`**: Updated to reflect that wasm is not committed; contributors run `npm run build -w @microsoft/fast-build` and install `wasm-pack` via `cargo install wasm-pack` - **`packages/fast-build/DESIGN.md`**: Updated module map to note the wasm files are generated, not committed ### CI - **`azure-pipelines-ci.yml`** and **`azure-pipelines-cd.yml`**: Install Rust via rustup and `wasm-pack` via `cargo install wasm-pack` before `npm run build` - **`ci-validate-pr.yml`**, **`ci-validate-platforms.yml`**, **`cd-gh-pages.yml`**: Install `wasm-pack` via `cargo install wasm-pack` before `npm run build` (Rust is pre-installed on GitHub-hosted runners) ## How to build locally Install prerequisites: ```sh # Install Rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # Install wasm-pack cargo install wasm-pack ``` Then from the repository root: ```sh npm run build -w @microsoft/fast-build ```
- Add @microsoft/fast-build as a devDependency - Add scripts/build-fixtures.js: runs fast-build CLI for SSR rendering then injects <f-template> declarations before the <script> tag - Add build:fixtures npm script - Add attribute fixture source files: entry.html, state.json, templates/test-element.html, templates/test-element-property.html, templates/test-element-expression.html - Regenerate attribute/index.html via fast-build (uses data-fe-c-* markers) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tes.html Replaces the individual per-component template files in templates/ with a single templates.html that wraps each template in <f-template name="..."> and <template> tags, matching the new format expected by @microsoft/fast-build after the locator update in #7365. build-fixtures.js updated to: - pass the single templates.html path instead of a templates/*.html glob - inject the templates.html content directly (already has <f-template> wrapping) - drop the readdirSync import (no longer needed) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rebuilds index.html now that the CLI correctly parses <f-template name> attributes (fixes landed in main via #7368). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update entry.html to use {{}} bindings for type, activeGroup, and
currentGroup, and populate state.json with the corresponding values.
Fix directive.rs to resolve {{}} attribute bindings on custom elements
even when no parent hydration scope is present.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2932572 to
035143a
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR switches the @microsoft/fast-html attribute test fixture to be generated via @microsoft/fast-build (instead of a hand-authored index.html) and includes a small Rust renderer tweak so {{}} attribute bindings on custom element outer tags resolve even without a parent hydration scope.
Changes:
- Add a
build:fixturesscript and a Node builder that runs@microsoft/fast-buildand injects fixture templates. - Introduce fixture inputs (
entry.html,state.json,templates.html) and update the generatedindex.html. - Update
fast-buildRust directive rendering to resolve attribute bindings on custom element open tags without a parent hydration scope.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/fast-html/test/fixtures/attribute/templates.html | New consolidated <f-template> declarations used as fixture template source |
| packages/fast-html/test/fixtures/attribute/state.json | New state input used to resolve {{}} bindings during fixture build |
| packages/fast-html/test/fixtures/attribute/entry.html | New entry HTML source (with {{}} bindings) consumed by the fixture build |
| packages/fast-html/test/fixtures/attribute/index.html | Updated generated fixture output produced by fast-build + template injection |
| packages/fast-html/scripts/build-fixtures.js | New CLI script to build fixtures via @microsoft/fast-build and inject templates |
| packages/fast-html/package.json | Adds build:fixtures script and @microsoft/fast-build dev dependency |
| crates/microsoft-fast-build/src/directive.rs | Fixes attribute binding resolution on open tags when no parent hydration exists |
| change/@microsoft-fast-html-63009ec0-ff3c-43ca-a650-621eb74010a3.json | Beachball change file for fast-html fixture build chore |
| change/@microsoft-fast-build-d80fdb63-e6d4-4455-ab31-c345b4e9657b.json | Beachball change file for fast-build Rust fix |
…jection Agent-Logs-Url: https://github.com/microsoft/fast/sessions/d4453b01-5a85-476e-84c2-d9bad8854982 Co-authored-by: janechu <7559015+janechu@users.noreply.github.com>
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
Uses
@microsoft/fast-buildto generate theindex.htmlfor theattributetest fixture in@microsoft/fast-html, replacing the previously hand-authored file with a reproducible build step.build:fixturesscript tofast-htmlthat invokes thefast-buildCLI to render shadow DOM for each fixturetemplates.htmlfileentry.html(with{{}}binding syntax) andstate.jsonas the source inputs to the builddirective.rs) to resolve{{}}attribute bindings on custom element outer tags even when no parent hydration scope is presentbuild-fixtures.jsso template injection failures are surfaced immediately rather than silently no-oping👩💻 Reviewer Notes
The Rust fix in
directive.rs(build_element_open_tag) is small but load-bearing — without it,{{type}}in<test-element type="{{type}}">would pass through unresolved to the output.The
build-fixtures.jsscript now throws a descriptive error if<script type="module"is not found in the rendered output before attempting template injection, ensuring build failures are never silently swallowed.📑 Test Plan
Run
npm run build:fixtures -w @microsoft/fast-htmland verify the outputindex.htmlis correctly generated. All existing Playwright tests for theattributefixture continue to pass.✅ Checklist
General
$ npm run change⏭ Next Steps