octane 0.2.11 → 0.2.13
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/README.md +5 -0
- package/dist/behavior-root.d.ts +13 -3
- package/dist/behavior-root.js +28 -5
- package/dist/cjs/behavior-root.cjs +32 -6
- package/dist/cjs/class-names.cjs +49 -0
- package/dist/cjs/constants.cjs +9 -0
- package/dist/cjs/context-epoch.cjs +38 -0
- package/dist/cjs/css.cjs +6 -27
- package/dist/cjs/data-encoding.cjs +160 -0
- package/dist/cjs/dom-binding-handoff.cjs +93 -0
- package/dist/cjs/dom-binding-protocol.cjs +115 -0
- package/dist/cjs/dom-binding-styles.cjs +292 -0
- package/dist/cjs/dom-bindings.cjs +700 -0
- package/dist/cjs/dom-focused-move.cjs +66 -0
- package/dist/cjs/dom-stage.cjs +896 -0
- package/dist/cjs/dom-tables.cjs +4 -94
- package/dist/cjs/error-codes.client.generated.cjs +33 -0
- package/dist/cjs/error-codes.server.generated.cjs +24 -0
- package/dist/cjs/hydration/control-capture.cjs +244 -0
- package/dist/cjs/hydration/event-capture.cjs +125 -43
- package/dist/cjs/hydration/interaction-config.cjs +50 -2
- package/dist/cjs/hydration-markers.cjs +37 -0
- package/dist/cjs/independent-hydration-protocol.cjs +106 -0
- package/dist/cjs/index.cjs +9 -0
- package/dist/cjs/runtime.cjs +6397 -1683
- package/dist/cjs/runtime.server.cjs +1465 -213
- package/dist/cjs/server/early-signals.cjs +45 -0
- package/dist/cjs/server/index.cjs +47 -0
- package/dist/cjs/server/rpc-batch.cjs +149 -0
- package/dist/cjs/server/rpc-stream.cjs +146 -0
- package/dist/cjs/server/rpc.cjs +34 -15
- package/dist/cjs/server/signal-query-observation.cjs +158 -0
- package/dist/cjs/server/streamed-region.cjs +52 -0
- package/dist/cjs/server/streamed-signals.cjs +512 -0
- package/dist/cjs/server-call.cjs +103 -0
- package/dist/cjs/server-rpc-batch-client.cjs +141 -0
- package/dist/cjs/server-rpc-client.cjs +94 -27
- package/dist/cjs/server-rpc-protocol.cjs +141 -0
- package/dist/cjs/server-rpc-stream-client.cjs +118 -0
- package/dist/cjs/signals/actions.cjs +474 -0
- package/dist/cjs/signals/client.cjs +4 -1
- package/dist/cjs/signals/computations.cjs +460 -0
- package/dist/cjs/signals/control-binding.cjs +368 -0
- package/dist/cjs/signals/derived-facade.cjs +50 -0
- package/dist/cjs/signals/document-owner.cjs +71 -0
- package/dist/cjs/signals/early-values.cjs +155 -0
- package/dist/cjs/signals/encoding.cjs +6 -95
- package/dist/cjs/signals/engine.cjs +276 -12
- package/dist/cjs/signals/errors.cjs +18 -0
- package/dist/cjs/signals/facade.cjs +477 -0
- package/dist/cjs/signals/graph.cjs +166 -20
- package/dist/cjs/signals/handle-protocol.cjs +36 -0
- package/dist/cjs/signals/index.cjs +81 -2
- package/dist/cjs/signals/native-read-client.cjs +10 -0
- package/dist/cjs/signals/owner-context.cjs +112 -0
- package/dist/cjs/signals/query-attempt-observer.cjs +68 -0
- package/dist/cjs/signals/query-facade.cjs +72 -0
- package/dist/cjs/signals/read-protocol.cjs +54 -0
- package/dist/cjs/signals/requests.cjs +287 -14
- package/dist/cjs/signals/scalar-computations.cjs +76 -0
- package/dist/cjs/signals/server.cjs +4 -1
- package/dist/cjs/signals/transition-candidate.cjs +567 -0
- package/dist/cjs/signals/transition-state.cjs +106 -0
- package/dist/cjs/signals/types.cjs +50 -0
- package/dist/cjs/stream-protocol.cjs +3 -0
- package/dist/cjs/streamed-signals-protocol.cjs +159 -0
- package/dist/cjs/style-values.cjs +122 -0
- package/dist/cjs/trusted-html.cjs +30 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/class-names.d.ts +5 -0
- package/dist/class-names.js +25 -0
- package/dist/compiler/bundler.js +51 -22
- package/dist/compiler/compile.js +2534 -581
- package/dist/compiler/dom-binding-program.js +935 -0
- package/dist/compiler/dom-binding-request.js +57 -0
- package/dist/compiler/dom-bindings.js +2245 -0
- package/dist/compiler/hook-deps.js +759 -10
- package/dist/compiler/hydrate-boundaries.js +358 -15
- package/dist/compiler/index.d.ts +39 -2
- package/dist/compiler/index.js +1 -0
- package/dist/compiler/native-attribute-reads.js +127 -0
- package/dist/compiler/native-change-diagnostics.js +32 -38
- package/dist/compiler/native-read-diagnostics.js +69 -8
- package/dist/compiler/native-read-types.js +80 -34
- package/dist/compiler/parser.node.js +1 -1
- package/dist/compiler/renderer-boundaries.js +40 -0
- package/dist/compiler/server-context.js +118 -0
- package/dist/compiler/signal-attempt-reads.js +479 -0
- package/dist/compiler/signal-declarations.js +557 -0
- package/dist/compiler/signal-start-reads.js +413 -0
- package/dist/compiler/slot-hooks.d.ts +3 -1
- package/dist/compiler/slot-hooks.js +168 -34
- package/dist/compiler/strong-auto-memo.js +90 -0
- package/dist/compiler/strong-html.js +143 -0
- package/dist/compiler/strong-mode.js +764 -66
- package/dist/compiler/strong-template-policy.js +307 -0
- package/dist/compiler/template-ir.js +200 -0
- package/dist/compiler/typescript.d.ts +2 -0
- package/dist/compiler/typescript.js +2 -0
- package/dist/compiler/vite.d.ts +3 -1
- package/dist/compiler/vite.js +122 -4
- package/dist/compiler/volar.LICENSES.txt +1 -1
- package/dist/compiler/volar.d.ts +6 -1
- package/dist/compiler/volar.js +750 -1433
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +10 -0
- package/dist/context-epoch.d.ts +2 -0
- package/dist/context-epoch.js +13 -0
- package/dist/css.d.ts +2 -5
- package/dist/css.js +2 -23
- package/dist/data-encoding.d.ts +9 -0
- package/dist/data-encoding.js +134 -0
- package/dist/dom-binding-classes.d.ts +15 -0
- package/dist/dom-binding-classes.js +129 -0
- package/dist/dom-binding-controls.d.ts +2 -0
- package/dist/dom-binding-controls.js +6 -0
- package/dist/dom-binding-handoff.d.ts +55 -0
- package/dist/dom-binding-handoff.js +62 -0
- package/dist/dom-binding-program.d.ts +300 -0
- package/dist/dom-binding-program.js +1625 -0
- package/dist/dom-binding-projections.d.ts +15 -0
- package/dist/dom-binding-projections.js +187 -0
- package/dist/dom-binding-protocol.d.ts +13 -0
- package/dist/dom-binding-protocol.js +88 -0
- package/dist/dom-binding-signals.d.ts +21 -0
- package/dist/dom-binding-signals.js +109 -0
- package/dist/dom-binding-styles.d.ts +17 -0
- package/dist/dom-binding-styles.js +272 -0
- package/dist/dom-bindings.d.ts +89 -0
- package/dist/dom-bindings.js +670 -0
- package/dist/dom-focused-move.d.ts +6 -0
- package/dist/dom-focused-move.js +42 -0
- package/dist/dom-stage.d.ts +52 -0
- package/dist/dom-stage.js +872 -0
- package/dist/dom-tables.d.ts +1 -3
- package/dist/dom-tables.js +1 -91
- package/dist/error-codes.client.generated.d.ts +9 -0
- package/dist/error-codes.client.generated.js +33 -0
- package/dist/error-codes.server.generated.d.ts +6 -0
- package/dist/error-codes.server.generated.js +24 -0
- package/dist/hydration/control-capture.d.ts +62 -0
- package/dist/hydration/control-capture.js +223 -0
- package/dist/hydration/document-lifecycle.d.ts +23 -0
- package/dist/hydration/document-lifecycle.js +80 -0
- package/dist/hydration/event-capture.d.ts +20 -1
- package/dist/hydration/event-capture.js +128 -42
- package/dist/hydration/independent-island.d.ts +45 -0
- package/dist/hydration/independent-island.js +233 -0
- package/dist/hydration/index.d.ts +8 -1
- package/dist/hydration/index.js +55 -1
- package/dist/hydration/interaction-config.d.ts +5 -0
- package/dist/hydration/interaction-config.js +44 -1
- package/dist/hydration/stream-delivery.d.ts +32 -0
- package/dist/hydration/stream-delivery.js +333 -0
- package/dist/hydration/stream-receiver.d.ts +26 -0
- package/dist/hydration/stream-receiver.js +204 -0
- package/dist/hydration/stream-result-receiver.d.ts +70 -0
- package/dist/hydration/stream-result-receiver.js +246 -0
- package/dist/hydration/streamed-signals.d.ts +44 -0
- package/dist/hydration/streamed-signals.js +186 -0
- package/dist/hydration/types.d.ts +6 -0
- package/dist/hydration-markers.d.ts +7 -0
- package/dist/hydration-markers.js +10 -0
- package/dist/independent-hydration-protocol.d.ts +31 -0
- package/dist/independent-hydration-protocol.js +80 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/internal/signal-read.d.ts +1 -0
- package/dist/internal/signal-read.js +4 -0
- package/dist/jsx-runtime-strong.d.ts +33 -0
- package/dist/jsx-runtime.d.ts +58 -2
- package/dist/public-types.d.ts +15 -1
- package/dist/runtime.d.ts +297 -23
- package/dist/runtime.js +6405 -1679
- package/dist/runtime.server.d.ts +110 -27
- package/dist/runtime.server.js +1458 -213
- package/dist/server/early-signals.d.ts +14 -0
- package/dist/server/early-signals.js +34 -0
- package/dist/server/index.d.ts +11 -2
- package/dist/server/index.js +50 -1
- package/dist/server/rpc-batch.d.ts +17 -0
- package/dist/server/rpc-batch.js +129 -0
- package/dist/server/rpc-stream.d.ts +9 -0
- package/dist/server/rpc-stream.js +125 -0
- package/dist/server/rpc.d.ts +5 -1
- package/dist/server/rpc.js +37 -13
- package/dist/server/signal-query-observation.d.ts +3 -0
- package/dist/server/signal-query-observation.js +134 -0
- package/dist/server/streamed-region.d.ts +15 -0
- package/dist/server/streamed-region.js +30 -0
- package/dist/server/streamed-signals.d.ts +45 -0
- package/dist/server/streamed-signals.js +488 -0
- package/dist/server-call.d.ts +41 -0
- package/dist/server-call.js +75 -0
- package/dist/server-rpc-batch-client.d.ts +7 -0
- package/dist/server-rpc-batch-client.js +119 -0
- package/dist/server-rpc-client.d.ts +3 -1
- package/dist/server-rpc-client.js +99 -27
- package/dist/server-rpc-protocol.d.ts +47 -0
- package/dist/server-rpc-protocol.js +109 -0
- package/dist/server-rpc-stream-client.d.ts +5 -0
- package/dist/server-rpc-stream-client.js +98 -0
- package/dist/signals/actions.d.ts +12 -0
- package/dist/signals/actions.js +466 -0
- package/dist/signals/client.d.ts +2 -0
- package/dist/signals/client.js +1 -0
- package/dist/signals/computations.d.ts +37 -0
- package/dist/signals/computations.js +455 -0
- package/dist/signals/control-binding.d.ts +31 -0
- package/dist/signals/control-binding.js +353 -0
- package/dist/signals/derived-facade.d.ts +3 -0
- package/dist/signals/derived-facade.js +25 -0
- package/dist/signals/document-owner.d.ts +10 -0
- package/dist/signals/document-owner.js +43 -0
- package/dist/signals/early-values.d.ts +24 -0
- package/dist/signals/early-values.js +124 -0
- package/dist/signals/encoding.d.ts +1 -3
- package/dist/signals/encoding.js +3 -93
- package/dist/signals/engine.d.ts +53 -4
- package/dist/signals/engine.js +275 -16
- package/dist/signals/errors.d.ts +7 -0
- package/dist/signals/errors.js +16 -0
- package/dist/signals/facade.d.ts +74 -0
- package/dist/signals/facade.js +452 -0
- package/dist/signals/graph.d.ts +52 -6
- package/dist/signals/graph.js +174 -19
- package/dist/signals/handle-protocol.d.ts +4 -0
- package/dist/signals/handle-protocol.js +11 -0
- package/dist/signals/index.d.ts +12 -3
- package/dist/signals/index.js +71 -2
- package/dist/signals/native-read-client.d.ts +3 -0
- package/dist/signals/native-read-client.js +10 -0
- package/dist/signals/owner-context.d.ts +22 -0
- package/dist/signals/owner-context.js +77 -0
- package/dist/signals/query-attempt-observer.d.ts +49 -0
- package/dist/signals/query-attempt-observer.js +41 -0
- package/dist/signals/query-facade.d.ts +3 -0
- package/dist/signals/query-facade.js +49 -0
- package/dist/signals/read-protocol.d.ts +37 -2
- package/dist/signals/read-protocol.js +44 -0
- package/dist/signals/requests.d.ts +38 -5
- package/dist/signals/requests.js +298 -15
- package/dist/signals/scalar-computations.d.ts +2 -0
- package/dist/signals/scalar-computations.js +60 -0
- package/dist/signals/server.d.ts +2 -0
- package/dist/signals/server.js +1 -0
- package/dist/signals/transition-candidate.d.ts +71 -0
- package/dist/signals/transition-candidate.js +557 -0
- package/dist/signals/transition-state.d.ts +51 -0
- package/dist/signals/transition-state.js +70 -0
- package/dist/signals/types.d.ts +95 -5
- package/dist/signals/types.js +20 -0
- package/dist/stream-protocol.d.ts +0 -5
- package/dist/stream-protocol.js +3 -0
- package/dist/streamed-signals-protocol.d.ts +60 -0
- package/dist/streamed-signals-protocol.js +130 -0
- package/dist/style-values.d.ts +3 -0
- package/dist/style-values.js +96 -0
- package/dist/trusted-html.d.ts +17 -0
- package/dist/trusted-html.js +6 -0
- package/dist/universal-core.d.ts +6 -0
- package/dist/universal-core.js +214 -202
- package/dist/version.js +1 -1
- package/package.json +48 -5
package/dist/runtime.server.d.ts
CHANGED
|
@@ -1,30 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* The `octane/compiler` compiler, in `mode: 'server'`, emits component bodies
|
|
5
|
-
* that build an HTML STRING (instead of cloning a DOM template) by calling the
|
|
6
|
-
* `ssr*` helpers here, and that call these server hook implementations. The
|
|
7
|
-
* server analogues of `createRoot().render()` are `renderToString` /
|
|
8
|
-
* `renderToStaticMarkup` (`octane/server`) and `prerender` (`octane/static`),
|
|
9
|
-
* each returning `{ html, css }` (hoisted head folded into `html`).
|
|
10
|
-
*
|
|
11
|
-
* Scope: static markup, dynamic text holes, attributes (incl. class / style /
|
|
12
|
-
* spread), control flow (@if/@for/@switch/@try), nested components, scoped CSS
|
|
13
|
-
* collection, Suspense, and the leaf hooks (state renders its initial value —
|
|
14
|
-
* re-invoking the body for render-phase dispatches until it settles, as React's
|
|
15
|
-
* server renderer does — effects no-op, memo runs once, ids are deterministic).
|
|
16
|
-
* Every dynamic site is
|
|
17
|
-
* wrapped in the hydration markers (`constants.ts`) the client `hydrateRoot`
|
|
18
|
-
* cursor adopts. Events and refs are dropped (no DOM on the server); Fragment
|
|
19
|
-
* refs retain their range markers only when producing hydratable output.
|
|
20
|
-
*/
|
|
1
|
+
export { trustHTML, type TrustedHTML } from './trusted-html.js';
|
|
2
|
+
export { readNativeDomStyle, readNativeDomProps } from './signals/read-protocol.js';
|
|
21
3
|
import { EXTERNAL_HYDRATION_PROMISE, HYDRATION_RANGE_BOUNDARY } from './constants.js';
|
|
4
|
+
import { type IndependentHydrateBuildRecord } from './independent-hydration-protocol.js';
|
|
22
5
|
import { normalizeClass } from './css.js';
|
|
23
6
|
import { validateNativeReadWitness, type NativeReadWitness } from './signals/native-read-collector.js';
|
|
24
7
|
import { type NativeSignalManifest } from './signals/native-read-seeds.js';
|
|
8
|
+
import { type ServerSignalQueryAttempt, type ServerSignalQueryAttemptObservations } from './signals/query-attempt-observer.js';
|
|
9
|
+
import { type SignalOwner, type SignalRendererOwnerIdentity } from './signals/types.js';
|
|
25
10
|
export { EXTERNAL_HYDRATION_PROMISE, HYDRATION_RANGE_BOUNDARY, normalizeClass };
|
|
26
11
|
export { validateNativeReadWitness };
|
|
27
12
|
export type { NativeSignalManifest };
|
|
13
|
+
/** @internal Compiler target for strict server reads of a direct signal binding. */
|
|
14
|
+
export declare function ssrSignalValue(value: unknown): unknown;
|
|
15
|
+
/** @internal Preserve a writable control's identity until the final JSX winner is known. */
|
|
16
|
+
export declare function ssrSignalControlValue(value: unknown, site: string): unknown;
|
|
28
17
|
/** Server twin of the compiler's guarded native-array map ABI. */
|
|
29
18
|
export declare function mapSlot(receiver: any, method: any, callback?: (...args: any[]) => any): any;
|
|
30
19
|
interface SSRScope {
|
|
@@ -56,6 +45,7 @@ export declare function beginNativeReadWitness(detached?: boolean): number;
|
|
|
56
45
|
export declare function finishNativeReadWitness(token: number, completed: boolean): NativeReadWitness | null;
|
|
57
46
|
/** @internal Shared automatic-cache witness ABI. */
|
|
58
47
|
export declare function replayNativeReadWitness(witness: NativeReadWitness | null | undefined): void;
|
|
48
|
+
type ServerSignalInstanceKey = string | Frame;
|
|
59
49
|
interface InjectedStyle {
|
|
60
50
|
css: string;
|
|
61
51
|
nonce?: string;
|
|
@@ -71,6 +61,11 @@ interface Frame {
|
|
|
71
61
|
asyncScope: string;
|
|
72
62
|
/** Parser context supplied by, or inherited through, the component call site. */
|
|
73
63
|
namespace: 'html' | 'svg' | 'mathml' | undefined;
|
|
64
|
+
signalParentKey?: ServerSignalInstanceKey;
|
|
65
|
+
signalInvocationSite?: string;
|
|
66
|
+
signalListKeys?: readonly string[];
|
|
67
|
+
signalKey?: string;
|
|
68
|
+
signalInstanceKey?: string;
|
|
74
69
|
}
|
|
75
70
|
type ScopedCounts = (string | number)[] | Map<string, number>;
|
|
76
71
|
/** Compiler ABI: validate and scope one native element during a DEV SSR render. */
|
|
@@ -102,16 +97,22 @@ interface ElementDescriptor {
|
|
|
102
97
|
key: any;
|
|
103
98
|
ref: any;
|
|
104
99
|
children: any;
|
|
100
|
+
/** @internal Compiler-stable component invocation identity. */
|
|
101
|
+
__octaneInvocationSite?: string;
|
|
105
102
|
}
|
|
106
103
|
/** Server twin of the compiler-only complete JSX-record deferral helper. */
|
|
107
104
|
export declare function createScopedValue(readElement: () => ElementDescriptor): ElementDescriptor;
|
|
108
105
|
/** @internal Native complete-record deferral with request-local evidence. */
|
|
109
106
|
export declare function nativeCreateScopedValue(readElement: () => ElementDescriptor): ElementDescriptor;
|
|
110
107
|
/** Server twin of the compiler-only scope-preserving JSX descriptor factory. */
|
|
111
|
-
export declare function createScopedElement(type: ServerEntryComponent | string | typeof Fragment | typeof Activity, props: any, readChildren: () => unknown): ElementDescriptor;
|
|
108
|
+
export declare function createScopedElement(type: ServerEntryComponent | string | typeof Fragment | typeof Activity, props: any, readChildren: () => unknown, invocationSite?: string): ElementDescriptor;
|
|
112
109
|
/** @internal Native child deferral with evidence on every resolving scope. */
|
|
113
|
-
export declare function nativeCreateScopedElement(type: ServerEntryComponent | string | typeof Fragment | typeof Activity, props: any, readChildren: () => unknown): ElementDescriptor;
|
|
110
|
+
export declare function nativeCreateScopedElement(type: ServerEntryComponent | string | typeof Fragment | typeof Activity, props: any, readChildren: () => unknown, invocationSite?: string): ElementDescriptor;
|
|
114
111
|
export declare function createElement(type: ServerEntryComponent | string | typeof Fragment | typeof Activity, props?: any, ...children: any[]): ElementDescriptor;
|
|
112
|
+
/** @internal Compiler-authored element descriptor with stable invocation identity. */
|
|
113
|
+
export declare function createElementAt(invocationSite: string, type: ServerEntryComponent | string | typeof Fragment | typeof Activity, props?: any, ...children: any[]): ElementDescriptor;
|
|
114
|
+
/** @internal Compiler-owned positional children; omitted children allocate no rest array. */
|
|
115
|
+
export declare function createElementFromConfig(invocationSite: string | undefined, type: ServerEntryComponent | string | typeof Fragment | typeof Activity, props: any, children?: any[]): ElementDescriptor;
|
|
115
116
|
export declare function positionalChildren(children: unknown[]): unknown[];
|
|
116
117
|
/** True if `v` is an element descriptor from `createElement` / JSX-at-value. */
|
|
117
118
|
export declare function isValidElement(v: unknown): v is ElementDescriptor;
|
|
@@ -134,6 +135,10 @@ export declare const Children: {
|
|
|
134
135
|
export declare function createPortal(body: unknown, target: unknown, props?: any): unknown;
|
|
135
136
|
/** @internal Brand the final serialized output of a compiled server body. */
|
|
136
137
|
export declare function ssrHtml(html: string): string;
|
|
138
|
+
/** @internal Preserve the existing component range while identifying an authored binding view. */
|
|
139
|
+
export declare function ssrBindingHtml(html: string, id: string): string;
|
|
140
|
+
/** @internal Match the client definition-site boundary capability. */
|
|
141
|
+
export declare function bindPresentationView<T extends Function>(view: T, _id: string): T;
|
|
137
142
|
export declare function escapeHtml(v: unknown): string;
|
|
138
143
|
export declare function escapeAttr(v: unknown): string;
|
|
139
144
|
/** A dynamic text hole. null/false/undefined render as empty (React parity). */
|
|
@@ -154,6 +159,8 @@ export declare function ssrTextPre(v: unknown): string;
|
|
|
154
159
|
* `{x as string}` / literals / `+`-concats to `ssrText`, everything else here.
|
|
155
160
|
*/
|
|
156
161
|
export declare function ssrChild(v: unknown, scope: SSRScope): string;
|
|
162
|
+
/** @internal Give an authored child slot an identity without adding a second hydration range. */
|
|
163
|
+
export declare function ssrBindingChild(value: unknown, scope: SSRScope, marker: string): string;
|
|
157
164
|
export declare function ssrChildText(v: unknown, scope: SSRScope): string;
|
|
158
165
|
/** @internal First-child renderable hole in a newline-eating HTML element. */
|
|
159
166
|
export declare function ssrChildTextPre(v: unknown, scope: SSRScope): string;
|
|
@@ -166,6 +173,12 @@ export declare function ssrChildPre(v: unknown, scope: SSRScope): string;
|
|
|
166
173
|
* protocol (shared constants in ./constants).
|
|
167
174
|
*/
|
|
168
175
|
export declare function ssrBlock(content: string): string;
|
|
176
|
+
/** @internal Opt-in identity payload on an otherwise ordinary hydration range. */
|
|
177
|
+
export declare function ssrBindingBlock(content: string, marker: string): string;
|
|
178
|
+
/** @internal Authenticate keyed item identity before emitting any item HTML. */
|
|
179
|
+
export declare function ssrBindingKey(key: unknown, seen: Set<string>): string;
|
|
180
|
+
/** @internal One evaluation supplies both presentation classes and their adoption receipt. */
|
|
181
|
+
export declare function ssrBindingClass(receipt: string, values: [unknown, unknown[]]): string;
|
|
169
182
|
/**
|
|
170
183
|
* Preserve a Fragment ref's authored evaluation order without attaching its
|
|
171
184
|
* value. Hydratable output needs the exact comments its client template adopts;
|
|
@@ -200,7 +213,7 @@ export declare function ssrControl<T>(siteKey: string, fn: () => T): T;
|
|
|
200
213
|
/** Compiler-emitted identity membrane for one arm/item inside ssrControl. */
|
|
201
214
|
export declare function ssrArm<T>(armKey: unknown, fn: () => T): T;
|
|
202
215
|
/** Invoke a compiled list body without allocating a callback per item. */
|
|
203
|
-
export declare function ssrForItem(armKey: unknown, fn: (...args: any[]) => string, item: unknown, index: number | undefined, scope: SSRScope, block: boolean): string;
|
|
216
|
+
export declare function ssrForItem(armKey: unknown, fn: (...args: any[]) => string, item: unknown, index: number | undefined, scope: SSRScope, block: boolean, mapped?: boolean): string;
|
|
204
217
|
/**
|
|
205
218
|
* A portal's site marker. The portal body renders into a foreign target at the
|
|
206
219
|
* client, so server-side it leaves a single anchor comment placeholder.
|
|
@@ -235,7 +248,7 @@ type SsrAttributeSource = readonly [
|
|
|
235
248
|
* class identity after that last-writer fold, matching the client so a spread
|
|
236
249
|
* `class` is not replaced by the hash alone.
|
|
237
250
|
*/
|
|
238
|
-
export declare function ssrAttrs(sources: readonly SsrAttributeSource[], tag?: string, namespace?: AttributeNamespace, skipFormControls?: boolean): string;
|
|
251
|
+
export declare function ssrAttrs(sources: readonly SsrAttributeSource[], tag?: string, namespace?: AttributeNamespace, skipFormControls?: boolean, readStyle?: (value: unknown) => unknown): string;
|
|
239
252
|
/**
|
|
240
253
|
* Resolve direct and spread class writers to one native `class` attribute.
|
|
241
254
|
* `sources` are `[isSpread, value]` pairs in authoring order. A spread only
|
|
@@ -248,7 +261,7 @@ export declare function ssrClass(sources: Array<[boolean, unknown]>): string;
|
|
|
248
261
|
* string keys participate, and getters run once at the spread's authored
|
|
249
262
|
* evaluation position before later direct prop expressions.
|
|
250
263
|
*/
|
|
251
|
-
export declare function ssrSnapshotSpread(obj: unknown): Record<string, unknown> | null;
|
|
264
|
+
export declare function ssrSnapshotSpread(obj: unknown, controlSite?: string, deferStyle?: boolean): Record<string, unknown> | null;
|
|
252
265
|
/** A spread `{...obj}`: serialize attr-like keys; drop events/refs/key/children. */
|
|
253
266
|
export declare function ssrSpread(obj: unknown, tag?: string, skipClass?: boolean, namespace?: AttributeNamespace, skipFormControls?: boolean): string;
|
|
254
267
|
export declare function ssrInnerHtml(sources: readonly (readonly [boolean, unknown])[], renderChildren?: () => string, definitelyHasChildren?: boolean, childrenSources?: readonly (readonly [boolean, unknown])[]): string | undefined;
|
|
@@ -293,6 +306,8 @@ export declare function ssrCheckedAttr(v: unknown): string;
|
|
|
293
306
|
*/
|
|
294
307
|
export declare function ssrInputAttrs(sources: Array<readonly [isSpread: boolean, sourceOrName: unknown, value?: unknown]>): string;
|
|
295
308
|
type SsrFormControlSource = readonly [isSpread: boolean, sourceOrName: unknown, value?: unknown];
|
|
309
|
+
/** @internal Join the final writable control winners to the baked control-site key. */
|
|
310
|
+
export declare function ssrSignalControlAttrs(sources: readonly SsrFormControlSource[]): string;
|
|
296
311
|
/**
|
|
297
312
|
* Controlled `<textarea>` content: escaped text + the leading-newline guard
|
|
298
313
|
* (the parser eats a '\n' right after the opening tag — see ssrTextPre).
|
|
@@ -340,9 +355,9 @@ export declare function nativeLocalHook<T>(name: string, initialize: () => T, di
|
|
|
340
355
|
* parent's own range bounds it; the client borrows that range). Applies to
|
|
341
356
|
* both the component branch (frame wrap) and the string-tag branch (ssrBlock).
|
|
342
357
|
*/
|
|
343
|
-
export declare function ssrComponent(parent: SSRScope, comp: ServerComponent | string | typeof Activity, props: any, inherit?: boolean, key?: unknown, identityScoped?: boolean): string;
|
|
358
|
+
export declare function ssrComponent(parent: SSRScope, comp: ServerComponent | string | typeof Activity, props: any, inherit?: boolean, key?: unknown, identityScoped?: boolean, invocationSite?: string, bindingMarker?: string): string;
|
|
344
359
|
/** Compiler ABI for a component call whose output is parsed in foreign content. */
|
|
345
|
-
export declare function ssrComponentNS(parent: SSRScope, comp: ServerComponent | string | typeof Activity, props: any, namespace: 'html' | 'svg' | 'mathml', inherit?: boolean, key?: unknown): string;
|
|
360
|
+
export declare function ssrComponentNS(parent: SSRScope, comp: ServerComponent | string | typeof Activity, props: any, namespace: 'html' | 'svg' | 'mathml', inherit?: boolean, key?: unknown, invocationSite?: string, bindingMarker?: string): string;
|
|
346
361
|
/** Run a renderable hole under a lexically proven parser namespace. */
|
|
347
362
|
export declare function ssrInNamespace(namespace: 'html' | 'svg' | 'mathml', render: () => string): string;
|
|
348
363
|
export declare const Hydrate: ServerComponent;
|
|
@@ -364,11 +379,16 @@ export declare const Suspense: (props: {
|
|
|
364
379
|
type VtSsrClassValue = string | Record<string, string>;
|
|
365
380
|
interface VtSsrProps {
|
|
366
381
|
name?: string;
|
|
382
|
+
scope?: 'element';
|
|
367
383
|
enter?: VtSsrClassValue;
|
|
368
384
|
exit?: VtSsrClassValue;
|
|
369
385
|
update?: VtSsrClassValue;
|
|
370
386
|
share?: VtSsrClassValue;
|
|
371
387
|
default?: VtSsrClassValue;
|
|
388
|
+
parentEnter?: VtSsrClassValue;
|
|
389
|
+
parentExit?: VtSsrClassValue;
|
|
390
|
+
onParentEnter?: unknown;
|
|
391
|
+
onParentExit?: unknown;
|
|
372
392
|
children?: unknown;
|
|
373
393
|
}
|
|
374
394
|
/**
|
|
@@ -643,6 +663,24 @@ export interface RenderResult {
|
|
|
643
663
|
}
|
|
644
664
|
/** Options accepted by the buffered render entry points (React-shaped subset). */
|
|
645
665
|
export interface RenderOptions {
|
|
666
|
+
/** The host already emitted earlySignalBootstrapScript before interactive HTML. */
|
|
667
|
+
earlySignalBootstrap?: 'external';
|
|
668
|
+
/** Shared request/account data owner borrowed across sibling SSR regions. */
|
|
669
|
+
signalOwner?: SignalOwner;
|
|
670
|
+
/** Automatically publish query attempts into the pre-module streamed receiver. */
|
|
671
|
+
streamedSignals?: {
|
|
672
|
+
readonly buildId: string;
|
|
673
|
+
readonly documentId: string;
|
|
674
|
+
readonly selectionGeneration?: number;
|
|
675
|
+
readonly maxFrameBytes?: number;
|
|
676
|
+
readonly maxTotalBytes?: number;
|
|
677
|
+
readonly timeoutMs?: number;
|
|
678
|
+
};
|
|
679
|
+
/** Compiler/bundler records for strict independently activated Hydrate boundaries. */
|
|
680
|
+
independentHydration?: {
|
|
681
|
+
readonly buildId: string;
|
|
682
|
+
readonly resolve: (templateBoundaryId: string) => IndependentHydrateBuildRecord | undefined;
|
|
683
|
+
};
|
|
646
684
|
/** Caller-controlled namespace for `useId`; use distinct prefixes for sibling roots. */
|
|
647
685
|
identifierPrefix?: string;
|
|
648
686
|
/** Called with any error thrown during the render (before it propagates). */
|
|
@@ -693,6 +731,8 @@ type SuspenseOutcome = SuspenseResult & {
|
|
|
693
731
|
thenable: PromiseLike<unknown>;
|
|
694
732
|
};
|
|
695
733
|
type ResolvedMap = Map<string, SuspenseOutcome> & {
|
|
734
|
+
/** Pending streaming subscriptions shared across this request's settle waves. */
|
|
735
|
+
streamSettlements?: StreamSettlements;
|
|
696
736
|
/** Recoverable buffered-boundary errors are reported once across async retries. */
|
|
697
737
|
bufferedErrors?: Map<string, {
|
|
698
738
|
error: unknown;
|
|
@@ -702,6 +742,11 @@ type ResolvedMap = Map<string, SuspenseOutcome> & {
|
|
|
702
742
|
resourceOptions?: RenderOptions | null;
|
|
703
743
|
/** Optional renderer resources; allocated only by a participating adapter. */
|
|
704
744
|
resources?: ServerRenderResources;
|
|
745
|
+
/** One request/account owner shared by every pass and streamed region. */
|
|
746
|
+
signalOwner?: SignalOwner;
|
|
747
|
+
ownedSignalOwner?: boolean;
|
|
748
|
+
signalInstances?: Map<string, SignalRendererOwnerIdentity>;
|
|
749
|
+
hasSignalControls?: boolean;
|
|
705
750
|
/** Render-local stable ids for non-primitive and long string control/list keys. */
|
|
706
751
|
asyncIdentities: Map<unknown, number>;
|
|
707
752
|
/** Cross-pass fallback ids for transient object keys at one lexical position. */
|
|
@@ -732,6 +777,8 @@ type ResolvedMap = Map<string, SuspenseOutcome> & {
|
|
|
732
777
|
touched?: Set<PromiseLike<unknown>>;
|
|
733
778
|
};
|
|
734
779
|
};
|
|
780
|
+
/** @internal Compiler/runtime server signal capability version 1. */
|
|
781
|
+
export declare function enableServerSignalBindings(abi?: number, potentialOnly?: boolean): void;
|
|
735
782
|
/** @internal Request lifetime for an optional renderer's asynchronous server work. */
|
|
736
783
|
export interface ServerRenderResourceContext {
|
|
737
784
|
readonly signal: AbortSignal | undefined;
|
|
@@ -750,6 +797,20 @@ interface ServerRenderResources extends ServerRenderResourceContext {
|
|
|
750
797
|
* or cancellation; return null so its adapter can reject before starting work.
|
|
751
798
|
*/
|
|
752
799
|
export declare function getServerRenderResourceContext(): ServerRenderResourceContext | null;
|
|
800
|
+
interface StreamSettlementRecorder {
|
|
801
|
+
promise: PromiseLike<unknown>;
|
|
802
|
+
key: string;
|
|
803
|
+
/** Batch registrations get a fresh synthetic key on every pass. */
|
|
804
|
+
keys: Set<string> | null;
|
|
805
|
+
batch: boolean;
|
|
806
|
+
wave: number;
|
|
807
|
+
}
|
|
808
|
+
interface StreamSettlements {
|
|
809
|
+
resolved: ResolvedMap | null;
|
|
810
|
+
pending: Map<PromiseLike<unknown>, StreamSettlementRecorder>;
|
|
811
|
+
wave: number;
|
|
812
|
+
wake: (() => void) | null;
|
|
813
|
+
}
|
|
753
814
|
/**
|
|
754
815
|
* React `react-dom/static` `prerender` — await ALL data (Suspense boundaries
|
|
755
816
|
* resolve to their success arm), then return the complete `{ html, css }`. Use
|
|
@@ -852,11 +913,27 @@ export declare function ssrTry(scope: SSRScope, siteKey: string, tryFn: (arg: un
|
|
|
852
913
|
* construction.
|
|
853
914
|
*/
|
|
854
915
|
export interface StreamInjectionSource {
|
|
916
|
+
/** @internal Pending query authority must precede shell-time module execution. */
|
|
917
|
+
takeInitialSelections?(): string;
|
|
918
|
+
/** This source emits validated renderer frames and needs the pre-module mailbox. */
|
|
919
|
+
readonly streamedRenderer?: true;
|
|
920
|
+
/** @internal Automatic query-attempt sink installed by streamedSignals. */
|
|
921
|
+
readonly observeSignalAttempt?: (attempt: ServerSignalQueryAttempt, run: <T>(callback: () => T) => T) => void;
|
|
922
|
+
/** @internal Server-only mirrors paired with the automatic attempt sink. */
|
|
923
|
+
readonly createSignalAttemptObservations?: () => ServerSignalQueryAttemptObservations;
|
|
855
924
|
/**
|
|
856
925
|
* Pull all queued HTML (concatenated, verbatim). Called at emission
|
|
857
926
|
* boundaries and after `subscribe` notifications; return '' when empty.
|
|
858
927
|
*/
|
|
859
928
|
take(): string;
|
|
929
|
+
/**
|
|
930
|
+
* Optional transport acknowledgement for demand-driven producers. Called
|
|
931
|
+
* after the string returned by take() has been accepted by the renderer's
|
|
932
|
+
* sink. A producer may defer its next iterator pull until this callback.
|
|
933
|
+
*/
|
|
934
|
+
accepted?(): void;
|
|
935
|
+
/** Release this response's producer when rendering fails or its request is canceled. */
|
|
936
|
+
cancel?(reason: unknown): void;
|
|
860
937
|
/**
|
|
861
938
|
* The source notifies when new HTML is queued; the renderer then drains
|
|
862
939
|
* promptly — even while the render itself is idle awaiting `done`.
|
|
@@ -881,6 +958,12 @@ export interface StreamInjectionSource {
|
|
|
881
958
|
}
|
|
882
959
|
export interface StreamOptions extends RenderOptions {
|
|
883
960
|
onShellReady?: () => void;
|
|
961
|
+
/**
|
|
962
|
+
* The initial shell uses signals requiring activation before document EOF.
|
|
963
|
+
* Called before shell publication, after its query authority is serialized.
|
|
964
|
+
* Feature-free renders do not call this hook.
|
|
965
|
+
*/
|
|
966
|
+
onEarlyHydrationReady?: () => void;
|
|
884
967
|
onShellError?: (err: unknown) => void;
|
|
885
968
|
onAllReady?: () => void;
|
|
886
969
|
/**
|