feat: add configurable CSS asset names#313
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ef31b13 to
e089f19
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds configurable Link-mode CSS asset naming (including content-hash support) and an optional public base prefix for emitted stylesheet hrefs, threading the configuration across the Rust core, CLI, Node bindings/TS API, and documentation.
Changes:
- Introduces Link-mode CSS filename templating (
[name],[hash],[ext]) andcss_public_basefor CDN/public URL prefixing. - Moves CSS link href/filename resolution into
webui-parser(CssLinkOptions/ParserOptions) and re-plumbs parser/plugin construction to use options at creation time. - Exposes the new options via Rust
BuildOptions, CLI flags, Node native bindings, the TS package API, and updates docs/spec.
Reviewed changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/webui/src/index.ts | Adds JS API options and CLI fallback flags for CSS template/public base. |
| packages/webui/README.md | Documents new JS build options. |
| examples/demo/server/src/shell.rs | Updates example to use BuildOptions::default() struct update pattern. |
| examples/app/commerce/server/src/frontend.rs | Updates example construction to use defaults + overrides. |
| docs/guide/integrations/rust.md | Documents new Rust build options. |
| docs/guide/integrations/node.md | Documents new Node build options. |
| docs/guide/cli/index.md | Documents new CLI flags + guidance for hashing/CDN base. |
| docs/ai.md | Updates AI-facing CLI reference for new flags. |
| DESIGN.md | Updates spec for Link-mode CSS href behavior and parser options construction. |
| crates/webui/src/lib.rs | Adds new build options defaults, integrates ParserOptions, resolves CSS href/filenames, adds tests. |
| crates/webui/src/error.rs | Adds InvalidBuildOptions error variant. |
| crates/webui/README.md | Documents new Rust build options and recommended CDN/hash usage. |
| crates/webui/examples/streaming_resource_bench.rs | Updates to new BuildOptions::default() pattern. |
| crates/webui/examples/streaming_e2e_ttfb_bench.rs | Updates to new BuildOptions::default() pattern. |
| crates/webui/benches/streaming_bench.rs | Updates to new BuildOptions::default() pattern. |
| crates/webui/benches/contact_book_bench.rs | Updates to new BuildOptions::default() pattern. |
| crates/webui-wasm/src/lib.rs | Switches to HtmlParser::with_options(...) API. |
| crates/webui-press/src/build.rs | Updates builder construction to use defaults + overrides. |
| crates/webui-parser/src/plugin/webui.rs | Moves plugin configuration to configure(&ParserOptions). |
| crates/webui-parser/src/plugin/mod.rs | Adds ParserPlugin::configure hook. |
| crates/webui-parser/src/plugin/fast_v3.rs | Uses processed templates for consistent CSS links; adds css-link-aware generation helper. |
| crates/webui-parser/src/plugin/fast_v2.rs | Same as fast_v3 changes for FAST v2. |
| crates/webui-parser/src/lib.rs | Introduces ParserOptions and new parser constructors; updates template processing to use options. |
| crates/webui-parser/src/css_link.rs | New module implementing template + public-base resolution and caching. |
| crates/webui-parser/Cargo.toml | Adds sha2 dependency for content hashing. |
| crates/webui-parser/benches/parser_bench.rs | Updates bench to new parser construction API. |
| crates/webui-node/src/lib.rs | Exposes new options through N-API bindings. |
| crates/webui-cli/src/commands/serve.rs | Updates CLI tests/config to include new build options fields. |
| crates/webui-cli/src/commands/common.rs | Adds CLI flags, wiring into BuildOptions, and a unit test. |
| crates/webui-cli/src/commands/build.rs | Updates CLI build command wiring/tests to include new fields. |
| crates/webui-cli/README.md | Documents new CLI flags and examples. |
| Cargo.lock | Bumps workspace crate versions and adds sha2 to webui-parser deps. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
mcritzjam
approved these changes
May 27, 2026
Copilot AI
added a commit
that referenced
this pull request
May 27, 2026
Clustered changes since v0.0.13: 1) CSS asset naming + parser pipeline (#313) - Added configurable CSS asset names across parser plugins and runtime integration paths. - Introduced dedicated CSS link handling in the parser with broader coverage in benches/examples. - Updated CLI, Node, Rust, and docs surfaces to expose and document the new behavior. 2) Custom protocol output path in CLI/FFI (#314) - Added support for writing protocol output with --out=<path>.bin in the build command flow. - Updated CLI docs and FFI headers so generated protocol output can be redirected predictably. 3) Release alignment for 0.0.14 - Ran cargo xtask version 0.0.14 to synchronize crate/npm/.NET version metadata. - Regenerated dependency lock state as part of the release bump workflow.
mohamedmansour
pushed a commit
that referenced
this pull request
May 27, 2026
* Progress: ran version bump and release checks * chore(release): summarize 0.0.14 changes Clustered changes since v0.0.13: 1) CSS asset naming + parser pipeline (#313) - Added configurable CSS asset names across parser plugins and runtime integration paths. - Introduced dedicated CSS link handling in the parser with broader coverage in benches/examples. - Updated CLI, Node, Rust, and docs surfaces to expose and document the new behavior. 2) Custom protocol output path in CLI/FFI (#314) - Added support for writing protocol output with --out=<path>.bin in the build command flow. - Updated CLI docs and FFI headers so generated protocol output can be redirected predictably. 3) Release alignment for 0.0.14 - Ran cargo xtask version 0.0.14 to synchronize crate/npm/.NET version metadata. - Regenerated dependency lock state as part of the release bump workflow. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@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.
Summary
[name],[hash], and[ext]tokens, defaulting to[name].[ext].webui-parser, share cached resolution across parser/build consumers, and keep parser construction ergonomic withParserOptions.Documentation
DESIGN.md, CLI docs, Rust/Node integration docs,docs/ai.md, crate READMEs, and package README.Validation
pnpm --filter @microsoft/webui buildcargo xtask checkFixes #310
Fixes #311