Skip to content

feat: add structured build and conversion errors - #7769

Merged
Jane Chu (janechu) merged 1 commit into
mainfrom
users/janechu/issue-7750
Oct 20, 2026
Merged

Jane Chu (janechu) merged 1 commit into
mainfrom
users/janechu/issue-7750

Conversation

@janechu

Copy link
Copy Markdown
Collaborator

Pull Request

📖 Description

Adds structured build-time diagnostics so integrations can report authored HTML locations without parsing error messages or searching for repeated expressions.

WASM render, conversion, composition, and metadata-validation failures now throw actual Error objects with stable codes and optional UTF-16 locations/template names. Native Rust accessors and generated TypeScript interfaces expose the same details. Existing human-readable messages, successful output, warnings, permissive metadata parsing, and missing-state behavior are preserved.

🎫 Issues

Closes #7750.

👩‍💻 Reviewer Notes

Entry/conversion locations refer to the original HTML, including after preprocessing and recursive extraction. Separately supplied component failures use their supplied content and templateName, never invented entry-file coordinates. Non-HTML failures omit source coordinates.

Intentional pre-1.0 API changes: JavaScript catch values change from strings to Error objects; native context fields use ErrorContext, and source-annotated validation errors may use Located. The migration guide covers .message, .kind(), and source selection.

There are no fast-element client-runtime changes. Diagnostic contexts/source remapping are created only on failure; locator definitions retain an additional original string only when code-sample escaping changed their content.

📑 Test Plan

Regressions were confirmed failing before implementation. Coverage includes actual Error instances/stacks, codes, exact UTF-16 coordinates/highlight lengths, CRLF/lone-CR/LF, duplicate markup, nested when/repeat/light DOM, named nested definitions, code-sample escaping, all converter targets/publisher rewriting, validation wrappers, absent non-HTML coordinates, and generated declarations.

Command Result
cargo test --manifest-path crates/microsoft-fast-build/Cargo.toml --quiet Passed: complete native renderer suite
cargo test --manifest-path crates/microsoft-fast-convert/Cargo.toml --quiet Passed: complete native converter suite
cargo test --manifest-path crates/microsoft-fast-convert/Cargo.toml --test errors --quiet Passed: 24 error tests after final equivalent Unicode-escape cleanup
npm run build -w @microsoft/fast-build Passed: rebuilt both WASM modules
node --test packages/fast-build/test/plugin-integrations.test.js Passed: all 14 integration/type tests
npm run build -- --no-cache Passed: all 9 workspace tasks
npm run test -- --no-cache Passed: all 14 workspace tasks, including browser suites
npm run biome:check Passed
npm run biome:check -- --staged Passed: changed JavaScript checked before commit
npm run format:check Passed; no additional files selected by its changed-file filter
npm run checkchange Passed after committing the generated change file
npm run prebuild -w sites/website Passed

✅ Checklist

General

  • I have included a change request file using $ npm run change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Agents

  • I have linked to an existing issue in this project that this change addresses
  • I have read the skills
  • I have read the DESIGN.md file(s) in packages relevant to my changes
  • I have updated the DESIGN.md file(s) in packages relevant to my changes

⏭ Next Steps

None required for this issue.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 25176605-2de9-4537-b426-11537e2d8fd1
@janechu
Jane Chu (janechu) merged commit 118f053 into main Oct 20, 2026
11 checks passed
@janechu
Jane Chu (janechu) deleted the users/janechu/issue-7750 branch October 20, 2026 19:00
@janechu Jane Chu (janechu) mentioned this pull request Oct 20, 2026
6 of 9 tasks
Jane Chu (janechu) added a commit that referenced this pull request Oct 20, 2026
<!---
Thanks for filing a pull request 😄 ! Before you submit, please read the following:

Search open/closed issues before submitting. Someone may have pushed the same thing before!

Provide a summary of your changes in the title field above.
-->

# Pull Request

## 📖 Description

<!---
Provide some background and a description of your work.
What problem does this change solve?
Is this a breaking change, chore, fix, feature, etc?
-->

Prepares `@microsoft/fast-build` **0.14.0**, including authored binding spans and structured errors with source locations.

Generated with `npm run bump`: synchronizes `microsoft-fast-build` and `microsoft-fast-convert` to **0.14.0**, updates workspace dependency ranges and lockfiles, generates changelogs, and consumes all four pending change files. `@microsoft/fast-element` remains **3.1.2**; its documentation-only change is recorded without a version bump.

### 🎫 Issues

<!---
* List and link relevant issues here.
-->

Releases the changes for #7763 and #7750, implemented in #7768 and #7769.

## 👩‍💻 Reviewer Notes

<!---
Provide some notes for reviewers to help them provide targeted feedback and testing.

Do you recommend a smoke test for this PR? What steps should be followed?
Are there particular areas of the code the reviewer should focus on?
-->

This is a metadata-only bump PR on the documented `publish_<timestamp>` branch. It creates no release/tag and publishes no packages. The release preview identifies only `@microsoft/fast-build@0.14.0`, bundled with both synchronized Rust crates.

Existing change files are consumed rather than adding another change file. `npm run checkchange` passes through the documented publish-branch/admin policy. Generated consumer dependency updates do not add other package version bumps.

Refreshing all local tags encountered pre-existing historical local/remote tag conflicts; no tags were overwritten. The relevant remote release tags were checked separately, and the new `0.14.0` tag does not exist.

## 📑 Test Plan

<!---
Please provide a summary of the tests affected by this work and any unique strategies employed in testing the features/fixes.
-->

| Command | Result |
|---|---|
| `npm run bump` | Passed: generated versions, changelogs, dependency updates, and paired Rust synchronization |
| `node build/scripts/create-github-releases.mjs --check-only` | Passed: only fast-build 0.14.0 and both bundled Rust crates need a release |
| `cargo metadata --manifest-path crates/microsoft-fast-build/Cargo.toml --no-deps --locked --format-version 1` | Passed: locked package version is 0.14.0 |
| `cargo metadata --manifest-path crates/microsoft-fast-convert/Cargo.toml --no-deps --locked --format-version 1` | Passed: locked package version is 0.14.0 |
| `npm run build` | Passed: all 9 workspace tasks |
| `npm run test` | Passed: 6 tasks succeeded; 8 skipped by Lage |
| `npm pack --dry-run --json -w @microsoft/fast-build` | Passed: version 0.14.0 includes both rebuilt WASM modules; no tarball published |
| `npm run biome:check -- -- --no-errors-on-unmatched` | Passed: no eligible source files in this generated-only diff |
| `npm run format:check` | Passed: no eligible files selected |
| `npm run checkchange` | Passed: publish-branch/admin policy verified |

No new tests are needed for generated version/changelog metadata.

## ✅ Checklist

### General

<!--- Review the list and put an x in the boxes that apply. -->

- [ ] I have included a change request file using `$ npm run change`
- [ ] I have added tests for my changes.
- [x] I have tested my changes.
- [x] I have updated the project documentation to reflect my changes.
- [x] I have read the [CONTRIBUTING](https://github.com/microsoft/fast/blob/main/CONTRIBUTING.md) documentation and followed the [standards](https://github.com/microsoft/fast/blob/main/CODE_OF_CONDUCT.md#our-standards) for this project.

### Agents

<!--- Review the list and put an x in the boxes that apply. -->

- [x] I have linked to an existing issue in this project that this change addresses
- [x] I have read the skills
- [x] I have read the DESIGN.md file(s) in packages relevant to my changes
- [ ] I have updated the DESIGN.md file(s) in packages relevant to my changes

## ⏭ Next Steps

<!---
If there is relevant follow-up work to this PR, please list any existing issues or provide brief descriptions of what you would like to do next.
-->

After human review and merge, the existing GitHub release/Azure CD flow can create and publish the release artifacts.
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.

feat: add structured error codes and source locations to fast-build errors

2 participants