streetui 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +1 -1
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/bin.js.map +1 -1
- package/dist/create-bin.cjs +1 -1
- package/dist/create-bin.cjs.map +1 -1
- package/dist/create-bin.js +1 -1
- package/dist/create-bin.js.map +1 -1
- package/dist/index.cjs +139 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -6
- package/dist/index.d.ts +35 -6
- package/dist/index.js +138 -3
- package/dist/index.js.map +1 -1
- package/dist/{server-C2xovHHb.d.cts → server-ZBh5DO-z.d.cts} +26 -0
- package/dist/{server-xU-BEwAj.d.ts → server-jbB-7oN-.d.ts} +26 -0
- package/dist/server.cjs +137 -3
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +137 -3
- package/dist/server.js.map +1 -1
- package/dist/testing.cjs +189 -109
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.js +189 -109
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2,8 +2,8 @@ import { a as Signal, b as Subscriber, U as Unsubscribe, R as ReadonlySignal, A
|
|
|
2
2
|
export { g as A11yOptions, h as AppBuilder, i as AppDSL, j as AppOptions, k as ApplicationGraphOptions, B as BaseNode, l as Bindable, m as BindableText, n as BoundInputOptions, o as ButtonOptions, p as CompileOptions, q as ContainerBuilder, r as ContainerBuilderImpl, s as ContainerOptions, t as ContentDSL, u as ControlledInputOptions, v as DerivedSignal, w as Diagnostic, x as DiagnosticError, y as DiagnosticLocation, z as DiagnosticSeverity, E as ErrorBoundaryOptions, F as ErrorFallbackBuilder, H as ErrorSource, I as EventDescriptor, J as FormBuilder, K as FormBuilderImpl, L as FormDSL, M as FormOptions, N as GraphNodeData, O as HandlerFn, Q as HeadingOptions, T as ImageOptions, W as InputOptions, X as InputOptionsBase, Y as LinkOptions, Z as ListBuilder, _ as ListBuilderImpl, $ as ListDSL, a0 as ListOptions, a1 as ListPlanEntry, a2 as NodeId, a3 as NodeMetadata, a4 as PageBuilder, a5 as PageBuilderImpl, a6 as PropValue, a7 as Props, a8 as ReactiveConsumer, a9 as ReactiveSource, aa as SectionBuilder, ab as SectionBuilderImpl, ac as SectionDSL, ad as SectionOptions, ae as SerializedGraph, af as SerializedNode, ag as StateRef, S as StreetApp, ah as StreetUI, ai as TextOptions, aj as TextValue, V as VERSION, ak as batch, al as compile, am as compileGraph, an as createNodeId, ao as derived, ap as effect, aq as formatDiagnostic, ar as generateApplicationId, as as generateNodeId, at as isBatching, au as nextId, av as nodeIdPrefix, aw as observerCount, ax as reactiveListItemKey, ay as reactiveListItemSignature, az as resetIdCounter, aA as signal, aB as signalKind, aC as streetui } from './compile-CEom4hkp.cjs';
|
|
3
3
|
import { R as RenderHandle, S as StreetRenderer, a as HydrationDiagnosticSink } from './hydration-diagnostics-D286jpZZ.cjs';
|
|
4
4
|
export { H as HydrationDiagnostic, b as HydrationMismatchType, c as consoleHydrationDiagnosticSink, d as createHydrationDiagnosticCollector, f as formatHydrationDiagnostic } from './hydration-diagnostics-D286jpZZ.cjs';
|
|
5
|
-
import { D as DOMAdapter } from './server-
|
|
6
|
-
export { R as RenderToStringOptions, S as STATE_MARKER_ATTR, a as ServerDOMAdapter, r as readState, b as renderToString, s as serializeState, c as serverDOMAdapter } from './server-
|
|
5
|
+
import { D as DOMAdapter } from './server-ZBh5DO-z.cjs';
|
|
6
|
+
export { R as RenderToStringOptions, S as STATE_MARKER_ATTR, a as ServerDOMAdapter, r as readState, b as renderToString, s as serializeState, c as serverDOMAdapter } from './server-ZBh5DO-z.cjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A simple reactive store built on top of signals.
|
|
@@ -579,7 +579,7 @@ declare const browserDOMAdapter: BrowserDOMAdapter;
|
|
|
579
579
|
* `DOMAdapter` interface, and `ServerDOMAdapter` translates adapter calls into
|
|
580
580
|
* operations on this model.
|
|
581
581
|
*/
|
|
582
|
-
type ServerNodeKind = 'element' | 'text' | 'comment' | 'fragment';
|
|
582
|
+
type ServerNodeKind = 'element' | 'text' | 'comment' | 'fragment' | 'raw';
|
|
583
583
|
interface ServerNode {
|
|
584
584
|
readonly kind: ServerNodeKind;
|
|
585
585
|
parent: ServerParent | null;
|
|
@@ -609,6 +609,25 @@ declare class ServerFragment implements ServerNode {
|
|
|
609
609
|
parent: ServerParent | null;
|
|
610
610
|
readonly children: ServerNode[];
|
|
611
611
|
}
|
|
612
|
+
/**
|
|
613
|
+
* A pre-serialized, verbatim HTML fragment (v1.7 static SSR plan).
|
|
614
|
+
*
|
|
615
|
+
* Emitted for provably-static subtrees whose HTML the compiler-derived static
|
|
616
|
+
* SSR plan already computed once. Serializing this node copies its stored
|
|
617
|
+
* string directly — it allocates no ServerElement/ServerText, no attribute Map
|
|
618
|
+
* and no children array for the collapsed subtree. The stored `html` is
|
|
619
|
+
* produced by the exact same mount + serialize pipeline as the runtime path, so
|
|
620
|
+
* the output is byte-identical (the v1.7 byte-identity gate proves this).
|
|
621
|
+
*
|
|
622
|
+
* This node is SSR-only: it is created solely via `ServerDOMAdapter.createRawHTML`
|
|
623
|
+
* on the server render path and never appears in a browser build.
|
|
624
|
+
*/
|
|
625
|
+
declare class ServerRawHTML implements ServerNode {
|
|
626
|
+
readonly kind: "raw";
|
|
627
|
+
parent: ServerParent | null;
|
|
628
|
+
readonly html: string;
|
|
629
|
+
constructor(html: string);
|
|
630
|
+
}
|
|
612
631
|
declare class ServerElement implements ServerNode {
|
|
613
632
|
readonly kind: "element";
|
|
614
633
|
parent: ServerParent | null;
|
|
@@ -627,7 +646,7 @@ declare class ServerElement implements ServerNode {
|
|
|
627
646
|
declare function escapeHtmlText(value: string): string;
|
|
628
647
|
/** Escape a double-quoted attribute value. */
|
|
629
648
|
declare function escapeHtmlAttr(value: string): string;
|
|
630
|
-
/** Serialize a single server node (element/text/comment/fragment) to HTML. */
|
|
649
|
+
/** Serialize a single server node (element/text/comment/fragment/raw) to HTML. */
|
|
631
650
|
declare function serializeServerNode(node: ServerNode): string;
|
|
632
651
|
/** Serialize the children of an element or fragment (its "inner HTML"). */
|
|
633
652
|
declare function serializeChildren(node: ServerElement | ServerFragment): string;
|
|
@@ -698,8 +717,18 @@ interface RenderContext {
|
|
|
698
717
|
* DevTools/diagnostics stay off the production runtime path.
|
|
699
718
|
*/
|
|
700
719
|
readonly hydrationDiagnostics?: HydrationDiagnosticSink;
|
|
720
|
+
/**
|
|
721
|
+
* Optional SSR-only static-subtree plan (v1.7). Maps a maximal
|
|
722
|
+
* static-subtree root GraphNode.id → its precomputed, verbatim HTML string.
|
|
723
|
+
* Present only on the server render path when a plan has been built; on the
|
|
724
|
+
* browser mount path it is always `undefined`, so the client hot path is
|
|
725
|
+
* unaffected (a single `=== undefined` check short-circuits). When a mounted
|
|
726
|
+
* node's id is in this map, the renderer emits the precomputed HTML via
|
|
727
|
+
* `dom.createRawHTML` instead of recursively constructing the subtree.
|
|
728
|
+
*/
|
|
729
|
+
readonly staticHTML?: ReadonlyMap<string, string>;
|
|
701
730
|
}
|
|
702
|
-
declare function createRenderContext(dom: DOMAdapter, graph: ApplicationGraph, container: Element, hydrationDiagnostics?: HydrationDiagnosticSink): RenderContext;
|
|
731
|
+
declare function createRenderContext(dom: DOMAdapter, graph: ApplicationGraph, container: Element, hydrationDiagnostics?: HydrationDiagnosticSink, staticHTML?: ReadonlyMap<string, string>): RenderContext;
|
|
703
732
|
|
|
704
733
|
/**
|
|
705
734
|
* Attribute and property application helpers.
|
|
@@ -1807,4 +1836,4 @@ interface ResolvedConfig {
|
|
|
1807
1836
|
/** Identity helper that gives `streetui.config.ts` full type-checking + inference. */
|
|
1808
1837
|
declare function defineConfig(config: StreetUIConfig): StreetUIConfig;
|
|
1809
1838
|
|
|
1810
|
-
export { type A11yIds, Application, ApplicationGraph, ApplicationId, type ApplicationIdentity, type ApplicationInspection, type ApplicationOptions, type ApplicationPanel, BrowserDOMAdapter, CleanupRegistry, CompiledApplication, ContainerDSL, type Context, type ContextInspection, type ContextLike, DEFAULT_PERF_THRESHOLDS, DOMAdapter, type DevToolsOptions, type DevToolsSession, type DevToolsSnapshot, type DevToolsSources, DiagnosticCollector, type DiagnosticContext, type DiagnosticSink, type DiagnosticsSummary, type DomBinding, DomEventRegistry, Environment, type EnvironmentCapabilities, type EnvironmentKind, EventBus, type EventHandler, FOCUSABLE_SELECTOR, type Field, type Form, type FormConfig, type FormInspection, type FormLike, type FormValidators, type FormValues, GraphNode, HydrationDiagnosticSink, type I18n, type I18nConfig, type I18nInspection, type I18nLike, type InspectFormOptions, type InspectI18nOptions, type InspectResourceOptions, type InspectSignalOptions, type InspectedNode, type InspectedPage, type InterpolationParams, type IsActiveOptions, type Job, Lifecycle, type LifecycleHook, type LifecyclePhase, type MatchResult, type MessageMap, type MountFn, type MountRouterOptions, type MountedApplication, type MountedRouter, type NavigateOptions, NodeInstance, type NodeInstanceOptions, PageDSL, type PerfDiagnostic, type PerfDiagnosticCode, type PerfSnapshot, type PerfThresholds, type PerformancePanel, type PlanEntry, type Priority, ROUTER_OUTLET_ID, ReadonlySignal, type ReconcileResult, type RenderContext, RenderHandle, type ResolvedConfig, type Resource, type ResourceInspection, type ResourceLike, type ResourceLoader, type ResourceLoaderContext, type ResourceOptions, type ResourceStatus, type RouteBuilder, type RouteContext, type RouteDefinition, type RouteMatch, type RouteMatchLike, type Router, type RouterHistory, type RouterInspection, type RouterLike, type RouterLocation, type RouterOptions, Runtime, RuntimeNodeInstance, type RuntimeOptions, Scheduler, type SchedulerDiagnostics, SemanticNodeType, ServerComment, ServerElement, ServerFragment, type ServerNode, type ServerNodeKind, type ServerParent, ServerStyle, ServerText, type ShellBuilder, Signal, type SignalInspection, SignalKind, type SignalsPanel, Store, type StoreState, type StreetEvent, type StreetEventType, StreetFrameworkError, StreetRenderHandle, StreetRenderer, StreetRendererImpl, type StreetRendererOptions, type StreetUIConfig, type SubmitStatus, Subscriber, Unsubscribe, type Validator, a11yIds, applyNodeProps, applyProp, bindDomEvent, browserDOMAdapter, buttonUpdate, consoleDiagnosticSink, createApplication, createBrowserHistory, createContext, createDevTools, createForm, createI18n, createMemoryHistory, createRenderContext, createRenderer, createRouter, createRuntime, createStore, createStreetEvent, defineConfig, diagnosePerformance, email, environment, escapeHtmlAttr, escapeHtmlText, flushSync, focusById, focusFirst, formatDiagnosticContext, frameworkError, globalEventBus, headingUpdate, hydrateGraph, inputUpdate, inspectApplication, inspectContext, inspectForm, inspectGraph, inspectI18n, inspectResource, inspectRouter, inspectSignal, interpolate, matchPattern, matchRoutes, maxLength, minLength, mountGraph, mountNode, mountRouter, nodeTypeStats, normalizePath, patchNode, patchProp, pattern, printDiagnostics, printGraph, reconcileChildren, reconcileChildrenByPlan, reportDiagnostic, required, resolveTag, resource, routerOutlet, runValidators, scheduleImmediate, scheduleUpdate, scheduler, serializeChildren, serializeServerNode, splitTarget, textUpdate, toIdToken, transformGraph, validateGraph, wireEvents, wireReactiveList, wireSignalBindings };
|
|
1839
|
+
export { type A11yIds, Application, ApplicationGraph, ApplicationId, type ApplicationIdentity, type ApplicationInspection, type ApplicationOptions, type ApplicationPanel, BrowserDOMAdapter, CleanupRegistry, CompiledApplication, ContainerDSL, type Context, type ContextInspection, type ContextLike, DEFAULT_PERF_THRESHOLDS, DOMAdapter, type DevToolsOptions, type DevToolsSession, type DevToolsSnapshot, type DevToolsSources, DiagnosticCollector, type DiagnosticContext, type DiagnosticSink, type DiagnosticsSummary, type DomBinding, DomEventRegistry, Environment, type EnvironmentCapabilities, type EnvironmentKind, EventBus, type EventHandler, FOCUSABLE_SELECTOR, type Field, type Form, type FormConfig, type FormInspection, type FormLike, type FormValidators, type FormValues, GraphNode, HydrationDiagnosticSink, type I18n, type I18nConfig, type I18nInspection, type I18nLike, type InspectFormOptions, type InspectI18nOptions, type InspectResourceOptions, type InspectSignalOptions, type InspectedNode, type InspectedPage, type InterpolationParams, type IsActiveOptions, type Job, Lifecycle, type LifecycleHook, type LifecyclePhase, type MatchResult, type MessageMap, type MountFn, type MountRouterOptions, type MountedApplication, type MountedRouter, type NavigateOptions, NodeInstance, type NodeInstanceOptions, PageDSL, type PerfDiagnostic, type PerfDiagnosticCode, type PerfSnapshot, type PerfThresholds, type PerformancePanel, type PlanEntry, type Priority, ROUTER_OUTLET_ID, ReadonlySignal, type ReconcileResult, type RenderContext, RenderHandle, type ResolvedConfig, type Resource, type ResourceInspection, type ResourceLike, type ResourceLoader, type ResourceLoaderContext, type ResourceOptions, type ResourceStatus, type RouteBuilder, type RouteContext, type RouteDefinition, type RouteMatch, type RouteMatchLike, type Router, type RouterHistory, type RouterInspection, type RouterLike, type RouterLocation, type RouterOptions, Runtime, RuntimeNodeInstance, type RuntimeOptions, Scheduler, type SchedulerDiagnostics, SemanticNodeType, ServerComment, ServerElement, ServerFragment, type ServerNode, type ServerNodeKind, type ServerParent, ServerRawHTML, ServerStyle, ServerText, type ShellBuilder, Signal, type SignalInspection, SignalKind, type SignalsPanel, Store, type StoreState, type StreetEvent, type StreetEventType, StreetFrameworkError, StreetRenderHandle, StreetRenderer, StreetRendererImpl, type StreetRendererOptions, type StreetUIConfig, type SubmitStatus, Subscriber, Unsubscribe, type Validator, a11yIds, applyNodeProps, applyProp, bindDomEvent, browserDOMAdapter, buttonUpdate, consoleDiagnosticSink, createApplication, createBrowserHistory, createContext, createDevTools, createForm, createI18n, createMemoryHistory, createRenderContext, createRenderer, createRouter, createRuntime, createStore, createStreetEvent, defineConfig, diagnosePerformance, email, environment, escapeHtmlAttr, escapeHtmlText, flushSync, focusById, focusFirst, formatDiagnosticContext, frameworkError, globalEventBus, headingUpdate, hydrateGraph, inputUpdate, inspectApplication, inspectContext, inspectForm, inspectGraph, inspectI18n, inspectResource, inspectRouter, inspectSignal, interpolate, matchPattern, matchRoutes, maxLength, minLength, mountGraph, mountNode, mountRouter, nodeTypeStats, normalizePath, patchNode, patchProp, pattern, printDiagnostics, printGraph, reconcileChildren, reconcileChildrenByPlan, reportDiagnostic, required, resolveTag, resource, routerOutlet, runValidators, scheduleImmediate, scheduleUpdate, scheduler, serializeChildren, serializeServerNode, splitTarget, textUpdate, toIdToken, transformGraph, validateGraph, wireEvents, wireReactiveList, wireSignalBindings };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { a as Signal, b as Subscriber, U as Unsubscribe, R as ReadonlySignal, A
|
|
|
2
2
|
export { g as A11yOptions, h as AppBuilder, i as AppDSL, j as AppOptions, k as ApplicationGraphOptions, B as BaseNode, l as Bindable, m as BindableText, n as BoundInputOptions, o as ButtonOptions, p as CompileOptions, q as ContainerBuilder, r as ContainerBuilderImpl, s as ContainerOptions, t as ContentDSL, u as ControlledInputOptions, v as DerivedSignal, w as Diagnostic, x as DiagnosticError, y as DiagnosticLocation, z as DiagnosticSeverity, E as ErrorBoundaryOptions, F as ErrorFallbackBuilder, H as ErrorSource, I as EventDescriptor, J as FormBuilder, K as FormBuilderImpl, L as FormDSL, M as FormOptions, N as GraphNodeData, O as HandlerFn, Q as HeadingOptions, T as ImageOptions, W as InputOptions, X as InputOptionsBase, Y as LinkOptions, Z as ListBuilder, _ as ListBuilderImpl, $ as ListDSL, a0 as ListOptions, a1 as ListPlanEntry, a2 as NodeId, a3 as NodeMetadata, a4 as PageBuilder, a5 as PageBuilderImpl, a6 as PropValue, a7 as Props, a8 as ReactiveConsumer, a9 as ReactiveSource, aa as SectionBuilder, ab as SectionBuilderImpl, ac as SectionDSL, ad as SectionOptions, ae as SerializedGraph, af as SerializedNode, ag as StateRef, S as StreetApp, ah as StreetUI, ai as TextOptions, aj as TextValue, V as VERSION, ak as batch, al as compile, am as compileGraph, an as createNodeId, ao as derived, ap as effect, aq as formatDiagnostic, ar as generateApplicationId, as as generateNodeId, at as isBatching, au as nextId, av as nodeIdPrefix, aw as observerCount, ax as reactiveListItemKey, ay as reactiveListItemSignature, az as resetIdCounter, aA as signal, aB as signalKind, aC as streetui } from './compile-CEom4hkp.js';
|
|
3
3
|
import { R as RenderHandle, S as StreetRenderer, a as HydrationDiagnosticSink } from './hydration-diagnostics-YrG-OJJe.js';
|
|
4
4
|
export { H as HydrationDiagnostic, b as HydrationMismatchType, c as consoleHydrationDiagnosticSink, d as createHydrationDiagnosticCollector, f as formatHydrationDiagnostic } from './hydration-diagnostics-YrG-OJJe.js';
|
|
5
|
-
import { D as DOMAdapter } from './server-
|
|
6
|
-
export { R as RenderToStringOptions, S as STATE_MARKER_ATTR, a as ServerDOMAdapter, r as readState, b as renderToString, s as serializeState, c as serverDOMAdapter } from './server-
|
|
5
|
+
import { D as DOMAdapter } from './server-jbB-7oN-.js';
|
|
6
|
+
export { R as RenderToStringOptions, S as STATE_MARKER_ATTR, a as ServerDOMAdapter, r as readState, b as renderToString, s as serializeState, c as serverDOMAdapter } from './server-jbB-7oN-.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A simple reactive store built on top of signals.
|
|
@@ -579,7 +579,7 @@ declare const browserDOMAdapter: BrowserDOMAdapter;
|
|
|
579
579
|
* `DOMAdapter` interface, and `ServerDOMAdapter` translates adapter calls into
|
|
580
580
|
* operations on this model.
|
|
581
581
|
*/
|
|
582
|
-
type ServerNodeKind = 'element' | 'text' | 'comment' | 'fragment';
|
|
582
|
+
type ServerNodeKind = 'element' | 'text' | 'comment' | 'fragment' | 'raw';
|
|
583
583
|
interface ServerNode {
|
|
584
584
|
readonly kind: ServerNodeKind;
|
|
585
585
|
parent: ServerParent | null;
|
|
@@ -609,6 +609,25 @@ declare class ServerFragment implements ServerNode {
|
|
|
609
609
|
parent: ServerParent | null;
|
|
610
610
|
readonly children: ServerNode[];
|
|
611
611
|
}
|
|
612
|
+
/**
|
|
613
|
+
* A pre-serialized, verbatim HTML fragment (v1.7 static SSR plan).
|
|
614
|
+
*
|
|
615
|
+
* Emitted for provably-static subtrees whose HTML the compiler-derived static
|
|
616
|
+
* SSR plan already computed once. Serializing this node copies its stored
|
|
617
|
+
* string directly — it allocates no ServerElement/ServerText, no attribute Map
|
|
618
|
+
* and no children array for the collapsed subtree. The stored `html` is
|
|
619
|
+
* produced by the exact same mount + serialize pipeline as the runtime path, so
|
|
620
|
+
* the output is byte-identical (the v1.7 byte-identity gate proves this).
|
|
621
|
+
*
|
|
622
|
+
* This node is SSR-only: it is created solely via `ServerDOMAdapter.createRawHTML`
|
|
623
|
+
* on the server render path and never appears in a browser build.
|
|
624
|
+
*/
|
|
625
|
+
declare class ServerRawHTML implements ServerNode {
|
|
626
|
+
readonly kind: "raw";
|
|
627
|
+
parent: ServerParent | null;
|
|
628
|
+
readonly html: string;
|
|
629
|
+
constructor(html: string);
|
|
630
|
+
}
|
|
612
631
|
declare class ServerElement implements ServerNode {
|
|
613
632
|
readonly kind: "element";
|
|
614
633
|
parent: ServerParent | null;
|
|
@@ -627,7 +646,7 @@ declare class ServerElement implements ServerNode {
|
|
|
627
646
|
declare function escapeHtmlText(value: string): string;
|
|
628
647
|
/** Escape a double-quoted attribute value. */
|
|
629
648
|
declare function escapeHtmlAttr(value: string): string;
|
|
630
|
-
/** Serialize a single server node (element/text/comment/fragment) to HTML. */
|
|
649
|
+
/** Serialize a single server node (element/text/comment/fragment/raw) to HTML. */
|
|
631
650
|
declare function serializeServerNode(node: ServerNode): string;
|
|
632
651
|
/** Serialize the children of an element or fragment (its "inner HTML"). */
|
|
633
652
|
declare function serializeChildren(node: ServerElement | ServerFragment): string;
|
|
@@ -698,8 +717,18 @@ interface RenderContext {
|
|
|
698
717
|
* DevTools/diagnostics stay off the production runtime path.
|
|
699
718
|
*/
|
|
700
719
|
readonly hydrationDiagnostics?: HydrationDiagnosticSink;
|
|
720
|
+
/**
|
|
721
|
+
* Optional SSR-only static-subtree plan (v1.7). Maps a maximal
|
|
722
|
+
* static-subtree root GraphNode.id → its precomputed, verbatim HTML string.
|
|
723
|
+
* Present only on the server render path when a plan has been built; on the
|
|
724
|
+
* browser mount path it is always `undefined`, so the client hot path is
|
|
725
|
+
* unaffected (a single `=== undefined` check short-circuits). When a mounted
|
|
726
|
+
* node's id is in this map, the renderer emits the precomputed HTML via
|
|
727
|
+
* `dom.createRawHTML` instead of recursively constructing the subtree.
|
|
728
|
+
*/
|
|
729
|
+
readonly staticHTML?: ReadonlyMap<string, string>;
|
|
701
730
|
}
|
|
702
|
-
declare function createRenderContext(dom: DOMAdapter, graph: ApplicationGraph, container: Element, hydrationDiagnostics?: HydrationDiagnosticSink): RenderContext;
|
|
731
|
+
declare function createRenderContext(dom: DOMAdapter, graph: ApplicationGraph, container: Element, hydrationDiagnostics?: HydrationDiagnosticSink, staticHTML?: ReadonlyMap<string, string>): RenderContext;
|
|
703
732
|
|
|
704
733
|
/**
|
|
705
734
|
* Attribute and property application helpers.
|
|
@@ -1807,4 +1836,4 @@ interface ResolvedConfig {
|
|
|
1807
1836
|
/** Identity helper that gives `streetui.config.ts` full type-checking + inference. */
|
|
1808
1837
|
declare function defineConfig(config: StreetUIConfig): StreetUIConfig;
|
|
1809
1838
|
|
|
1810
|
-
export { type A11yIds, Application, ApplicationGraph, ApplicationId, type ApplicationIdentity, type ApplicationInspection, type ApplicationOptions, type ApplicationPanel, BrowserDOMAdapter, CleanupRegistry, CompiledApplication, ContainerDSL, type Context, type ContextInspection, type ContextLike, DEFAULT_PERF_THRESHOLDS, DOMAdapter, type DevToolsOptions, type DevToolsSession, type DevToolsSnapshot, type DevToolsSources, DiagnosticCollector, type DiagnosticContext, type DiagnosticSink, type DiagnosticsSummary, type DomBinding, DomEventRegistry, Environment, type EnvironmentCapabilities, type EnvironmentKind, EventBus, type EventHandler, FOCUSABLE_SELECTOR, type Field, type Form, type FormConfig, type FormInspection, type FormLike, type FormValidators, type FormValues, GraphNode, HydrationDiagnosticSink, type I18n, type I18nConfig, type I18nInspection, type I18nLike, type InspectFormOptions, type InspectI18nOptions, type InspectResourceOptions, type InspectSignalOptions, type InspectedNode, type InspectedPage, type InterpolationParams, type IsActiveOptions, type Job, Lifecycle, type LifecycleHook, type LifecyclePhase, type MatchResult, type MessageMap, type MountFn, type MountRouterOptions, type MountedApplication, type MountedRouter, type NavigateOptions, NodeInstance, type NodeInstanceOptions, PageDSL, type PerfDiagnostic, type PerfDiagnosticCode, type PerfSnapshot, type PerfThresholds, type PerformancePanel, type PlanEntry, type Priority, ROUTER_OUTLET_ID, ReadonlySignal, type ReconcileResult, type RenderContext, RenderHandle, type ResolvedConfig, type Resource, type ResourceInspection, type ResourceLike, type ResourceLoader, type ResourceLoaderContext, type ResourceOptions, type ResourceStatus, type RouteBuilder, type RouteContext, type RouteDefinition, type RouteMatch, type RouteMatchLike, type Router, type RouterHistory, type RouterInspection, type RouterLike, type RouterLocation, type RouterOptions, Runtime, RuntimeNodeInstance, type RuntimeOptions, Scheduler, type SchedulerDiagnostics, SemanticNodeType, ServerComment, ServerElement, ServerFragment, type ServerNode, type ServerNodeKind, type ServerParent, ServerStyle, ServerText, type ShellBuilder, Signal, type SignalInspection, SignalKind, type SignalsPanel, Store, type StoreState, type StreetEvent, type StreetEventType, StreetFrameworkError, StreetRenderHandle, StreetRenderer, StreetRendererImpl, type StreetRendererOptions, type StreetUIConfig, type SubmitStatus, Subscriber, Unsubscribe, type Validator, a11yIds, applyNodeProps, applyProp, bindDomEvent, browserDOMAdapter, buttonUpdate, consoleDiagnosticSink, createApplication, createBrowserHistory, createContext, createDevTools, createForm, createI18n, createMemoryHistory, createRenderContext, createRenderer, createRouter, createRuntime, createStore, createStreetEvent, defineConfig, diagnosePerformance, email, environment, escapeHtmlAttr, escapeHtmlText, flushSync, focusById, focusFirst, formatDiagnosticContext, frameworkError, globalEventBus, headingUpdate, hydrateGraph, inputUpdate, inspectApplication, inspectContext, inspectForm, inspectGraph, inspectI18n, inspectResource, inspectRouter, inspectSignal, interpolate, matchPattern, matchRoutes, maxLength, minLength, mountGraph, mountNode, mountRouter, nodeTypeStats, normalizePath, patchNode, patchProp, pattern, printDiagnostics, printGraph, reconcileChildren, reconcileChildrenByPlan, reportDiagnostic, required, resolveTag, resource, routerOutlet, runValidators, scheduleImmediate, scheduleUpdate, scheduler, serializeChildren, serializeServerNode, splitTarget, textUpdate, toIdToken, transformGraph, validateGraph, wireEvents, wireReactiveList, wireSignalBindings };
|
|
1839
|
+
export { type A11yIds, Application, ApplicationGraph, ApplicationId, type ApplicationIdentity, type ApplicationInspection, type ApplicationOptions, type ApplicationPanel, BrowserDOMAdapter, CleanupRegistry, CompiledApplication, ContainerDSL, type Context, type ContextInspection, type ContextLike, DEFAULT_PERF_THRESHOLDS, DOMAdapter, type DevToolsOptions, type DevToolsSession, type DevToolsSnapshot, type DevToolsSources, DiagnosticCollector, type DiagnosticContext, type DiagnosticSink, type DiagnosticsSummary, type DomBinding, DomEventRegistry, Environment, type EnvironmentCapabilities, type EnvironmentKind, EventBus, type EventHandler, FOCUSABLE_SELECTOR, type Field, type Form, type FormConfig, type FormInspection, type FormLike, type FormValidators, type FormValues, GraphNode, HydrationDiagnosticSink, type I18n, type I18nConfig, type I18nInspection, type I18nLike, type InspectFormOptions, type InspectI18nOptions, type InspectResourceOptions, type InspectSignalOptions, type InspectedNode, type InspectedPage, type InterpolationParams, type IsActiveOptions, type Job, Lifecycle, type LifecycleHook, type LifecyclePhase, type MatchResult, type MessageMap, type MountFn, type MountRouterOptions, type MountedApplication, type MountedRouter, type NavigateOptions, NodeInstance, type NodeInstanceOptions, PageDSL, type PerfDiagnostic, type PerfDiagnosticCode, type PerfSnapshot, type PerfThresholds, type PerformancePanel, type PlanEntry, type Priority, ROUTER_OUTLET_ID, ReadonlySignal, type ReconcileResult, type RenderContext, RenderHandle, type ResolvedConfig, type Resource, type ResourceInspection, type ResourceLike, type ResourceLoader, type ResourceLoaderContext, type ResourceOptions, type ResourceStatus, type RouteBuilder, type RouteContext, type RouteDefinition, type RouteMatch, type RouteMatchLike, type Router, type RouterHistory, type RouterInspection, type RouterLike, type RouterLocation, type RouterOptions, Runtime, RuntimeNodeInstance, type RuntimeOptions, Scheduler, type SchedulerDiagnostics, SemanticNodeType, ServerComment, ServerElement, ServerFragment, type ServerNode, type ServerNodeKind, type ServerParent, ServerRawHTML, ServerStyle, ServerText, type ShellBuilder, Signal, type SignalInspection, SignalKind, type SignalsPanel, Store, type StoreState, type StreetEvent, type StreetEventType, StreetFrameworkError, StreetRenderHandle, StreetRenderer, StreetRendererImpl, type StreetRendererOptions, type StreetUIConfig, type SubmitStatus, Subscriber, Unsubscribe, type Validator, a11yIds, applyNodeProps, applyProp, bindDomEvent, browserDOMAdapter, buttonUpdate, consoleDiagnosticSink, createApplication, createBrowserHistory, createContext, createDevTools, createForm, createI18n, createMemoryHistory, createRenderContext, createRenderer, createRouter, createRuntime, createStore, createStreetEvent, defineConfig, diagnosePerformance, email, environment, escapeHtmlAttr, escapeHtmlText, flushSync, focusById, focusFirst, formatDiagnosticContext, frameworkError, globalEventBus, headingUpdate, hydrateGraph, inputUpdate, inspectApplication, inspectContext, inspectForm, inspectGraph, inspectI18n, inspectResource, inspectRouter, inspectSignal, interpolate, matchPattern, matchRoutes, maxLength, minLength, mountGraph, mountNode, mountRouter, nodeTypeStats, normalizePath, patchNode, patchProp, pattern, printDiagnostics, printGraph, reconcileChildren, reconcileChildrenByPlan, reportDiagnostic, required, resolveTag, resource, routerOutlet, runValidators, scheduleImmediate, scheduleUpdate, scheduler, serializeChildren, serializeServerNode, splitTarget, textUpdate, toIdToken, transformGraph, validateGraph, wireEvents, wireReactiveList, wireSignalBindings };
|
package/dist/index.js
CHANGED
|
@@ -1877,6 +1877,14 @@ var ServerFragment = class {
|
|
|
1877
1877
|
parent = null;
|
|
1878
1878
|
children = [];
|
|
1879
1879
|
};
|
|
1880
|
+
var ServerRawHTML = class {
|
|
1881
|
+
kind = "raw";
|
|
1882
|
+
parent = null;
|
|
1883
|
+
html;
|
|
1884
|
+
constructor(html) {
|
|
1885
|
+
this.html = html;
|
|
1886
|
+
}
|
|
1887
|
+
};
|
|
1880
1888
|
var ServerElement = class {
|
|
1881
1889
|
kind = "element";
|
|
1882
1890
|
parent = null;
|
|
@@ -2027,6 +2035,8 @@ function serializeServerNode(node) {
|
|
|
2027
2035
|
return `<!--${node.data}-->`;
|
|
2028
2036
|
case "fragment":
|
|
2029
2037
|
return serializeChildren(node);
|
|
2038
|
+
case "raw":
|
|
2039
|
+
return node.html;
|
|
2030
2040
|
case "element": {
|
|
2031
2041
|
const el = node;
|
|
2032
2042
|
const tag = el.tagName;
|
|
@@ -2066,6 +2076,15 @@ var ServerDOMAdapter = class {
|
|
|
2066
2076
|
createFragment() {
|
|
2067
2077
|
return new ServerFragment();
|
|
2068
2078
|
}
|
|
2079
|
+
/**
|
|
2080
|
+
* Create a verbatim pre-serialized HTML node (v1.7 static SSR plan, §6).
|
|
2081
|
+
* Server-only: the browser adapter does not implement this, and the renderer
|
|
2082
|
+
* fast path only invokes it when a static SSR plan is present (SSR). The
|
|
2083
|
+
* stored HTML was produced by this same serializer, so it is emitted as-is.
|
|
2084
|
+
*/
|
|
2085
|
+
createRawHTML(html) {
|
|
2086
|
+
return new ServerRawHTML(html);
|
|
2087
|
+
}
|
|
2069
2088
|
appendChild(parent, child) {
|
|
2070
2089
|
const p = asParent(parent);
|
|
2071
2090
|
const c = asServer(child);
|
|
@@ -2234,13 +2253,14 @@ function focusFirst(dom, container, selector = FOCUSABLE_SELECTOR) {
|
|
|
2234
2253
|
}
|
|
2235
2254
|
|
|
2236
2255
|
// ../renderer/src/render-context.ts
|
|
2237
|
-
function createRenderContext(dom, graph, container, hydrationDiagnostics) {
|
|
2256
|
+
function createRenderContext(dom, graph, container, hydrationDiagnostics, staticHTML) {
|
|
2238
2257
|
return {
|
|
2239
2258
|
dom,
|
|
2240
2259
|
graph,
|
|
2241
2260
|
instances: /* @__PURE__ */ new Map(),
|
|
2242
2261
|
container,
|
|
2243
|
-
...hydrationDiagnostics !== void 0 ? { hydrationDiagnostics } : {}
|
|
2262
|
+
...hydrationDiagnostics !== void 0 ? { hydrationDiagnostics } : {},
|
|
2263
|
+
...staticHTML !== void 0 ? { staticHTML } : {}
|
|
2244
2264
|
};
|
|
2245
2265
|
}
|
|
2246
2266
|
|
|
@@ -2668,6 +2688,17 @@ function mountGraph(ctx) {
|
|
|
2668
2688
|
}
|
|
2669
2689
|
function mountNode(ctx, graphNode, parentDom) {
|
|
2670
2690
|
const { dom, graph } = ctx;
|
|
2691
|
+
const staticHTML = ctx.staticHTML;
|
|
2692
|
+
if (staticHTML !== void 0 && dom.createRawHTML !== void 0) {
|
|
2693
|
+
const precomputed = staticHTML.get(graphNode.id);
|
|
2694
|
+
if (precomputed !== void 0) {
|
|
2695
|
+
const raw = dom.createRawHTML(precomputed);
|
|
2696
|
+
dom.appendChild(parentDom, raw);
|
|
2697
|
+
const instance2 = new NodeInstance(graphNode, raw);
|
|
2698
|
+
ctx.instances.set(graphNode.id, instance2);
|
|
2699
|
+
return instance2;
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2671
2702
|
if (graphNode.type === "application") {
|
|
2672
2703
|
const instance2 = new NodeInstance(graphNode, parentDom);
|
|
2673
2704
|
ctx.instances.set(graphNode.id, instance2);
|
|
@@ -3255,11 +3286,114 @@ function readState(dom, root) {
|
|
|
3255
3286
|
}
|
|
3256
3287
|
}
|
|
3257
3288
|
|
|
3289
|
+
// ../compiler/dist/diagnostics.js
|
|
3290
|
+
var TEXT_PROP_KEYS = /* @__PURE__ */ new Set(["text", "label", "value"]);
|
|
3291
|
+
function analyzeGraph(graph) {
|
|
3292
|
+
const nodes = /* @__PURE__ */ new Map();
|
|
3293
|
+
const summary = {
|
|
3294
|
+
totalNodes: 0,
|
|
3295
|
+
staticNodes: 0,
|
|
3296
|
+
staticSubtrees: 0,
|
|
3297
|
+
dynamicTextNodes: 0,
|
|
3298
|
+
dynamicAttrNodes: 0,
|
|
3299
|
+
eventNodes: 0,
|
|
3300
|
+
lists: 0,
|
|
3301
|
+
conditionals: 0
|
|
3302
|
+
};
|
|
3303
|
+
const visit = (node) => {
|
|
3304
|
+
let allChildrenStatic = true;
|
|
3305
|
+
for (const child of node.children) {
|
|
3306
|
+
const childSubtreeStatic = visit(child);
|
|
3307
|
+
if (!childSubtreeStatic) allChildrenStatic = false;
|
|
3308
|
+
}
|
|
3309
|
+
let hasDynamicText = false;
|
|
3310
|
+
let hasDynamicAttr = false;
|
|
3311
|
+
for (const ref of node.stateRefs) {
|
|
3312
|
+
if (TEXT_PROP_KEYS.has(ref.propKey)) hasDynamicText = true;
|
|
3313
|
+
else hasDynamicAttr = true;
|
|
3314
|
+
}
|
|
3315
|
+
const hasEvents = node.events.length > 0;
|
|
3316
|
+
const isList = node.type === "reactive-list";
|
|
3317
|
+
const isConditional = node.type === "conditional";
|
|
3318
|
+
const isStatic = node.stateRefs.length === 0 && !hasEvents && !isList && !isConditional;
|
|
3319
|
+
const isStaticSubtree = isStatic && allChildrenStatic;
|
|
3320
|
+
nodes.set(node.id, {
|
|
3321
|
+
isStatic,
|
|
3322
|
+
isStaticSubtree,
|
|
3323
|
+
hasDynamicText,
|
|
3324
|
+
hasDynamicAttr,
|
|
3325
|
+
hasEvents,
|
|
3326
|
+
isList,
|
|
3327
|
+
isConditional
|
|
3328
|
+
});
|
|
3329
|
+
summary.totalNodes += 1;
|
|
3330
|
+
if (isStatic) summary.staticNodes += 1;
|
|
3331
|
+
if (isStaticSubtree) summary.staticSubtrees += 1;
|
|
3332
|
+
if (hasDynamicText) summary.dynamicTextNodes += 1;
|
|
3333
|
+
if (hasDynamicAttr) summary.dynamicAttrNodes += 1;
|
|
3334
|
+
if (hasEvents) summary.eventNodes += 1;
|
|
3335
|
+
if (isList) summary.lists += 1;
|
|
3336
|
+
if (isConditional) summary.conditionals += 1;
|
|
3337
|
+
return isStaticSubtree;
|
|
3338
|
+
};
|
|
3339
|
+
visit(graph.root);
|
|
3340
|
+
return { nodes, summary };
|
|
3341
|
+
}
|
|
3342
|
+
|
|
3343
|
+
// ../renderer/src/static-ssr-plan.ts
|
|
3344
|
+
function collectMaximalStaticRoots(graph) {
|
|
3345
|
+
const analysis = analyzeGraph(graph);
|
|
3346
|
+
const roots = [];
|
|
3347
|
+
const walk = (node) => {
|
|
3348
|
+
if (node.type !== "application") {
|
|
3349
|
+
const a = analysis.nodes.get(node.id);
|
|
3350
|
+
if (a !== void 0 && a.isStaticSubtree) {
|
|
3351
|
+
roots.push(node);
|
|
3352
|
+
return;
|
|
3353
|
+
}
|
|
3354
|
+
}
|
|
3355
|
+
for (const child of node.children) walk(child);
|
|
3356
|
+
};
|
|
3357
|
+
walk(graph.root);
|
|
3358
|
+
return roots;
|
|
3359
|
+
}
|
|
3360
|
+
function serializeStaticSubtree(dom, graph, root) {
|
|
3361
|
+
const container = dom.createElement("div");
|
|
3362
|
+
const ctx = createRenderContext(dom, graph, container);
|
|
3363
|
+
const instance = mountNode(ctx, root, container);
|
|
3364
|
+
const html = dom.serializeInner(container);
|
|
3365
|
+
instance.dispose();
|
|
3366
|
+
ctx.instances.clear();
|
|
3367
|
+
return html;
|
|
3368
|
+
}
|
|
3369
|
+
function buildStaticSSRPlan(compiled) {
|
|
3370
|
+
const graph = compiled.graph;
|
|
3371
|
+
const roots = collectMaximalStaticRoots(graph);
|
|
3372
|
+
const plan = /* @__PURE__ */ new Map();
|
|
3373
|
+
if (roots.length === 0) return plan;
|
|
3374
|
+
const dom = new ServerDOMAdapter();
|
|
3375
|
+
for (const root of roots) {
|
|
3376
|
+
plan.set(root.id, serializeStaticSubtree(dom, graph, root));
|
|
3377
|
+
}
|
|
3378
|
+
return plan;
|
|
3379
|
+
}
|
|
3380
|
+
var PLAN_CACHE = /* @__PURE__ */ new WeakMap();
|
|
3381
|
+
function getStaticSSRPlan(compiled) {
|
|
3382
|
+
let plan = PLAN_CACHE.get(compiled);
|
|
3383
|
+
if (plan === void 0) {
|
|
3384
|
+
plan = buildStaticSSRPlan(compiled);
|
|
3385
|
+
PLAN_CACHE.set(compiled, plan);
|
|
3386
|
+
}
|
|
3387
|
+
return plan;
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3258
3390
|
// ../renderer/src/ssr.ts
|
|
3259
3391
|
function renderToString(compiled, options = {}) {
|
|
3260
3392
|
const dom = options.domAdapter ?? new ServerDOMAdapter();
|
|
3393
|
+
const plan = options.staticPlan === null ? void 0 : options.staticPlan ?? getStaticSSRPlan(compiled);
|
|
3394
|
+
const staticHTML = plan !== void 0 && plan.size > 0 ? plan : void 0;
|
|
3261
3395
|
const container = dom.createElement("div");
|
|
3262
|
-
const ctx = createRenderContext(dom, compiled.graph, container);
|
|
3396
|
+
const ctx = createRenderContext(dom, compiled.graph, container, void 0, staticHTML);
|
|
3263
3397
|
const rootInstance = mountGraph(ctx);
|
|
3264
3398
|
const html = dom.serializeInner(container);
|
|
3265
3399
|
rootInstance.dispose();
|
|
@@ -4252,6 +4386,7 @@ export {
|
|
|
4252
4386
|
ServerDOMAdapter,
|
|
4253
4387
|
ServerElement,
|
|
4254
4388
|
ServerFragment,
|
|
4389
|
+
ServerRawHTML,
|
|
4255
4390
|
ServerStyle,
|
|
4256
4391
|
ServerText,
|
|
4257
4392
|
Signal,
|