streetui 1.9.0 → 2.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "streetui",
3
- "version": "1.9.0",
3
+ "version": "2.1.0",
4
4
  "description": "StreetUI — a complete TypeScript UI framework with its own compiler, semantic application graph, reactivity, DOM renderer, router, resources, forms, context, i18n, SSR, hydration, testing, devtools and CLI. One install, one import.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -1,89 +0,0 @@
1
- import { C as CompiledApplication } from './compile-DqsMQVJk.cjs';
2
-
3
- /**
4
- * The interface the runtime uses to communicate with the renderer.
5
- *
6
- * The runtime never knows how DOM nodes are created — it delegates to this
7
- * interface. This keeps the runtime/renderer boundary clean.
8
- */
9
-
10
- interface RenderHandle {
11
- /** Force a synchronous flush of pending updates. */
12
- flush(): void;
13
- /** Unmount and dispose all resources. */
14
- unmount(): void;
15
- }
16
- interface StreetRenderer {
17
- mount(application: CompiledApplication, container: Element): RenderHandle;
18
- /**
19
- * Optional: attach behavior to server-rendered HTML already present in
20
- * `container` instead of recreating it. Renderers that cannot hydrate may
21
- * omit this; callers fall back to `mount`.
22
- */
23
- hydrate?(application: CompiledApplication, container: Element): RenderHandle;
24
- }
25
-
26
- /**
27
- * Hydration diagnostics — dev-only, opt-in explanations of hydration mismatches.
28
- *
29
- * Hydration is self-repairing: when the server-rendered DOM does not match the
30
- * graph at a position, the renderer mounts a fresh subtree in place and drops
31
- * the offending element (see `hydrateChildren` in `hydrate.ts`). That recovery
32
- * is silent by design — a local mismatch must never tear down the whole app.
33
- *
34
- * During development, though, a silent repair hides a real problem (usually a
35
- * server/client divergence). A `HydrationDiagnosticSink` can be attached to the
36
- * renderer to *observe* those repairs without changing them: for every mismatch
37
- * the renderer reports what it expected, what it found, where, and what it did
38
- * to recover. Nothing is thrown, nothing is mutated differently, and when no
39
- * sink is attached there is zero additional work on the hydration path.
40
- */
41
- /** What kind of divergence the hydrator encountered at a position. */
42
- type HydrationMismatchType = 'tag-mismatch' | 'missing-element' | 'surplus-element';
43
- /** A single, fully-described hydration divergence and the repair taken. */
44
- interface HydrationDiagnostic {
45
- /** The category of mismatch. */
46
- readonly type: HydrationMismatchType;
47
- /** The tag the graph expected at this position (null for a surplus element). */
48
- readonly expected: string | null;
49
- /** The tag actually found in the server DOM (null for a missing element). */
50
- readonly found: string | null;
51
- /** A human-readable path to the position, e.g. `app / page[0] / section[1]`. */
52
- readonly path: string;
53
- /** The graph node id involved, when one exists (null for surplus DOM). */
54
- readonly nodeId: string | null;
55
- /** The semantic node type involved, when one exists (null for surplus DOM). */
56
- readonly nodeType: string | null;
57
- /** The recovery action the renderer performed. */
58
- readonly action: string;
59
- /** A single-line, developer-facing summary of the whole diagnostic. */
60
- readonly message: string;
61
- }
62
- /**
63
- * Receives hydration diagnostics as they are discovered. Kept intentionally
64
- * tiny so any logger — `console`, a test collector, a `DiagnosticSink` — can
65
- * satisfy it. Implementations must not throw.
66
- */
67
- interface HydrationDiagnosticSink {
68
- report(diagnostic: HydrationDiagnostic): void;
69
- }
70
- /** Build the canonical one-line message for a diagnostic. */
71
- declare function formatHydrationDiagnostic(d: Omit<HydrationDiagnostic, 'message'>): string;
72
- /**
73
- * A ready-made sink that accumulates diagnostics into an array — the shape most
74
- * useful for tests and for a DevTools panel. The returned `diagnostics` array is
75
- * appended to in-place as repairs happen.
76
- */
77
- declare function createHydrationDiagnosticCollector(): {
78
- readonly sink: HydrationDiagnosticSink;
79
- readonly diagnostics: HydrationDiagnostic[];
80
- };
81
- /**
82
- * A sink that forwards each diagnostic to a `console`-like logger as a single
83
- * warning line. Handy default when you just want the messages surfaced in dev.
84
- */
85
- declare function consoleHydrationDiagnosticSink(logger?: {
86
- warn(message: string): void;
87
- }): HydrationDiagnosticSink;
88
-
89
- export { type HydrationDiagnostic as H, type RenderHandle as R, type StreetRenderer as S, type HydrationDiagnosticSink as a, type HydrationMismatchType as b, consoleHydrationDiagnosticSink as c, createHydrationDiagnosticCollector as d, formatHydrationDiagnostic as f };
@@ -1,89 +0,0 @@
1
- import { C as CompiledApplication } from './compile-DqsMQVJk.js';
2
-
3
- /**
4
- * The interface the runtime uses to communicate with the renderer.
5
- *
6
- * The runtime never knows how DOM nodes are created — it delegates to this
7
- * interface. This keeps the runtime/renderer boundary clean.
8
- */
9
-
10
- interface RenderHandle {
11
- /** Force a synchronous flush of pending updates. */
12
- flush(): void;
13
- /** Unmount and dispose all resources. */
14
- unmount(): void;
15
- }
16
- interface StreetRenderer {
17
- mount(application: CompiledApplication, container: Element): RenderHandle;
18
- /**
19
- * Optional: attach behavior to server-rendered HTML already present in
20
- * `container` instead of recreating it. Renderers that cannot hydrate may
21
- * omit this; callers fall back to `mount`.
22
- */
23
- hydrate?(application: CompiledApplication, container: Element): RenderHandle;
24
- }
25
-
26
- /**
27
- * Hydration diagnostics — dev-only, opt-in explanations of hydration mismatches.
28
- *
29
- * Hydration is self-repairing: when the server-rendered DOM does not match the
30
- * graph at a position, the renderer mounts a fresh subtree in place and drops
31
- * the offending element (see `hydrateChildren` in `hydrate.ts`). That recovery
32
- * is silent by design — a local mismatch must never tear down the whole app.
33
- *
34
- * During development, though, a silent repair hides a real problem (usually a
35
- * server/client divergence). A `HydrationDiagnosticSink` can be attached to the
36
- * renderer to *observe* those repairs without changing them: for every mismatch
37
- * the renderer reports what it expected, what it found, where, and what it did
38
- * to recover. Nothing is thrown, nothing is mutated differently, and when no
39
- * sink is attached there is zero additional work on the hydration path.
40
- */
41
- /** What kind of divergence the hydrator encountered at a position. */
42
- type HydrationMismatchType = 'tag-mismatch' | 'missing-element' | 'surplus-element';
43
- /** A single, fully-described hydration divergence and the repair taken. */
44
- interface HydrationDiagnostic {
45
- /** The category of mismatch. */
46
- readonly type: HydrationMismatchType;
47
- /** The tag the graph expected at this position (null for a surplus element). */
48
- readonly expected: string | null;
49
- /** The tag actually found in the server DOM (null for a missing element). */
50
- readonly found: string | null;
51
- /** A human-readable path to the position, e.g. `app / page[0] / section[1]`. */
52
- readonly path: string;
53
- /** The graph node id involved, when one exists (null for surplus DOM). */
54
- readonly nodeId: string | null;
55
- /** The semantic node type involved, when one exists (null for surplus DOM). */
56
- readonly nodeType: string | null;
57
- /** The recovery action the renderer performed. */
58
- readonly action: string;
59
- /** A single-line, developer-facing summary of the whole diagnostic. */
60
- readonly message: string;
61
- }
62
- /**
63
- * Receives hydration diagnostics as they are discovered. Kept intentionally
64
- * tiny so any logger — `console`, a test collector, a `DiagnosticSink` — can
65
- * satisfy it. Implementations must not throw.
66
- */
67
- interface HydrationDiagnosticSink {
68
- report(diagnostic: HydrationDiagnostic): void;
69
- }
70
- /** Build the canonical one-line message for a diagnostic. */
71
- declare function formatHydrationDiagnostic(d: Omit<HydrationDiagnostic, 'message'>): string;
72
- /**
73
- * A ready-made sink that accumulates diagnostics into an array — the shape most
74
- * useful for tests and for a DevTools panel. The returned `diagnostics` array is
75
- * appended to in-place as repairs happen.
76
- */
77
- declare function createHydrationDiagnosticCollector(): {
78
- readonly sink: HydrationDiagnosticSink;
79
- readonly diagnostics: HydrationDiagnostic[];
80
- };
81
- /**
82
- * A sink that forwards each diagnostic to a `console`-like logger as a single
83
- * warning line. Handy default when you just want the messages surfaced in dev.
84
- */
85
- declare function consoleHydrationDiagnosticSink(logger?: {
86
- warn(message: string): void;
87
- }): HydrationDiagnosticSink;
88
-
89
- export { type HydrationDiagnostic as H, type RenderHandle as R, type StreetRenderer as S, type HydrationDiagnosticSink as a, type HydrationMismatchType as b, consoleHydrationDiagnosticSink as c, createHydrationDiagnosticCollector as d, formatHydrationDiagnostic as f };