You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
webui::render_component_assets(protocol, roots, template) currently renders static component assets from an already-built WebUIProtocol. That is a good API for the full build/CLI path, but it still requires a full webui::build() first: app entry parsing, full protocol construction, plugin artifact extraction, and protocol serialization inputs.
For dev/HMR and future bundler-plugin flows, we should support a scoped asset-emission path that compiles only the requested asset roots and their conservative dependency closure.
Motivation
When a developer changes one lazy component, a watcher or bundler plugin should be able to re-emit that component's .webui.js asset without rebuilding the full app entry and unrelated protocol graph. This matters for:
HMR latency in large apps with many templates.
Bundler plugins that want to emit one changed root into the module graph.
Lower memory use during watch mode by avoiding full protocol construction for unrelated fragments.
Current behavior
PR #360 introduced static component assets. The full build path parses requested roots through synthetic non-entry fragments so the normal parser/plugin component compilation path runs, then removes the synthetic wrapper fragments before protocol serialization.
That proves the parser already has most of the mechanism needed for scoped roots, but today the public asset renderer still consumes a full protocol.
Proposed direction
Add a build/compiler entry point that:
Registers app/external components using the existing discovery path.
Skips parsing the SSR entry file.
Parses only requested component asset roots through the existing synthetic-root/component compilation path.
Computes the same conservative closure used by render_component_assets.
Emits one or more ComponentAssetFiles without producing unrelated protocol fragments.
Summary
webui::render_component_assets(protocol, roots, template)currently renders static component assets from an already-builtWebUIProtocol. That is a good API for the full build/CLI path, but it still requires a fullwebui::build()first: app entry parsing, full protocol construction, plugin artifact extraction, and protocol serialization inputs.For dev/HMR and future bundler-plugin flows, we should support a scoped asset-emission path that compiles only the requested asset roots and their conservative dependency closure.
Motivation
When a developer changes one lazy component, a watcher or bundler plugin should be able to re-emit that component's
.webui.jsasset without rebuilding the full app entry and unrelated protocol graph. This matters for:Current behavior
PR #360 introduced static component assets. The full build path parses requested roots through synthetic non-entry fragments so the normal parser/plugin component compilation path runs, then removes the synthetic wrapper fragments before protocol serialization.
That proves the parser already has most of the mechanism needed for scoped roots, but today the public asset renderer still consumes a full protocol.
Proposed direction
Add a build/compiler entry point that:
render_component_assets.ComponentAssetFiles without producing unrelated protocol fragments.Possible API shapes:
or an incremental parser API that a bundler plugin can reuse:
Constraints
webui-component-asset, version 1, templates, templateStyles, templateFunctions).ProtocolIndex/ inventory filtering in this build-time path.Acceptance criteria
<if>,<for>, attribute-template, and route-branch closure dependencies.Related: PR #360 review discussion.