Skip to content

feat: add FAST template converter CLI#7633

Open
janechu wants to merge 7 commits into
mainfrom
users/janechu/add-rust-util-webui-fast-converter
Open

feat: add FAST template converter CLI#7633
janechu wants to merge 7 commits into
mainfrom
users/janechu/add-rust-util-webui-fast-converter

Conversation

@janechu

@janechu janechu commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Pull Request

📖 Description

Adds fast convert to @microsoft/fast-build so FAST declarative .html templates can be converted to WebUI prerelease HTML or FAST v3 TypeScript. This includes the new microsoft-fast-convert Rust crate, Node CLI/config integration, fixture validation, docs, package build/packaging updates, and release/version-sync support for the bundled converter crate.

👩‍💻 Reviewer Notes

Please review the converter's intentionally limited expression grammar and the packaging changes that include converter WASM files under wasm/convert/.

📑 Test Plan

  • cargo fmt --manifest-path crates/microsoft-fast-convert/Cargo.toml -- --check
  • cargo check --manifest-path crates/microsoft-fast-convert/Cargo.toml
  • cargo test --manifest-path crates/microsoft-fast-convert/Cargo.toml
  • cargo test --manifest-path crates/microsoft-fast-build/Cargo.toml
  • npm run build -w @microsoft/fast-build
  • npm run test:node -w @microsoft/fast-build
  • npm run checkchange
  • npm run biome:check
  • Targeted npx biome check --no-errors-on-unmatched ... for changed JS/JSON files
  • npm pack --dry-run --json -w @microsoft/fast-build verified converter WASM files are included

✅ 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 relevent to my changes
  • I have updated the DESIGN.md file(s) in packages relevent to my changes

janechu and others added 4 commits June 30, 2026 16:04
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@janechu janechu marked this pull request as ready for review July 1, 2026 17:15
@janechu janechu requested a review from Copilot July 1, 2026 17:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new fast convert subcommand to @microsoft/fast-build, backed by a new microsoft-fast-convert Rust/WASM module, to convert FAST declarative .html templates into either WebUI prerelease HTML or FAST v3 TypeScript output. This extends the existing fast-build CLI/WASM integration model and updates packaging + release/version-sync tooling to treat the converter crate as a bundled asset of the fast-build release.

Changes:

  • Added fast convert CLI subcommand with config loading, path/output validation, and converter WASM dispatch.
  • Introduced the microsoft-fast-convert crate (Rust API + wasm-bindgen export) with conversion + validation tests.
  • Updated packaging, docs, CI Rust validation, and release scripts to include/sync the bundled converter crate and WASM outputs.

Reviewed changes

Copilot reviewed 35 out of 39 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/fast-build/wasm/convert/.npmignore Packaging ignore override for converter wasm directory.
packages/fast-build/wasm/.npmignore Packaging ignore override for wasm directory.
packages/fast-build/test/wasm-stub.cjs Test preload stub extended to intercept converter WASM module.
packages/fast-build/test/fixtures/convert/validation/unsupported-f-attribute/template.html Fixture input for unsupported f-* attribute validation.
packages/fast-build/test/fixtures/convert/validation/unsupported-f-attribute/fast-convert.config.json Fixture config for unsupported f-* attribute case.
packages/fast-build/test/fixtures/convert/validation/missing-inner-template/template.html Fixture input for missing inner <template> validation.
packages/fast-build/test/fixtures/convert/validation/missing-inner-template/fast-convert.config.json Fixture config for missing inner <template> case.
packages/fast-build/test/fixtures/convert/validation/invalid-repeat/template.html Fixture input for invalid repeat expression validation.
packages/fast-build/test/fixtures/convert/validation/invalid-repeat/fast-convert.config.json Fixture config for invalid repeat expression case.
packages/fast-build/test/fixtures/convert/supported.html Supported conversion fixture covering directives/attrs/bindings.
packages/fast-build/test/fixtures/convert/fast-convert.config.json Default fixture config used to validate config discovery + output patterns.
packages/fast-build/test/fixtures/convert/convert-fixtures.test.js End-to-end fixture tests for fast convert output + validation errors.
packages/fast-build/test/config.test.js CLI tests extended for convert, help output, and stubbed converter WASM.
packages/fast-build/README.md User-facing documentation for fast convert usage/config/fixtures.
packages/fast-build/package.json Exports/files/scripts updated to include converter WASM and tests.
packages/fast-build/DESIGN.md Architecture docs updated for convert command and bundled WASM/module map.
packages/fast-build/build-wasm.cjs New build helper to build both build and convert WASM artifacts.
packages/fast-build/bin/fast.js CLI updated to dispatch build vs convert, config validation, convert path rules.
crates/microsoft-fast-convert/tests/errors.rs Rust tests for converter validation/unsupported cases.
crates/microsoft-fast-convert/tests/conversions.rs Rust tests for expected conversions for both targets.
crates/microsoft-fast-convert/src/wasm.rs wasm-bindgen export for convert_template.
crates/microsoft-fast-convert/src/syntax/webui.rs WebUI prerelease conversion pass for directives + attribute validation.
crates/microsoft-fast-convert/src/syntax/mod.rs Shared directive parsing/validation helpers for syntax backends.
crates/microsoft-fast-convert/src/syntax/fast_v3_ts.rs FAST v3 TS conversion pass, escaping, and helper import selection.
crates/microsoft-fast-convert/src/lib.rs Public Rust API surface and module wiring.
crates/microsoft-fast-convert/src/html.rs Hand-scanner for tags/attrs and <f-template>/inner <template> extraction.
crates/microsoft-fast-convert/src/expression.rs Limited expression grammar conversion + repeat/event scope handling.
crates/microsoft-fast-convert/src/error.rs Converter error model + contextual error formatting.
crates/microsoft-fast-convert/src/converter.rs Syntax selection and dispatch after shared template validation.
crates/microsoft-fast-convert/README.md Crate-level docs for Rust and WASM usage + validation scope.
crates/microsoft-fast-convert/DESIGN.md Design doc for converter pipeline/modules/targets.
crates/microsoft-fast-convert/Cargo.toml New crate manifest (bundled with fast-build release).
crates/microsoft-fast-convert/Cargo.lock New lockfile for converter crate dependencies.
change/@microsoft-fast-build-40280b6e-6a6e-4d63-92ce-3158204cb0e0.json Beachball change file for @microsoft/fast-build minor feature.
build/scripts/download-github-releases.mjs Release validation updated to support bundled crate pairing for fast-build.
build/scripts/create-github-releases.mjs GitHub release creation updated to attach multiple crate assets per package.
beachball.config.js Version sync updated to bump multiple paired crates for one npm package.
.github/workflows/README.md Docs updated for bundled fast-build release assets (npm + multiple crates).
.github/workflows/ci-validate-rust.yml CI updated to run Rust tests for both fast-build and fast-convert crates.

Comment thread crates/microsoft-fast-convert/src/expression.rs
janechu and others added 3 commits July 1, 2026 11:01
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

2 participants