octane 0.13.7 → 0.13.8
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/cjs/index.cjs +2 -0
- package/dist/cjs/runtime.cjs +42 -4
- package/dist/cjs/runtime.server.cjs +32 -49
- package/dist/cjs/server/index.cjs +2 -0
- package/dist/cjs/signals/seed-serialization.cjs +2 -1
- package/dist/cjs/version.cjs +1 -1
- package/dist/compiler/compile.js +191 -16
- package/dist/compiler/slot-hooks.js +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -0
- package/dist/node/index.js +2 -0
- package/dist/node/runtime.js +41 -4
- package/dist/node/runtime.server.js +31 -49
- package/dist/node/server/index.js +2 -0
- package/dist/node/signals/seed-serialization.js +2 -1
- package/dist/node/version.js +1 -1
- package/dist/runtime.d.ts +2 -0
- package/dist/runtime.js +41 -4
- package/dist/runtime.server.d.ts +2 -0
- package/dist/runtime.server.js +31 -49
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +2 -0
- package/dist/signals/seed-serialization.js +2 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -83,6 +83,7 @@ __export(index_exports, {
|
|
|
83
83
|
compilerCacheMappedArray: () => import_runtime.compilerCacheMappedArray,
|
|
84
84
|
compilerOwnsContextProvider: () => import_runtime.compilerOwnsContextProvider,
|
|
85
85
|
componentSlot: () => import_runtime.componentSlot,
|
|
86
|
+
componentSlotFromConfig: () => import_runtime.componentSlotFromConfig,
|
|
86
87
|
componentSlotLite: () => import_runtime.componentSlotLite,
|
|
87
88
|
componentSlotVoid: () => import_runtime.componentSlotVoid,
|
|
88
89
|
createCompiledContext: () => import_runtime.createCompiledContext,
|
|
@@ -334,6 +335,7 @@ var import_method_dep = require("./method-dep.cjs");
|
|
|
334
335
|
compilerCacheMappedArray,
|
|
335
336
|
compilerOwnsContextProvider,
|
|
336
337
|
componentSlot,
|
|
338
|
+
componentSlotFromConfig,
|
|
337
339
|
componentSlotLite,
|
|
338
340
|
componentSlotVoid,
|
|
339
341
|
createCompiledContext,
|
package/dist/cjs/runtime.cjs
CHANGED
|
@@ -98,6 +98,7 @@ __export(runtime_exports, {
|
|
|
98
98
|
compilerOpaqueTag: () => compilerOpaqueTag,
|
|
99
99
|
compilerOwnsContextProvider: () => compilerOwnsContextProvider,
|
|
100
100
|
componentSlot: () => componentSlot,
|
|
101
|
+
componentSlotFromConfig: () => componentSlotFromConfig,
|
|
101
102
|
componentSlotLite: () => componentSlotLite,
|
|
102
103
|
componentSlotVoid: () => componentSlotVoid,
|
|
103
104
|
createCompiledContext: () => createCompiledContext,
|
|
@@ -9861,14 +9862,25 @@ function createCompiledContext(defaultValue) {
|
|
|
9861
9862
|
function CompiledContext(props, scope) {
|
|
9862
9863
|
provideContext(scope, props.context, props.value);
|
|
9863
9864
|
const children = props.children;
|
|
9864
|
-
if (children == null)
|
|
9865
|
+
if (children == null) {
|
|
9866
|
+
const previous2 = scope.hooks?.get(CHILDREN_DIALECT_SLOT);
|
|
9867
|
+
if (previous2 !== void 0 && previous2 !== 2) {
|
|
9868
|
+
resetScopeChildren(scope);
|
|
9869
|
+
if (scope.block.disposed) return;
|
|
9870
|
+
ensureHooks(scope).set(CHILDREN_DIALECT_SLOT, 2);
|
|
9871
|
+
}
|
|
9872
|
+
return;
|
|
9873
|
+
}
|
|
9865
9874
|
if (!isChildrenBlock(children)) {
|
|
9866
9875
|
throw new TypeError((0, import_error_codes_client_generated.formatClientError)(345));
|
|
9867
9876
|
}
|
|
9868
9877
|
const dialect = children[CHILDREN_BODY] ?? children;
|
|
9869
9878
|
const previous = scope.hooks?.get(CHILDREN_DIALECT_SLOT);
|
|
9870
9879
|
if (previous !== dialect) {
|
|
9871
|
-
if (previous
|
|
9880
|
+
if (previous === 2) {
|
|
9881
|
+
resetScopeChildren(scope);
|
|
9882
|
+
if (scope.block.disposed) return;
|
|
9883
|
+
} else if (previous !== void 0) {
|
|
9872
9884
|
invalidateSharedBodyOutput(scope);
|
|
9873
9885
|
if (TRANSITION_JOURNAL !== null && !ROOT_RENDER_ROLLBACK) {
|
|
9874
9886
|
const hooks = scope.hooks;
|
|
@@ -9899,7 +9911,7 @@ function renderClientContextProvider(context, props, renderScope) {
|
|
|
9899
9911
|
const scope = renderScope;
|
|
9900
9912
|
provideContext(scope, ctx, props.value);
|
|
9901
9913
|
const children = props.children;
|
|
9902
|
-
if (children != null) {
|
|
9914
|
+
if (children != null || scope.hooks?.get(CHILDREN_DIALECT_SLOT) !== void 0) {
|
|
9903
9915
|
const dialect = typeof children === "function" ? children[CHILDREN_BODY] ?? children : 2;
|
|
9904
9916
|
const previous = scope.hooks?.get(CHILDREN_DIALECT_SLOT);
|
|
9905
9917
|
if (previous !== dialect) {
|
|
@@ -21740,6 +21752,31 @@ function componentSlotVoid(parentScope, slotKey, domParent, comp, props, invocat
|
|
|
21740
21752
|
invocationSite
|
|
21741
21753
|
);
|
|
21742
21754
|
}
|
|
21755
|
+
function componentSlotFromConfig(parentScope, slotKey, domParent, comp, config, invocationSite, anchor) {
|
|
21756
|
+
if (typeof comp === "function" && (0, import_renderer_bridge.isRendererContext)(comp)) {
|
|
21757
|
+
(0, import_renderer_bridge.registerClientRendererBridge)(renderClientContextProvider, flushSync);
|
|
21758
|
+
}
|
|
21759
|
+
const key = hasElementConfigKey(config) ? "" + config.key : void 0;
|
|
21760
|
+
const props = copyElementConfig(config);
|
|
21761
|
+
(0, import_shared_value_helpers.applyElementDefaultProps)(comp, props);
|
|
21762
|
+
const body = comp === Fragment ? props.ref != null || import_has_own.hasOwnProp.call(props, "ref") ? renderFragmentRefDescriptor : renderFragmentConfig : comp;
|
|
21763
|
+
componentSlot(
|
|
21764
|
+
parentScope,
|
|
21765
|
+
slotKey,
|
|
21766
|
+
domParent,
|
|
21767
|
+
body,
|
|
21768
|
+
props,
|
|
21769
|
+
invocationSite,
|
|
21770
|
+
anchor,
|
|
21771
|
+
false,
|
|
21772
|
+
false,
|
|
21773
|
+
key,
|
|
21774
|
+
true
|
|
21775
|
+
);
|
|
21776
|
+
}
|
|
21777
|
+
function renderFragmentConfig(props) {
|
|
21778
|
+
return props.children;
|
|
21779
|
+
}
|
|
21743
21780
|
function rejectCompiledReturn(_block, _out, reset) {
|
|
21744
21781
|
if (reset !== true) {
|
|
21745
21782
|
throw new TypeError((0, import_error_codes_client_generated.formatClientError)(346));
|
|
@@ -21894,7 +21931,7 @@ function componentSlotImpl(outputHandler, parentScope, slotKey, domParent, body,
|
|
|
21894
21931
|
registerSlot(parentScope, state);
|
|
21895
21932
|
}
|
|
21896
21933
|
const nextKey = key === void 0 ? NO_KEY : "" + key;
|
|
21897
|
-
const keyChanged =
|
|
21934
|
+
const keyChanged = nextKey !== state.prevKey;
|
|
21898
21935
|
const replacing = identity !== state.currentComp || keyChanged;
|
|
21899
21936
|
const journaledSlot = ROOT_RENDER_TRANSACTION !== null && state.block !== null && replacing;
|
|
21900
21937
|
if (journaledSlot) {
|
|
@@ -32661,6 +32698,7 @@ function scriptResource(attrs) {
|
|
|
32661
32698
|
compilerOpaqueTag,
|
|
32662
32699
|
compilerOwnsContextProvider,
|
|
32663
32700
|
componentSlot,
|
|
32701
|
+
componentSlotFromConfig,
|
|
32664
32702
|
componentSlotLite,
|
|
32665
32703
|
componentSlotVoid,
|
|
32666
32704
|
createCompiledContext,
|
|
@@ -128,6 +128,7 @@ __export(runtime_server_exports, {
|
|
|
128
128
|
ssrChildrenSources: () => ssrChildrenSources,
|
|
129
129
|
ssrClass: () => ssrClass,
|
|
130
130
|
ssrComponent: () => ssrComponent,
|
|
131
|
+
ssrComponentFromConfig: () => ssrComponentFromConfig,
|
|
131
132
|
ssrComponentNS: () => ssrComponentNS,
|
|
132
133
|
ssrControl: () => ssrControl,
|
|
133
134
|
ssrElement: () => ssrElement,
|
|
@@ -1453,34 +1454,16 @@ function ssrTextPre(v) {
|
|
|
1453
1454
|
const s = ssrText(v);
|
|
1454
1455
|
return s.charCodeAt(0) === 10 ? "\n" + s : s;
|
|
1455
1456
|
}
|
|
1456
|
-
function
|
|
1457
|
-
if (SCOPED_ELEMENT_PROPS.has(d.props))
|
|
1458
|
-
return ssrComponent(
|
|
1459
|
-
scope,
|
|
1460
|
-
d.type,
|
|
1461
|
-
d.props,
|
|
1462
|
-
void 0,
|
|
1463
|
-
d.key ?? void 0,
|
|
1464
|
-
keyScoped,
|
|
1465
|
-
d.__octaneInvocationSite
|
|
1466
|
-
);
|
|
1467
|
-
}
|
|
1457
|
+
function descriptorProps(d) {
|
|
1458
|
+
if (SCOPED_ELEMENT_PROPS.has(d.props)) return d.props;
|
|
1468
1459
|
const children = d.children;
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
d.type,
|
|
1473
|
-
d.props,
|
|
1474
|
-
void 0,
|
|
1475
|
-
d.key ?? void 0,
|
|
1476
|
-
keyScoped,
|
|
1477
|
-
d.__octaneInvocationSite
|
|
1478
|
-
);
|
|
1479
|
-
}
|
|
1460
|
+
return children == null || children === d.props?.children ? d.props : { ...d.props, children };
|
|
1461
|
+
}
|
|
1462
|
+
function ssrComponentDescriptor(d, scope, keyScoped) {
|
|
1480
1463
|
return ssrComponent(
|
|
1481
1464
|
scope,
|
|
1482
1465
|
d.type,
|
|
1483
|
-
|
|
1466
|
+
descriptorProps(d),
|
|
1484
1467
|
void 0,
|
|
1485
1468
|
d.key ?? void 0,
|
|
1486
1469
|
keyScoped,
|
|
@@ -3473,6 +3456,16 @@ function ssrComponentNS(parent, comp, props, namespace, inherit, key, invocation
|
|
|
3473
3456
|
NEXT_COMPONENT_NAMESPACE = previous;
|
|
3474
3457
|
}
|
|
3475
3458
|
}
|
|
3459
|
+
function ssrComponentFromConfig(parent, comp, config, invocationSite, namespace = null) {
|
|
3460
|
+
const key = hasElementConfigKey(config) ? "" + config.key : void 0;
|
|
3461
|
+
const props = copyElementConfig(config);
|
|
3462
|
+
(0, import_shared_value_helpers.applyElementDefaultProps)(comp, props);
|
|
3463
|
+
const body = comp === Fragment ? props.ref != null || import_has_own.hasOwnProp.call(props, "ref") ? renderFragmentRefDescriptor : renderFragmentConfig : comp;
|
|
3464
|
+
return namespace === null ? ssrComponent(parent, body, props, false, key, void 0, invocationSite) : ssrComponentNS(parent, body, props, namespace, false, key, invocationSite);
|
|
3465
|
+
}
|
|
3466
|
+
function renderFragmentConfig(props, scope) {
|
|
3467
|
+
return ssrHtml(ssrChild(props.children, scope));
|
|
3468
|
+
}
|
|
3476
3469
|
function ssrInNamespace(namespace, render) {
|
|
3477
3470
|
const frame = FRAME;
|
|
3478
3471
|
if (frame === null) return render();
|
|
@@ -5288,6 +5281,10 @@ function spliceHead(body, head, documentRoot = isDocumentRoot(body)) {
|
|
|
5288
5281
|
function renderEntryValue(props, scope) {
|
|
5289
5282
|
return ssrHtml(ssrChild(props.value, scope));
|
|
5290
5283
|
}
|
|
5284
|
+
function renderEntry(entry, props, options) {
|
|
5285
|
+
if (typeof entry === "function") return [entry, props, options];
|
|
5286
|
+
return isElementDescriptor(entry) && typeof entry.type === "function" ? [entry.type, descriptorProps(entry), options ?? props] : [renderEntryValue, { value: entry }, options ?? props];
|
|
5287
|
+
}
|
|
5291
5288
|
const MAX_SUSPENSE_PASSES = 50;
|
|
5292
5289
|
let SUSPENSE_TIMEOUT_MS = 1e4;
|
|
5293
5290
|
function setSsrSuspenseTimeout(ms) {
|
|
@@ -6141,11 +6138,8 @@ function insertBufferedInjection(pass, injection) {
|
|
|
6141
6138
|
pass.body = tailStart === -1 ? pass.body + injection : pass.body.slice(0, tailStart) + injection + pass.body.slice(tailStart);
|
|
6142
6139
|
}
|
|
6143
6140
|
async function prerender(entryComponent, props, options) {
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
options ??= props;
|
|
6147
|
-
props = { value: entryComponent };
|
|
6148
|
-
}
|
|
6141
|
+
let component;
|
|
6142
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
6149
6143
|
const preparedOptions = needsAutomaticSignalInjection(options) ? await prepareAutomaticSignalInjection(options) : options;
|
|
6150
6144
|
const injection = preparedOptions?.injection;
|
|
6151
6145
|
const cancelRender = injection === void 0 ? void 0 : new AbortController();
|
|
@@ -6276,11 +6270,8 @@ function renderHostedAttempt(session, component, props, options) {
|
|
|
6276
6270
|
return { status: "complete", html: body, head: pass.head, cssEntries: pass.cssEntries };
|
|
6277
6271
|
}
|
|
6278
6272
|
function renderToString(entryComponent, props, options) {
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
options ??= props;
|
|
6282
|
-
props = { value: entryComponent };
|
|
6283
|
-
}
|
|
6273
|
+
let component;
|
|
6274
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
6284
6275
|
options?.signal?.throwIfAborted();
|
|
6285
6276
|
const nonceAttr = nonceAttrOf(options);
|
|
6286
6277
|
const resolved = newResolvedMap(options ?? null);
|
|
@@ -6306,11 +6297,8 @@ function renderToString(entryComponent, props, options) {
|
|
|
6306
6297
|
);
|
|
6307
6298
|
}
|
|
6308
6299
|
function renderToStaticMarkup(entryComponent, props, options) {
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
options ??= props;
|
|
6312
|
-
props = { value: entryComponent };
|
|
6313
|
-
}
|
|
6300
|
+
let component;
|
|
6301
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
6314
6302
|
options?.signal?.throwIfAborted();
|
|
6315
6303
|
const nonceAttr = nonceAttrOf(options);
|
|
6316
6304
|
const resolved = newResolvedMap(options ?? null);
|
|
@@ -7658,11 +7646,8 @@ async function runStream(component, props, options, sink, resolved, cancelInject
|
|
|
7658
7646
|
sink.allReady();
|
|
7659
7647
|
}
|
|
7660
7648
|
function renderToPipeableStream(entryComponent, props, options) {
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
options ??= props;
|
|
7664
|
-
props = { value: entryComponent };
|
|
7665
|
-
}
|
|
7649
|
+
let component;
|
|
7650
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
7666
7651
|
const controller = new AbortController();
|
|
7667
7652
|
let removeOuterAbort;
|
|
7668
7653
|
if (options?.signal) {
|
|
@@ -7906,11 +7891,8 @@ function renderToPipeableStream(entryComponent, props, options) {
|
|
|
7906
7891
|
};
|
|
7907
7892
|
}
|
|
7908
7893
|
function renderToReadableStream(entryComponent, props, options) {
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
options ??= props;
|
|
7912
|
-
props = { value: entryComponent };
|
|
7913
|
-
}
|
|
7894
|
+
let component;
|
|
7895
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
7914
7896
|
if (needsAutomaticSignalInjection(options)) {
|
|
7915
7897
|
return prepareAutomaticSignalInjection(options).then(
|
|
7916
7898
|
(prepared) => renderToReadableStream(component, props, prepared)
|
|
@@ -8502,6 +8484,7 @@ function preinitModule(href, options) {
|
|
|
8502
8484
|
ssrChildrenSources,
|
|
8503
8485
|
ssrClass,
|
|
8504
8486
|
ssrComponent,
|
|
8487
|
+
ssrComponentFromConfig,
|
|
8505
8488
|
ssrComponentNS,
|
|
8506
8489
|
ssrControl,
|
|
8507
8490
|
ssrElement,
|
|
@@ -107,6 +107,7 @@ __export(server_exports, {
|
|
|
107
107
|
ssrChildrenSources: () => import_runtime_server.ssrChildrenSources,
|
|
108
108
|
ssrClass: () => import_runtime_server.ssrClass,
|
|
109
109
|
ssrComponent: () => import_runtime_server.ssrComponent,
|
|
110
|
+
ssrComponentFromConfig: () => import_runtime_server.ssrComponentFromConfig,
|
|
110
111
|
ssrComponentNS: () => import_runtime_server.ssrComponentNS,
|
|
111
112
|
ssrControl: () => import_runtime_server.ssrControl,
|
|
112
113
|
ssrElement: () => import_runtime_server.ssrElement,
|
|
@@ -292,6 +293,7 @@ var import_runtime_server = require("../runtime.server.cjs");
|
|
|
292
293
|
ssrChildrenSources,
|
|
293
294
|
ssrClass,
|
|
294
295
|
ssrComponent,
|
|
296
|
+
ssrComponentFromConfig,
|
|
295
297
|
ssrComponentNS,
|
|
296
298
|
ssrControl,
|
|
297
299
|
ssrElement,
|
|
@@ -64,7 +64,8 @@ function serializeScopeRead(root, read) {
|
|
|
64
64
|
const scope = root.owner;
|
|
65
65
|
if (!scope.seedable) return [];
|
|
66
66
|
const rootEntry = scopeSeedEntry(scope, root, read);
|
|
67
|
-
if (!rootEntry)
|
|
67
|
+
if (!rootEntry)
|
|
68
|
+
return read === "snapshot" && root.state?.snapshot.status !== "ready" ? [] : void 0;
|
|
68
69
|
const owners = /* @__PURE__ */ new Map();
|
|
69
70
|
const keys = /* @__PURE__ */ new Map();
|
|
70
71
|
const seen = /* @__PURE__ */ new Set();
|
package/dist/cjs/version.cjs
CHANGED
|
@@ -21,7 +21,7 @@ __export(version_exports, {
|
|
|
21
21
|
version: () => version
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const version = "0.13.
|
|
24
|
+
const version = "0.13.8";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
version
|
package/dist/compiler/compile.js
CHANGED
|
@@ -15959,6 +15959,35 @@ function ssrEmitComponent(node, ctx, name, inlinedSubs, parentNs, cssHash, compo
|
|
|
15959
15959
|
// comp-call root of a `@{}` body — which is exactly this emit.
|
|
15960
15960
|
const inherit = ctx._ssrInheritRoot === true && !node._octaneBindingSite;
|
|
15961
15961
|
ctx._ssrInheritRoot = false;
|
|
15962
|
+
if (isStrongKeyedFragment(node, ctx)) {
|
|
15963
|
+
const fragment = prepareKeyedFragment(node, ctx, name, inlinedSubs);
|
|
15964
|
+
const sub = ssrCompileSub(
|
|
15965
|
+
fragment.children,
|
|
15966
|
+
ctx,
|
|
15967
|
+
'__skeyed',
|
|
15968
|
+
[fragment.param],
|
|
15969
|
+
cssHash,
|
|
15970
|
+
parentNs,
|
|
15971
|
+
componentNs,
|
|
15972
|
+
);
|
|
15973
|
+
// Component identity participates in SSR async replay keys, so this body
|
|
15974
|
+
// must stay stable when an ancestor suspends and renders again.
|
|
15975
|
+
ctx.hoistedHelpers.push(sub.fn);
|
|
15976
|
+
ctx.runtimeNeeded.add('ssrComponent');
|
|
15977
|
+
return ssrCall(
|
|
15978
|
+
'ssrComponent',
|
|
15979
|
+
[
|
|
15980
|
+
b.id('__s'),
|
|
15981
|
+
b.id(sub.fnName),
|
|
15982
|
+
fragment.propsExpr,
|
|
15983
|
+
b.literal(false),
|
|
15984
|
+
fragment.keyExpr,
|
|
15985
|
+
undefinedNode(),
|
|
15986
|
+
b.literal(invocationSite),
|
|
15987
|
+
],
|
|
15988
|
+
node,
|
|
15989
|
+
);
|
|
15990
|
+
}
|
|
15962
15991
|
// Capture before compiling attributes/children: nested subs temporarily mutate
|
|
15963
15992
|
// this context flag. Only this component's immediate children sub inherits the
|
|
15964
15993
|
// returned-fragment mode; control-flow arm subs intentionally reset it.
|
|
@@ -16115,6 +16144,20 @@ function ssrEmitComponent(node, ctx, name, inlinedSubs, parentNs, cssHash, compo
|
|
|
16115
16144
|
}
|
|
16116
16145
|
}
|
|
16117
16146
|
if (descriptorConfig) {
|
|
16147
|
+
if (ctx.strongRenderValues && !activityDescriptor && !isFragmentLongForm(node, ctx)) {
|
|
16148
|
+
ctx.runtimeNeeded.add('ssrComponentFromConfig');
|
|
16149
|
+
return ssrCall(
|
|
16150
|
+
'ssrComponentFromConfig',
|
|
16151
|
+
[
|
|
16152
|
+
b.id('__s'),
|
|
16153
|
+
compExpr,
|
|
16154
|
+
inheritOriginLoc(b.object(propNodes), node),
|
|
16155
|
+
b.literal(invocationSite),
|
|
16156
|
+
componentNs === null ? b.literal(null) : b.literal(componentNs),
|
|
16157
|
+
],
|
|
16158
|
+
node,
|
|
16159
|
+
);
|
|
16160
|
+
}
|
|
16118
16161
|
// The direct mode-only Activity was lowered to ActivityStatement. Richer
|
|
16119
16162
|
// Activity configs and generic explicit-key + spread sites keep one ordered
|
|
16120
16163
|
// element config, matching createElement without changing simple call sites.
|
|
@@ -16214,20 +16257,22 @@ function ssrCompileSub(
|
|
|
16214
16257
|
ctx._ssrFoldedExprHoles = baseName === '__sfragment';
|
|
16215
16258
|
let fn;
|
|
16216
16259
|
try {
|
|
16217
|
-
fn =
|
|
16218
|
-
|
|
16219
|
-
|
|
16220
|
-
|
|
16221
|
-
|
|
16222
|
-
|
|
16223
|
-
|
|
16224
|
-
|
|
16225
|
-
|
|
16226
|
-
|
|
16227
|
-
|
|
16228
|
-
|
|
16229
|
-
|
|
16230
|
-
|
|
16260
|
+
fn = withNestedTemplateScope(synth, ctx, () =>
|
|
16261
|
+
ssrCompileBody(
|
|
16262
|
+
synth,
|
|
16263
|
+
ctx,
|
|
16264
|
+
fnName,
|
|
16265
|
+
cssHash,
|
|
16266
|
+
[],
|
|
16267
|
+
parentNs || 'html',
|
|
16268
|
+
false,
|
|
16269
|
+
componentNs,
|
|
16270
|
+
returnedFragmentTemplate,
|
|
16271
|
+
returnedFragmentRoot,
|
|
16272
|
+
// Nested helpers touch no themes; the component body already did.
|
|
16273
|
+
[],
|
|
16274
|
+
unboxedHtml,
|
|
16275
|
+
),
|
|
16231
16276
|
);
|
|
16232
16277
|
} finally {
|
|
16233
16278
|
ctx._ssrFoldedExprHoles = prevFoldedExprHoles;
|
|
@@ -22455,6 +22500,65 @@ function hasJsxSpreadAttribute(node) {
|
|
|
22455
22500
|
);
|
|
22456
22501
|
}
|
|
22457
22502
|
|
|
22503
|
+
// A Strong template owns this entire render scope. Ref/spread configs retain
|
|
22504
|
+
// Fragment's inspectable descriptor boundary and its ref lifecycle.
|
|
22505
|
+
function isStrongKeyedFragment(node, ctx) {
|
|
22506
|
+
if (
|
|
22507
|
+
!ctx?.strongRenderValues ||
|
|
22508
|
+
node.openingElement?.metadata?.descriptorFragment ||
|
|
22509
|
+
ctx._returnedFragmentTemplate ||
|
|
22510
|
+
!isFragmentLongForm(node, ctx)
|
|
22511
|
+
)
|
|
22512
|
+
return false;
|
|
22513
|
+
const attrs = node.attributes || node.openingElement?.attributes || [];
|
|
22514
|
+
return attrs.length === 1 && hasJsxAttribute(node, 'key');
|
|
22515
|
+
}
|
|
22516
|
+
|
|
22517
|
+
// Reuse a component scope, keeping the whole body (including setup and try
|
|
22518
|
+
// arms) behind the key. Capture lexical receiver/arguments before hoisting, and
|
|
22519
|
+
// evaluate/coerce the key before snapshotting the locals its body reads.
|
|
22520
|
+
function prepareKeyedFragment(node, ctx, name, inlinedSubs) {
|
|
22521
|
+
let children = node.children || [];
|
|
22522
|
+
const lexical = captureCallbackLexicalValues(b.arrow([], b.block(children)), ctx);
|
|
22523
|
+
if (lexical) children = lexical.body.body;
|
|
22524
|
+
const captures = (helperCaptures(ctx, children, []) || []).map((name) => ({
|
|
22525
|
+
name,
|
|
22526
|
+
value: b.id(name),
|
|
22527
|
+
}));
|
|
22528
|
+
if (lexical) captures.push(...lexical.captures);
|
|
22529
|
+
const param = b.object_pattern(
|
|
22530
|
+
captures.map(({ name }) => b.prop('init', b.id(name), b.id(name), false, true)),
|
|
22531
|
+
);
|
|
22532
|
+
const props = b.object(captures.map(({ name, value }) => b.prop('init', b.id(name), value)));
|
|
22533
|
+
const value = (node.attributes || node.openingElement.attributes)[0].value;
|
|
22534
|
+
const key =
|
|
22535
|
+
value == null
|
|
22536
|
+
? b.literal(true)
|
|
22537
|
+
: value.type === 'JSXExpressionContainer'
|
|
22538
|
+
? value.expression
|
|
22539
|
+
: value;
|
|
22540
|
+
const keyName = allocCompilerName(ctx, '__fragmentKey');
|
|
22541
|
+
ctx.currentMapTemps.push(keyName);
|
|
22542
|
+
return {
|
|
22543
|
+
children,
|
|
22544
|
+
param,
|
|
22545
|
+
propsExpr: b.sequence([
|
|
22546
|
+
b.assignment('=', b.id(keyName), tsrxExprNode(key, ctx, name, inlinedSubs)),
|
|
22547
|
+
b.assignment(
|
|
22548
|
+
'=',
|
|
22549
|
+
b.id(keyName),
|
|
22550
|
+
b.conditional(
|
|
22551
|
+
b.binary('===', b.id(keyName), undefinedNode()),
|
|
22552
|
+
undefinedNode(),
|
|
22553
|
+
b.binary('+', b.literal(''), b.id(keyName)),
|
|
22554
|
+
),
|
|
22555
|
+
),
|
|
22556
|
+
props,
|
|
22557
|
+
]),
|
|
22558
|
+
keyExpr: b.id(keyName),
|
|
22559
|
+
};
|
|
22560
|
+
}
|
|
22561
|
+
|
|
22458
22562
|
// An explicit key cannot be split from a spread config: whichever occurs last
|
|
22459
22563
|
// wins, and all getters/expressions must run in source order. Extracted templates
|
|
22460
22564
|
// retain the proof after the complete config becomes a single spread hole.
|
|
@@ -23767,6 +23871,11 @@ function extractFragment(node, ctx, holeProps, parentNs = 'html', inDescriptor =
|
|
|
23767
23871
|
// The emission normalizes from `openingElement.attributes`, so update it too.
|
|
23768
23872
|
if (node.openingElement) {
|
|
23769
23873
|
out.openingElement = { ...node.openingElement, attributes: newAttrs };
|
|
23874
|
+
if (isStrongKeyedFragment(node, ctx)) {
|
|
23875
|
+
// Returned JSX keeps its inspectable value boundary. Its holes have
|
|
23876
|
+
// already been extracted in the owning component's render scope.
|
|
23877
|
+
out.openingElement.metadata = { ...node.openingElement.metadata, descriptorFragment: true };
|
|
23878
|
+
}
|
|
23770
23879
|
if (mergedKeyedSpreadConfig) {
|
|
23771
23880
|
out.openingElement.metadata = {
|
|
23772
23881
|
...node.openingElement.metadata,
|
|
@@ -26523,7 +26632,12 @@ function normalizeChildren(
|
|
|
26523
26632
|
// Keys need a reconciliation boundary. Parser-sensitive host trees need
|
|
26524
26633
|
// imperative construction so HTML repair cannot change binding paths.
|
|
26525
26634
|
// The shared descriptor path provides both without taxing ordinary templates.
|
|
26526
|
-
if (
|
|
26635
|
+
if (
|
|
26636
|
+
ctx &&
|
|
26637
|
+
allowImperative &&
|
|
26638
|
+
isDescriptorBuiltElement(n, inSvg, ctx) &&
|
|
26639
|
+
!isStrongKeyedFragment(n, ctx)
|
|
26640
|
+
) {
|
|
26527
26641
|
out.push(
|
|
26528
26642
|
inheritOriginLoc(
|
|
26529
26643
|
{
|
|
@@ -29393,6 +29507,26 @@ function planJsx(
|
|
|
29393
29507
|
const slotIndex = cc.slotIndex;
|
|
29394
29508
|
const org = cc.origin ?? planOrigin;
|
|
29395
29509
|
const hostExpr = () => hostNodeFor(`_compHost$${cc.id}`);
|
|
29510
|
+
if (cc.orderedConfig) {
|
|
29511
|
+
ctx.runtimeNeeded.add('componentSlotFromConfig');
|
|
29512
|
+
pushAfterStmt(
|
|
29513
|
+
cc.id,
|
|
29514
|
+
org,
|
|
29515
|
+
b.stmt(
|
|
29516
|
+
b.call(
|
|
29517
|
+
'_$componentSlotFromConfig',
|
|
29518
|
+
b.id('__s'),
|
|
29519
|
+
b.literal(slotIndex),
|
|
29520
|
+
hostExpr(),
|
|
29521
|
+
cc.compNode,
|
|
29522
|
+
cc.propsExpr,
|
|
29523
|
+
b.literal(cc.invocationSite),
|
|
29524
|
+
anchorNodeFor(cc, 'compAnchor') ?? b.literal(null),
|
|
29525
|
+
),
|
|
29526
|
+
),
|
|
29527
|
+
);
|
|
29528
|
+
continue;
|
|
29529
|
+
}
|
|
29396
29530
|
if (cc.hostChildrenBinding != null) {
|
|
29397
29531
|
const props = () => {
|
|
29398
29532
|
const host = bagFieldNode(bag, `_host$${cc.hostChildrenBinding.id}`);
|
|
@@ -34561,6 +34695,33 @@ function makeCompCall(
|
|
|
34561
34695
|
) {
|
|
34562
34696
|
const id = ctx.nextHelperId++;
|
|
34563
34697
|
const invocationSite = componentInvocationSite(ctx, node);
|
|
34698
|
+
if (isStrongKeyedFragment(node, ctx)) {
|
|
34699
|
+
const fragment = prepareKeyedFragment(node, ctx, componentName, inlinedSubs);
|
|
34700
|
+
const helper = hoistBodyHelper(
|
|
34701
|
+
ctx,
|
|
34702
|
+
inlinedSubs,
|
|
34703
|
+
'__keyed',
|
|
34704
|
+
fragment.children,
|
|
34705
|
+
[fragment.param],
|
|
34706
|
+
parentNs,
|
|
34707
|
+
cssHash,
|
|
34708
|
+
[],
|
|
34709
|
+
node,
|
|
34710
|
+
);
|
|
34711
|
+
return {
|
|
34712
|
+
id,
|
|
34713
|
+
invocationSite,
|
|
34714
|
+
compNode: b.id(helper),
|
|
34715
|
+
propsExpr: fragment.propsExpr,
|
|
34716
|
+
keyExpr: fragment.keyExpr,
|
|
34717
|
+
voidComponent: true,
|
|
34718
|
+
anchorlessAppendSafe: true,
|
|
34719
|
+
hostPath: null,
|
|
34720
|
+
autoMemoDeps: null,
|
|
34721
|
+
loc: devLoc(ctx, node),
|
|
34722
|
+
origin: node,
|
|
34723
|
+
};
|
|
34724
|
+
}
|
|
34564
34725
|
const compName = tagBindingName(node);
|
|
34565
34726
|
const directRenderer = isStaticFragmentComponent(node, ctx)
|
|
34566
34727
|
? ctx.componentInfo.get(compName).staticFragmentRenderer
|
|
@@ -34737,9 +34898,23 @@ function makeCompCall(
|
|
|
34737
34898
|
// The props object as a node; the call-site emit embeds it directly.
|
|
34738
34899
|
const propsExpr = staticFragmentRenderer?.props ?? inheritOriginLoc(b.object(propNodes), node);
|
|
34739
34900
|
if (descriptorConfig) {
|
|
34901
|
+
// Dynamic tags can still select a host with function actions or a Fragment.
|
|
34902
|
+
classifyDescriptorCapabilities(ctx, node.openingElement?.name || node.id, true, attrs);
|
|
34903
|
+
if (ctx.strongRenderValues && !activityDescriptor && !isFragmentLongForm(node, ctx)) {
|
|
34904
|
+
return {
|
|
34905
|
+
id,
|
|
34906
|
+
invocationSite,
|
|
34907
|
+
compNode,
|
|
34908
|
+
propsExpr,
|
|
34909
|
+
orderedConfig: true,
|
|
34910
|
+
anchorlessAppendSafe: true,
|
|
34911
|
+
hostPath: null,
|
|
34912
|
+
loc: devLoc(ctx, node),
|
|
34913
|
+
origin: node,
|
|
34914
|
+
};
|
|
34915
|
+
}
|
|
34740
34916
|
// A keyed spread builds a descriptor whose tag may be a host string or a
|
|
34741
34917
|
// Fragment at runtime, so its props select descriptor capabilities too.
|
|
34742
|
-
classifyDescriptorCapabilities(ctx, node.openingElement?.name || node.id, true, attrs);
|
|
34743
34918
|
ctx.runtimeNeeded.add('createElementFromConfig');
|
|
34744
34919
|
return {
|
|
34745
34920
|
id,
|
|
@@ -1333,7 +1333,9 @@ export function slotHooks(source, id, options) {
|
|
|
1333
1333
|
}
|
|
1334
1334
|
const getterCalls = importInfo.importsHook ? collectStateGetterCalls(ast) : new WeakSet();
|
|
1335
1335
|
if (
|
|
1336
|
-
|
|
1336
|
+
// Manual Strong modules already reject generated declaration caches above,
|
|
1337
|
+
// so their authored memo calls can keep the existing production lowering.
|
|
1338
|
+
(!strongAnalysis?.enabled || options?.manualSlots === true) &&
|
|
1337
1339
|
// The whole-AST memo path does not apply declaration identity edits.
|
|
1338
1340
|
!signalLowering.usesSignals &&
|
|
1339
1341
|
canPrint &&
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { attachBehaviorRoot } from './behavior-root.js';
|
|
|
9
9
|
export { captureFormSubmissions } from './behavior-form-submissions.js';
|
|
10
10
|
export type * from './behavior-root.js';
|
|
11
11
|
export { createSubSlot, subSlot, type SubSlot, type SlotlessSubSlot, type SubSlotOptions, } from './sub-slot.js';
|
|
12
|
-
export { createRoot, hydrateRoot, flushSync, act, isInActScope, type Root, type RootContainer, type RootOptions, useState, useLinkedState, type LinkedStatePrevious, type LinkedStateOptions, useReducer, useEffect, useLayoutEffect, useLayoutSnapshot, useInsertionEffect, useMemo, useCallback, useRef, useLazyRef, useId, useImperativeHandle, useEffectEvent, useSyncExternalStore, useDeferredValue, useTransition, useActionState, useActionState as useFormState, useFormStatus, useOptimistic, useDebugValue, type FormStatus, startTransition, requestFormReset, memo, lazy, preload, preinit, preloadModule, preinitModule, preconnect, prefetchDNS, createContext, createCompiledContext, CompiledContext, CompiledOutlet, type CompiledComponent, use, useContext, type Context, type ForeignHostContext, Suspense, ErrorBoundary, Hydrate, __HydrateCompiled, Activity, Activity as unstable_Activity, ViewTransition, addTransitionType, ViewTransition as unstable_ViewTransition, addTransitionType as unstable_addTransitionType, ViewTransitionPseudoElement, type ViewTransitionProps, type ViewTransitionInstance, Fragment, type FragmentProps, createPortal, type PortalDescriptor, createElement, cloneElement, isValidElement, isChildrenBlock, descriptorChildren, Children, type ElementDescriptor, type ComponentBody, type OctaneNode, TsrxErrorBoundary, __useStateWithGetter, __useLinkedStateWithGetter, __useReducerWithGetter, __createVoidRoot, __hydrateVoidRoot, __voidRootProps, bindRendererRegionOwner, EXTERNAL_HYDRATION_PROMISE, HYDRATION_RANGE_BOUNDARY, createHostContextRequest, __vtSeen, template, clone, drainFrag, bag0, bag1, bag2, bag3, bag4, bag5, bag6, bag7, bag8, bag9, bag10, bag11, bag12, bag13, bag14, bag15, bag16, bagOf, evt0, evt0u, evt1, evt1u, evt2, evt2u, evt1e, evt2e, evtN, evtNu, setEventHandler, devEventListener, devHtmlNesting, htext, htextSwap, textareaText, child, sibling, setText, setScriptText, setHTML, setDangerouslySetInnerHTML, setDangerouslySetInnerHTMLSources, markDangerouslySetInnerHTMLChildren, setAttribute, setStringData, setBooleanAttribute, setAriaAttribute, setClassName, setClassAttr, normalizeClass, isHydratingStyle, setStyle, setStyleProperty, setStyleProperties, setSpread, snapshotSpread, setHostPropSources, queueNativeChangeDiagnostic, queueFormAuthoringDiagnostic, markNativeChangeDiagnosticStatic, setFormAction, setValue, setFormControlSources, setChecked, setCheckedCheckable, setSelectValue, setDefaultValue, setDefaultValueUncontrolled, setDefaultChecked, setAutoFocus, attachRef, queueRefAttach, queueRefDetach, replaceRef, queueOwnRefDetach, injectStyle, headBlock, stylesheetResource, styleResource, scriptResource, namespaceHead, namespaceHeadElement, delegateEvents, delegateCaptureEvents, fastForBlock, fastKeyedForBlock, fastMapSlot, forBlock, keyedForBlock, mapSlot, ifBlock, errorBlock, tryBlock, switchBlock, activityBlock, componentSlot, componentSlotVoid, componentSlotLite, compilerCacheArray, compilerCacheImmutableArrayFilter, compilerCacheMappedArray, compilerCacheContext, compilerOwnsContextProvider, markSingleRoot, markWarm, markSingleRoot as __s, markChildrenBlock, createScopedValue, createScopedElement, childSlot, positionalChildren, textSlot, textHole, childTextHole, hostComponent, renderBlock, portal, hookSlots, withSlot, manualHook, invokeManualHook, useBatch, registerWarmPlan, seedOrCreate, warmMemo, warmChild, puMiss, puTake0, puTake1, puTake2, puTake3, puTake4, puPub, provideContext, mountFragmentRef, FragmentInstance, hmr, HMR, hasPendingWork, type Scope, type Block, drainPassiveEffects, setIsOctaneActEnvironment, resetFloatResourceState, setTransitionFallbackTimeout, getTransitionFallbackTimeout, } from './runtime.js';
|
|
12
|
+
export { createRoot, hydrateRoot, flushSync, act, isInActScope, type Root, type RootContainer, type RootOptions, useState, useLinkedState, type LinkedStatePrevious, type LinkedStateOptions, useReducer, useEffect, useLayoutEffect, useLayoutSnapshot, useInsertionEffect, useMemo, useCallback, useRef, useLazyRef, useId, useImperativeHandle, useEffectEvent, useSyncExternalStore, useDeferredValue, useTransition, useActionState, useActionState as useFormState, useFormStatus, useOptimistic, useDebugValue, type FormStatus, startTransition, requestFormReset, memo, lazy, preload, preinit, preloadModule, preinitModule, preconnect, prefetchDNS, createContext, createCompiledContext, CompiledContext, CompiledOutlet, type CompiledComponent, use, useContext, type Context, type ForeignHostContext, Suspense, ErrorBoundary, Hydrate, __HydrateCompiled, Activity, Activity as unstable_Activity, ViewTransition, addTransitionType, ViewTransition as unstable_ViewTransition, addTransitionType as unstable_addTransitionType, ViewTransitionPseudoElement, type ViewTransitionProps, type ViewTransitionInstance, Fragment, type FragmentProps, createPortal, type PortalDescriptor, createElement, cloneElement, isValidElement, isChildrenBlock, descriptorChildren, Children, type ElementDescriptor, type ComponentBody, type OctaneNode, TsrxErrorBoundary, __useStateWithGetter, __useLinkedStateWithGetter, __useReducerWithGetter, __createVoidRoot, __hydrateVoidRoot, __voidRootProps, bindRendererRegionOwner, EXTERNAL_HYDRATION_PROMISE, HYDRATION_RANGE_BOUNDARY, createHostContextRequest, __vtSeen, template, clone, drainFrag, bag0, bag1, bag2, bag3, bag4, bag5, bag6, bag7, bag8, bag9, bag10, bag11, bag12, bag13, bag14, bag15, bag16, bagOf, evt0, evt0u, evt1, evt1u, evt2, evt2u, evt1e, evt2e, evtN, evtNu, setEventHandler, devEventListener, devHtmlNesting, htext, htextSwap, textareaText, child, sibling, setText, setScriptText, setHTML, setDangerouslySetInnerHTML, setDangerouslySetInnerHTMLSources, markDangerouslySetInnerHTMLChildren, setAttribute, setStringData, setBooleanAttribute, setAriaAttribute, setClassName, setClassAttr, normalizeClass, isHydratingStyle, setStyle, setStyleProperty, setStyleProperties, setSpread, snapshotSpread, setHostPropSources, queueNativeChangeDiagnostic, queueFormAuthoringDiagnostic, markNativeChangeDiagnosticStatic, setFormAction, setValue, setFormControlSources, setChecked, setCheckedCheckable, setSelectValue, setDefaultValue, setDefaultValueUncontrolled, setDefaultChecked, setAutoFocus, attachRef, queueRefAttach, queueRefDetach, replaceRef, queueOwnRefDetach, injectStyle, headBlock, stylesheetResource, styleResource, scriptResource, namespaceHead, namespaceHeadElement, delegateEvents, delegateCaptureEvents, fastForBlock, fastKeyedForBlock, fastMapSlot, forBlock, keyedForBlock, mapSlot, ifBlock, errorBlock, tryBlock, switchBlock, activityBlock, componentSlot, componentSlotVoid, componentSlotFromConfig, componentSlotLite, compilerCacheArray, compilerCacheImmutableArrayFilter, compilerCacheMappedArray, compilerCacheContext, compilerOwnsContextProvider, markSingleRoot, markWarm, markSingleRoot as __s, markChildrenBlock, createScopedValue, createScopedElement, childSlot, positionalChildren, textSlot, textHole, childTextHole, hostComponent, renderBlock, portal, hookSlots, withSlot, manualHook, invokeManualHook, useBatch, registerWarmPlan, seedOrCreate, warmMemo, warmChild, puMiss, puTake0, puTake1, puTake2, puTake3, puTake4, puPub, provideContext, mountFragmentRef, FragmentInstance, hmr, HMR, hasPendingWork, type Scope, type Block, drainPassiveEffects, setIsOctaneActEnvironment, resetFloatResourceState, setTransitionFallbackTimeout, getTransitionFallbackTimeout, } from './runtime.js';
|
|
13
13
|
export type { HydrateOptions, HydrateProps, HydrateWhen, HydrationInteractionEvent, HydrationInteractionEvents, HydrationPrefetchContext, HydrationPrefetchFunction, HydrationPrefetchStrategy, HydrationPrefetchWaitReason, HydrationStrategy, HydrationWhen, } from './hydration/types.js';
|
|
14
14
|
export { __serverRpc } from './server-rpc-client.js';
|
|
15
15
|
export { ServerCallUncertainError } from './server-rpc-protocol.js';
|
package/dist/index.js
CHANGED
|
@@ -183,6 +183,7 @@ import {
|
|
|
183
183
|
activityBlock,
|
|
184
184
|
componentSlot,
|
|
185
185
|
componentSlotVoid,
|
|
186
|
+
componentSlotFromConfig,
|
|
186
187
|
componentSlotLite,
|
|
187
188
|
compilerCacheArray,
|
|
188
189
|
compilerCacheImmutableArrayFilter,
|
|
@@ -301,6 +302,7 @@ export {
|
|
|
301
302
|
compilerCacheMappedArray,
|
|
302
303
|
compilerOwnsContextProvider,
|
|
303
304
|
componentSlot,
|
|
305
|
+
componentSlotFromConfig,
|
|
304
306
|
componentSlotLite,
|
|
305
307
|
componentSlotVoid,
|
|
306
308
|
createCompiledContext,
|
package/dist/node/index.js
CHANGED
|
@@ -183,6 +183,7 @@ import {
|
|
|
183
183
|
activityBlock,
|
|
184
184
|
componentSlot,
|
|
185
185
|
componentSlotVoid,
|
|
186
|
+
componentSlotFromConfig,
|
|
186
187
|
componentSlotLite,
|
|
187
188
|
compilerCacheArray,
|
|
188
189
|
compilerCacheImmutableArrayFilter,
|
|
@@ -301,6 +302,7 @@ export {
|
|
|
301
302
|
compilerCacheMappedArray,
|
|
302
303
|
compilerOwnsContextProvider,
|
|
303
304
|
componentSlot,
|
|
305
|
+
componentSlotFromConfig,
|
|
304
306
|
componentSlotLite,
|
|
305
307
|
componentSlotVoid,
|
|
306
308
|
createCompiledContext,
|
package/dist/node/runtime.js
CHANGED
|
@@ -9746,14 +9746,25 @@ function createCompiledContext(defaultValue) {
|
|
|
9746
9746
|
function CompiledContext(props, scope) {
|
|
9747
9747
|
provideContext(scope, props.context, props.value);
|
|
9748
9748
|
const children = props.children;
|
|
9749
|
-
if (children == null)
|
|
9749
|
+
if (children == null) {
|
|
9750
|
+
const previous2 = scope.hooks?.get(CHILDREN_DIALECT_SLOT);
|
|
9751
|
+
if (previous2 !== void 0 && previous2 !== 2) {
|
|
9752
|
+
resetScopeChildren(scope);
|
|
9753
|
+
if (scope.block.disposed) return;
|
|
9754
|
+
ensureHooks(scope).set(CHILDREN_DIALECT_SLOT, 2);
|
|
9755
|
+
}
|
|
9756
|
+
return;
|
|
9757
|
+
}
|
|
9750
9758
|
if (!isChildrenBlock(children)) {
|
|
9751
9759
|
throw new TypeError(formatClientError(345));
|
|
9752
9760
|
}
|
|
9753
9761
|
const dialect = children[CHILDREN_BODY] ?? children;
|
|
9754
9762
|
const previous = scope.hooks?.get(CHILDREN_DIALECT_SLOT);
|
|
9755
9763
|
if (previous !== dialect) {
|
|
9756
|
-
if (previous
|
|
9764
|
+
if (previous === 2) {
|
|
9765
|
+
resetScopeChildren(scope);
|
|
9766
|
+
if (scope.block.disposed) return;
|
|
9767
|
+
} else if (previous !== void 0) {
|
|
9757
9768
|
invalidateSharedBodyOutput(scope);
|
|
9758
9769
|
if (TRANSITION_JOURNAL !== null && !ROOT_RENDER_ROLLBACK) {
|
|
9759
9770
|
const hooks = scope.hooks;
|
|
@@ -9784,7 +9795,7 @@ function renderClientContextProvider(context, props, renderScope) {
|
|
|
9784
9795
|
const scope = renderScope;
|
|
9785
9796
|
provideContext(scope, ctx, props.value);
|
|
9786
9797
|
const children = props.children;
|
|
9787
|
-
if (children != null) {
|
|
9798
|
+
if (children != null || scope.hooks?.get(CHILDREN_DIALECT_SLOT) !== void 0) {
|
|
9788
9799
|
const dialect = typeof children === "function" ? children[CHILDREN_BODY] ?? children : 2;
|
|
9789
9800
|
const previous = scope.hooks?.get(CHILDREN_DIALECT_SLOT);
|
|
9790
9801
|
if (previous !== dialect) {
|
|
@@ -21634,6 +21645,31 @@ function componentSlotVoid(parentScope, slotKey, domParent, comp, props, invocat
|
|
|
21634
21645
|
invocationSite
|
|
21635
21646
|
);
|
|
21636
21647
|
}
|
|
21648
|
+
function componentSlotFromConfig(parentScope, slotKey, domParent, comp, config, invocationSite, anchor) {
|
|
21649
|
+
if (typeof comp === "function" && isRendererContext(comp)) {
|
|
21650
|
+
registerClientRendererBridge(renderClientContextProvider, flushSync);
|
|
21651
|
+
}
|
|
21652
|
+
const key = hasElementConfigKey(config) ? "" + config.key : void 0;
|
|
21653
|
+
const props = copyElementConfig(config);
|
|
21654
|
+
applyElementDefaultProps(comp, props);
|
|
21655
|
+
const body = comp === Fragment ? props.ref != null || hasOwnProp.call(props, "ref") ? renderFragmentRefDescriptor : renderFragmentConfig : comp;
|
|
21656
|
+
componentSlot(
|
|
21657
|
+
parentScope,
|
|
21658
|
+
slotKey,
|
|
21659
|
+
domParent,
|
|
21660
|
+
body,
|
|
21661
|
+
props,
|
|
21662
|
+
invocationSite,
|
|
21663
|
+
anchor,
|
|
21664
|
+
false,
|
|
21665
|
+
false,
|
|
21666
|
+
key,
|
|
21667
|
+
true
|
|
21668
|
+
);
|
|
21669
|
+
}
|
|
21670
|
+
function renderFragmentConfig(props) {
|
|
21671
|
+
return props.children;
|
|
21672
|
+
}
|
|
21637
21673
|
function rejectCompiledReturn(_block, _out, reset) {
|
|
21638
21674
|
if (reset !== true) {
|
|
21639
21675
|
throw new TypeError(formatClientError(346));
|
|
@@ -21788,7 +21824,7 @@ function componentSlotImpl(outputHandler, parentScope, slotKey, domParent, body,
|
|
|
21788
21824
|
registerSlot(parentScope, state);
|
|
21789
21825
|
}
|
|
21790
21826
|
const nextKey = key === void 0 ? NO_KEY : "" + key;
|
|
21791
|
-
const keyChanged =
|
|
21827
|
+
const keyChanged = nextKey !== state.prevKey;
|
|
21792
21828
|
const replacing = identity !== state.currentComp || keyChanged;
|
|
21793
21829
|
const journaledSlot = ROOT_RENDER_TRANSACTION !== null && state.block !== null && replacing;
|
|
21794
21830
|
if (journaledSlot) {
|
|
@@ -32554,6 +32590,7 @@ export {
|
|
|
32554
32590
|
compilerOpaqueTag,
|
|
32555
32591
|
compilerOwnsContextProvider,
|
|
32556
32592
|
componentSlot,
|
|
32593
|
+
componentSlotFromConfig,
|
|
32557
32594
|
componentSlotLite,
|
|
32558
32595
|
componentSlotVoid,
|
|
32559
32596
|
createCompiledContext,
|
|
@@ -1375,34 +1375,16 @@ function ssrTextPre(v) {
|
|
|
1375
1375
|
const s = ssrText(v);
|
|
1376
1376
|
return s.charCodeAt(0) === 10 ? "\n" + s : s;
|
|
1377
1377
|
}
|
|
1378
|
-
function
|
|
1379
|
-
if (SCOPED_ELEMENT_PROPS.has(d.props))
|
|
1380
|
-
return ssrComponent(
|
|
1381
|
-
scope,
|
|
1382
|
-
d.type,
|
|
1383
|
-
d.props,
|
|
1384
|
-
void 0,
|
|
1385
|
-
d.key ?? void 0,
|
|
1386
|
-
keyScoped,
|
|
1387
|
-
d.__octaneInvocationSite
|
|
1388
|
-
);
|
|
1389
|
-
}
|
|
1378
|
+
function descriptorProps(d) {
|
|
1379
|
+
if (SCOPED_ELEMENT_PROPS.has(d.props)) return d.props;
|
|
1390
1380
|
const children = d.children;
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
d.type,
|
|
1395
|
-
d.props,
|
|
1396
|
-
void 0,
|
|
1397
|
-
d.key ?? void 0,
|
|
1398
|
-
keyScoped,
|
|
1399
|
-
d.__octaneInvocationSite
|
|
1400
|
-
);
|
|
1401
|
-
}
|
|
1381
|
+
return children == null || children === d.props?.children ? d.props : { ...d.props, children };
|
|
1382
|
+
}
|
|
1383
|
+
function ssrComponentDescriptor(d, scope, keyScoped) {
|
|
1402
1384
|
return ssrComponent(
|
|
1403
1385
|
scope,
|
|
1404
1386
|
d.type,
|
|
1405
|
-
|
|
1387
|
+
descriptorProps(d),
|
|
1406
1388
|
void 0,
|
|
1407
1389
|
d.key ?? void 0,
|
|
1408
1390
|
keyScoped,
|
|
@@ -3395,6 +3377,16 @@ function ssrComponentNS(parent, comp, props, namespace, inherit, key, invocation
|
|
|
3395
3377
|
NEXT_COMPONENT_NAMESPACE = previous;
|
|
3396
3378
|
}
|
|
3397
3379
|
}
|
|
3380
|
+
function ssrComponentFromConfig(parent, comp, config, invocationSite, namespace = null) {
|
|
3381
|
+
const key = hasElementConfigKey(config) ? "" + config.key : void 0;
|
|
3382
|
+
const props = copyElementConfig(config);
|
|
3383
|
+
applyElementDefaultProps(comp, props);
|
|
3384
|
+
const body = comp === Fragment ? props.ref != null || hasOwnProp.call(props, "ref") ? renderFragmentRefDescriptor : renderFragmentConfig : comp;
|
|
3385
|
+
return namespace === null ? ssrComponent(parent, body, props, false, key, void 0, invocationSite) : ssrComponentNS(parent, body, props, namespace, false, key, invocationSite);
|
|
3386
|
+
}
|
|
3387
|
+
function renderFragmentConfig(props, scope) {
|
|
3388
|
+
return ssrHtml(ssrChild(props.children, scope));
|
|
3389
|
+
}
|
|
3398
3390
|
function ssrInNamespace(namespace, render) {
|
|
3399
3391
|
const frame = FRAME;
|
|
3400
3392
|
if (frame === null) return render();
|
|
@@ -5210,6 +5202,10 @@ function spliceHead(body, head, documentRoot = isDocumentRoot(body)) {
|
|
|
5210
5202
|
function renderEntryValue(props, scope) {
|
|
5211
5203
|
return ssrHtml(ssrChild(props.value, scope));
|
|
5212
5204
|
}
|
|
5205
|
+
function renderEntry(entry, props, options) {
|
|
5206
|
+
if (typeof entry === "function") return [entry, props, options];
|
|
5207
|
+
return isElementDescriptor(entry) && typeof entry.type === "function" ? [entry.type, descriptorProps(entry), options ?? props] : [renderEntryValue, { value: entry }, options ?? props];
|
|
5208
|
+
}
|
|
5213
5209
|
const MAX_SUSPENSE_PASSES = 50;
|
|
5214
5210
|
let SUSPENSE_TIMEOUT_MS = 1e4;
|
|
5215
5211
|
function setSsrSuspenseTimeout(ms) {
|
|
@@ -6063,11 +6059,8 @@ function insertBufferedInjection(pass, injection) {
|
|
|
6063
6059
|
pass.body = tailStart === -1 ? pass.body + injection : pass.body.slice(0, tailStart) + injection + pass.body.slice(tailStart);
|
|
6064
6060
|
}
|
|
6065
6061
|
async function prerender(entryComponent, props, options) {
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
options ??= props;
|
|
6069
|
-
props = { value: entryComponent };
|
|
6070
|
-
}
|
|
6062
|
+
let component;
|
|
6063
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
6071
6064
|
const preparedOptions = needsAutomaticSignalInjection(options) ? await prepareAutomaticSignalInjection(options) : options;
|
|
6072
6065
|
const injection = preparedOptions?.injection;
|
|
6073
6066
|
const cancelRender = injection === void 0 ? void 0 : new AbortController();
|
|
@@ -6198,11 +6191,8 @@ function renderHostedAttempt(session, component, props, options) {
|
|
|
6198
6191
|
return { status: "complete", html: body, head: pass.head, cssEntries: pass.cssEntries };
|
|
6199
6192
|
}
|
|
6200
6193
|
function renderToString(entryComponent, props, options) {
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
options ??= props;
|
|
6204
|
-
props = { value: entryComponent };
|
|
6205
|
-
}
|
|
6194
|
+
let component;
|
|
6195
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
6206
6196
|
options?.signal?.throwIfAborted();
|
|
6207
6197
|
const nonceAttr = nonceAttrOf(options);
|
|
6208
6198
|
const resolved = newResolvedMap(options ?? null);
|
|
@@ -6228,11 +6218,8 @@ function renderToString(entryComponent, props, options) {
|
|
|
6228
6218
|
);
|
|
6229
6219
|
}
|
|
6230
6220
|
function renderToStaticMarkup(entryComponent, props, options) {
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
options ??= props;
|
|
6234
|
-
props = { value: entryComponent };
|
|
6235
|
-
}
|
|
6221
|
+
let component;
|
|
6222
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
6236
6223
|
options?.signal?.throwIfAborted();
|
|
6237
6224
|
const nonceAttr = nonceAttrOf(options);
|
|
6238
6225
|
const resolved = newResolvedMap(options ?? null);
|
|
@@ -7580,11 +7567,8 @@ async function runStream(component, props, options, sink, resolved, cancelInject
|
|
|
7580
7567
|
sink.allReady();
|
|
7581
7568
|
}
|
|
7582
7569
|
function renderToPipeableStream(entryComponent, props, options) {
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
options ??= props;
|
|
7586
|
-
props = { value: entryComponent };
|
|
7587
|
-
}
|
|
7570
|
+
let component;
|
|
7571
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
7588
7572
|
const controller = new AbortController();
|
|
7589
7573
|
let removeOuterAbort;
|
|
7590
7574
|
if (options?.signal) {
|
|
@@ -7828,11 +7812,8 @@ function renderToPipeableStream(entryComponent, props, options) {
|
|
|
7828
7812
|
};
|
|
7829
7813
|
}
|
|
7830
7814
|
function renderToReadableStream(entryComponent, props, options) {
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
options ??= props;
|
|
7834
|
-
props = { value: entryComponent };
|
|
7835
|
-
}
|
|
7815
|
+
let component;
|
|
7816
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
7836
7817
|
if (needsAutomaticSignalInjection(options)) {
|
|
7837
7818
|
return prepareAutomaticSignalInjection(options).then(
|
|
7838
7819
|
(prepared) => renderToReadableStream(component, props, prepared)
|
|
@@ -8423,6 +8404,7 @@ export {
|
|
|
8423
8404
|
ssrChildrenSources,
|
|
8424
8405
|
ssrClass,
|
|
8425
8406
|
ssrComponent,
|
|
8407
|
+
ssrComponentFromConfig,
|
|
8426
8408
|
ssrComponentNS,
|
|
8427
8409
|
ssrControl,
|
|
8428
8410
|
ssrElement,
|
|
@@ -152,6 +152,7 @@ import {
|
|
|
152
152
|
ssrElement,
|
|
153
153
|
ssrComponent,
|
|
154
154
|
ssrComponentNS,
|
|
155
|
+
ssrComponentFromConfig,
|
|
155
156
|
ssrInNamespace,
|
|
156
157
|
ssrBlock,
|
|
157
158
|
ssrFragmentMarker,
|
|
@@ -267,6 +268,7 @@ export {
|
|
|
267
268
|
ssrChildrenSources,
|
|
268
269
|
ssrClass,
|
|
269
270
|
ssrComponent,
|
|
271
|
+
ssrComponentFromConfig,
|
|
270
272
|
ssrComponentNS,
|
|
271
273
|
ssrControl,
|
|
272
274
|
ssrElement,
|
|
@@ -40,7 +40,8 @@ function serializeScopeRead(root, read) {
|
|
|
40
40
|
const scope = root.owner;
|
|
41
41
|
if (!scope.seedable) return [];
|
|
42
42
|
const rootEntry = scopeSeedEntry(scope, root, read);
|
|
43
|
-
if (!rootEntry)
|
|
43
|
+
if (!rootEntry)
|
|
44
|
+
return read === "snapshot" && root.state?.snapshot.status !== "ready" ? [] : void 0;
|
|
44
45
|
const owners = /* @__PURE__ */ new Map();
|
|
45
46
|
const keys = /* @__PURE__ */ new Map();
|
|
46
47
|
const seen = /* @__PURE__ */ new Set();
|
package/dist/node/version.js
CHANGED
package/dist/runtime.d.ts
CHANGED
|
@@ -3099,6 +3099,8 @@ export declare const Children: {
|
|
|
3099
3099
|
export declare function componentSlot(parentScope: Scope, slotKey: number, domParent: Node, comp: ComponentBody | string, props: any, invocationSite?: string, anchor?: Node | null, singleRoot?: boolean | 2, inherit?: boolean, key?: any, hasKey?: boolean): void;
|
|
3100
3100
|
/** Compiler-proven `@{}` component call site: the body has no value return. */
|
|
3101
3101
|
export declare function componentSlotVoid(parentScope: Scope, slotKey: number, domParent: Node, comp: ComponentBody | string, props: any, invocationSite?: string, anchor?: Node | null, singleRoot?: boolean | 2, inherit?: boolean, key?: any, hasKey?: boolean): void;
|
|
3102
|
+
/** Compiler-owned ordered JSX config, without an intermediate element record. */
|
|
3103
|
+
export declare function componentSlotFromConfig(parentScope: Scope, slotKey: number, domParent: Node, comp: ComponentBody | string | typeof Fragment, config: any, invocationSite?: string, anchor?: Node | null): void;
|
|
3102
3104
|
/**
|
|
3103
3105
|
* Render a dynamically selected compiled component under the current owner.
|
|
3104
3106
|
* Use an ordinary dynamic JSX tag when the body can return a renderable.
|
package/dist/runtime.js
CHANGED
|
@@ -9745,14 +9745,25 @@ function createCompiledContext(defaultValue) {
|
|
|
9745
9745
|
function CompiledContext(props, scope) {
|
|
9746
9746
|
provideContext(scope, props.context, props.value);
|
|
9747
9747
|
const children = props.children;
|
|
9748
|
-
if (children == null)
|
|
9748
|
+
if (children == null) {
|
|
9749
|
+
const previous2 = scope.hooks?.get(CHILDREN_DIALECT_SLOT);
|
|
9750
|
+
if (previous2 !== void 0 && previous2 !== 2) {
|
|
9751
|
+
resetScopeChildren(scope);
|
|
9752
|
+
if (scope.block.disposed) return;
|
|
9753
|
+
ensureHooks(scope).set(CHILDREN_DIALECT_SLOT, 2);
|
|
9754
|
+
}
|
|
9755
|
+
return;
|
|
9756
|
+
}
|
|
9749
9757
|
if (!isChildrenBlock(children)) {
|
|
9750
9758
|
throw new TypeError(formatClientError(345));
|
|
9751
9759
|
}
|
|
9752
9760
|
const dialect = children[CHILDREN_BODY] ?? children;
|
|
9753
9761
|
const previous = scope.hooks?.get(CHILDREN_DIALECT_SLOT);
|
|
9754
9762
|
if (previous !== dialect) {
|
|
9755
|
-
if (previous
|
|
9763
|
+
if (previous === 2) {
|
|
9764
|
+
resetScopeChildren(scope);
|
|
9765
|
+
if (scope.block.disposed) return;
|
|
9766
|
+
} else if (previous !== void 0) {
|
|
9756
9767
|
invalidateSharedBodyOutput(scope);
|
|
9757
9768
|
if (TRANSITION_JOURNAL !== null && !ROOT_RENDER_ROLLBACK) {
|
|
9758
9769
|
const hooks = scope.hooks;
|
|
@@ -9783,7 +9794,7 @@ function renderClientContextProvider(context, props, renderScope) {
|
|
|
9783
9794
|
const scope = renderScope;
|
|
9784
9795
|
provideContext(scope, ctx, props.value);
|
|
9785
9796
|
const children = props.children;
|
|
9786
|
-
if (children != null) {
|
|
9797
|
+
if (children != null || scope.hooks?.get(CHILDREN_DIALECT_SLOT) !== void 0) {
|
|
9787
9798
|
const dialect = typeof children === "function" ? children[CHILDREN_BODY] ?? children : 2;
|
|
9788
9799
|
const previous = scope.hooks?.get(CHILDREN_DIALECT_SLOT);
|
|
9789
9800
|
if (previous !== dialect) {
|
|
@@ -21633,6 +21644,31 @@ function componentSlotVoid(parentScope, slotKey, domParent, comp, props, invocat
|
|
|
21633
21644
|
invocationSite
|
|
21634
21645
|
);
|
|
21635
21646
|
}
|
|
21647
|
+
function componentSlotFromConfig(parentScope, slotKey, domParent, comp, config, invocationSite, anchor) {
|
|
21648
|
+
if (typeof comp === "function" && isRendererContext(comp)) {
|
|
21649
|
+
registerClientRendererBridge(renderClientContextProvider, flushSync);
|
|
21650
|
+
}
|
|
21651
|
+
const key = hasElementConfigKey(config) ? "" + config.key : void 0;
|
|
21652
|
+
const props = copyElementConfig(config);
|
|
21653
|
+
applyElementDefaultProps(comp, props);
|
|
21654
|
+
const body = comp === Fragment ? props.ref != null || hasOwnProp.call(props, "ref") ? renderFragmentRefDescriptor : renderFragmentConfig : comp;
|
|
21655
|
+
componentSlot(
|
|
21656
|
+
parentScope,
|
|
21657
|
+
slotKey,
|
|
21658
|
+
domParent,
|
|
21659
|
+
body,
|
|
21660
|
+
props,
|
|
21661
|
+
invocationSite,
|
|
21662
|
+
anchor,
|
|
21663
|
+
false,
|
|
21664
|
+
false,
|
|
21665
|
+
key,
|
|
21666
|
+
true
|
|
21667
|
+
);
|
|
21668
|
+
}
|
|
21669
|
+
function renderFragmentConfig(props) {
|
|
21670
|
+
return props.children;
|
|
21671
|
+
}
|
|
21636
21672
|
function rejectCompiledReturn(_block, _out, reset) {
|
|
21637
21673
|
if (reset !== true) {
|
|
21638
21674
|
throw new TypeError(formatClientError(346));
|
|
@@ -21787,7 +21823,7 @@ function componentSlotImpl(outputHandler, parentScope, slotKey, domParent, body,
|
|
|
21787
21823
|
registerSlot(parentScope, state);
|
|
21788
21824
|
}
|
|
21789
21825
|
const nextKey = key === void 0 ? NO_KEY : "" + key;
|
|
21790
|
-
const keyChanged =
|
|
21826
|
+
const keyChanged = nextKey !== state.prevKey;
|
|
21791
21827
|
const replacing = identity !== state.currentComp || keyChanged;
|
|
21792
21828
|
const journaledSlot = ROOT_RENDER_TRANSACTION !== null && state.block !== null && replacing;
|
|
21793
21829
|
if (journaledSlot) {
|
|
@@ -32553,6 +32589,7 @@ export {
|
|
|
32553
32589
|
compilerOpaqueTag,
|
|
32554
32590
|
compilerOwnsContextProvider,
|
|
32555
32591
|
componentSlot,
|
|
32592
|
+
componentSlotFromConfig,
|
|
32556
32593
|
componentSlotLite,
|
|
32557
32594
|
componentSlotVoid,
|
|
32558
32595
|
createCompiledContext,
|
package/dist/runtime.server.d.ts
CHANGED
|
@@ -436,6 +436,8 @@ interface ServerOpaqueSignalKeys {
|
|
|
436
436
|
export declare function ssrComponent(parent: SSRScope, comp: ServerComponent | string | typeof Activity, props: any, inherit?: boolean, key?: unknown, identityScoped?: boolean | 'key', invocationSite?: string, bindingMarker?: string, compiledOnly?: true): string;
|
|
437
437
|
/** Compiler ABI for a component call whose output is parsed in foreign content. */
|
|
438
438
|
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;
|
|
439
|
+
/** Server counterpart of componentSlotFromConfig's ordered config boundary. */
|
|
440
|
+
export declare function ssrComponentFromConfig(parent: SSRScope, comp: ServerComponent | string | typeof Fragment | typeof Activity, config: any, invocationSite: string, namespace?: 'html' | 'svg' | 'mathml' | null): string;
|
|
439
441
|
/** Run a renderable hole under a lexically proven parser namespace. */
|
|
440
442
|
export declare function ssrInNamespace(namespace: 'html' | 'svg' | 'mathml', render: () => string): string;
|
|
441
443
|
export declare const Hydrate: ServerComponent;
|
package/dist/runtime.server.js
CHANGED
|
@@ -1374,34 +1374,16 @@ function ssrTextPre(v) {
|
|
|
1374
1374
|
const s = ssrText(v);
|
|
1375
1375
|
return s.charCodeAt(0) === 10 ? "\n" + s : s;
|
|
1376
1376
|
}
|
|
1377
|
-
function
|
|
1378
|
-
if (SCOPED_ELEMENT_PROPS.has(d.props))
|
|
1379
|
-
return ssrComponent(
|
|
1380
|
-
scope,
|
|
1381
|
-
d.type,
|
|
1382
|
-
d.props,
|
|
1383
|
-
void 0,
|
|
1384
|
-
d.key ?? void 0,
|
|
1385
|
-
keyScoped,
|
|
1386
|
-
d.__octaneInvocationSite
|
|
1387
|
-
);
|
|
1388
|
-
}
|
|
1377
|
+
function descriptorProps(d) {
|
|
1378
|
+
if (SCOPED_ELEMENT_PROPS.has(d.props)) return d.props;
|
|
1389
1379
|
const children = d.children;
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
d.type,
|
|
1394
|
-
d.props,
|
|
1395
|
-
void 0,
|
|
1396
|
-
d.key ?? void 0,
|
|
1397
|
-
keyScoped,
|
|
1398
|
-
d.__octaneInvocationSite
|
|
1399
|
-
);
|
|
1400
|
-
}
|
|
1380
|
+
return children == null || children === d.props?.children ? d.props : { ...d.props, children };
|
|
1381
|
+
}
|
|
1382
|
+
function ssrComponentDescriptor(d, scope, keyScoped) {
|
|
1401
1383
|
return ssrComponent(
|
|
1402
1384
|
scope,
|
|
1403
1385
|
d.type,
|
|
1404
|
-
|
|
1386
|
+
descriptorProps(d),
|
|
1405
1387
|
void 0,
|
|
1406
1388
|
d.key ?? void 0,
|
|
1407
1389
|
keyScoped,
|
|
@@ -3394,6 +3376,16 @@ function ssrComponentNS(parent, comp, props, namespace, inherit, key, invocation
|
|
|
3394
3376
|
NEXT_COMPONENT_NAMESPACE = previous;
|
|
3395
3377
|
}
|
|
3396
3378
|
}
|
|
3379
|
+
function ssrComponentFromConfig(parent, comp, config, invocationSite, namespace = null) {
|
|
3380
|
+
const key = hasElementConfigKey(config) ? "" + config.key : void 0;
|
|
3381
|
+
const props = copyElementConfig(config);
|
|
3382
|
+
applyElementDefaultProps(comp, props);
|
|
3383
|
+
const body = comp === Fragment ? props.ref != null || hasOwnProp.call(props, "ref") ? renderFragmentRefDescriptor : renderFragmentConfig : comp;
|
|
3384
|
+
return namespace === null ? ssrComponent(parent, body, props, false, key, void 0, invocationSite) : ssrComponentNS(parent, body, props, namespace, false, key, invocationSite);
|
|
3385
|
+
}
|
|
3386
|
+
function renderFragmentConfig(props, scope) {
|
|
3387
|
+
return ssrHtml(ssrChild(props.children, scope));
|
|
3388
|
+
}
|
|
3397
3389
|
function ssrInNamespace(namespace, render) {
|
|
3398
3390
|
const frame = FRAME;
|
|
3399
3391
|
if (frame === null) return render();
|
|
@@ -5209,6 +5201,10 @@ function spliceHead(body, head, documentRoot = isDocumentRoot(body)) {
|
|
|
5209
5201
|
function renderEntryValue(props, scope) {
|
|
5210
5202
|
return ssrHtml(ssrChild(props.value, scope));
|
|
5211
5203
|
}
|
|
5204
|
+
function renderEntry(entry, props, options) {
|
|
5205
|
+
if (typeof entry === "function") return [entry, props, options];
|
|
5206
|
+
return isElementDescriptor(entry) && typeof entry.type === "function" ? [entry.type, descriptorProps(entry), options ?? props] : [renderEntryValue, { value: entry }, options ?? props];
|
|
5207
|
+
}
|
|
5212
5208
|
const MAX_SUSPENSE_PASSES = 50;
|
|
5213
5209
|
let SUSPENSE_TIMEOUT_MS = 1e4;
|
|
5214
5210
|
function setSsrSuspenseTimeout(ms) {
|
|
@@ -6062,11 +6058,8 @@ function insertBufferedInjection(pass, injection) {
|
|
|
6062
6058
|
pass.body = tailStart === -1 ? pass.body + injection : pass.body.slice(0, tailStart) + injection + pass.body.slice(tailStart);
|
|
6063
6059
|
}
|
|
6064
6060
|
async function prerender(entryComponent, props, options) {
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
options ??= props;
|
|
6068
|
-
props = { value: entryComponent };
|
|
6069
|
-
}
|
|
6061
|
+
let component;
|
|
6062
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
6070
6063
|
const preparedOptions = needsAutomaticSignalInjection(options) ? await prepareAutomaticSignalInjection(options) : options;
|
|
6071
6064
|
const injection = preparedOptions?.injection;
|
|
6072
6065
|
const cancelRender = injection === void 0 ? void 0 : new AbortController();
|
|
@@ -6197,11 +6190,8 @@ function renderHostedAttempt(session, component, props, options) {
|
|
|
6197
6190
|
return { status: "complete", html: body, head: pass.head, cssEntries: pass.cssEntries };
|
|
6198
6191
|
}
|
|
6199
6192
|
function renderToString(entryComponent, props, options) {
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
options ??= props;
|
|
6203
|
-
props = { value: entryComponent };
|
|
6204
|
-
}
|
|
6193
|
+
let component;
|
|
6194
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
6205
6195
|
options?.signal?.throwIfAborted();
|
|
6206
6196
|
const nonceAttr = nonceAttrOf(options);
|
|
6207
6197
|
const resolved = newResolvedMap(options ?? null);
|
|
@@ -6227,11 +6217,8 @@ function renderToString(entryComponent, props, options) {
|
|
|
6227
6217
|
);
|
|
6228
6218
|
}
|
|
6229
6219
|
function renderToStaticMarkup(entryComponent, props, options) {
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
options ??= props;
|
|
6233
|
-
props = { value: entryComponent };
|
|
6234
|
-
}
|
|
6220
|
+
let component;
|
|
6221
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
6235
6222
|
options?.signal?.throwIfAborted();
|
|
6236
6223
|
const nonceAttr = nonceAttrOf(options);
|
|
6237
6224
|
const resolved = newResolvedMap(options ?? null);
|
|
@@ -7579,11 +7566,8 @@ async function runStream(component, props, options, sink, resolved, cancelInject
|
|
|
7579
7566
|
sink.allReady();
|
|
7580
7567
|
}
|
|
7581
7568
|
function renderToPipeableStream(entryComponent, props, options) {
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
options ??= props;
|
|
7585
|
-
props = { value: entryComponent };
|
|
7586
|
-
}
|
|
7569
|
+
let component;
|
|
7570
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
7587
7571
|
const controller = new AbortController();
|
|
7588
7572
|
let removeOuterAbort;
|
|
7589
7573
|
if (options?.signal) {
|
|
@@ -7827,11 +7811,8 @@ function renderToPipeableStream(entryComponent, props, options) {
|
|
|
7827
7811
|
};
|
|
7828
7812
|
}
|
|
7829
7813
|
function renderToReadableStream(entryComponent, props, options) {
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
options ??= props;
|
|
7833
|
-
props = { value: entryComponent };
|
|
7834
|
-
}
|
|
7814
|
+
let component;
|
|
7815
|
+
[component, props, options] = renderEntry(entryComponent, props, options);
|
|
7835
7816
|
if (needsAutomaticSignalInjection(options)) {
|
|
7836
7817
|
return prepareAutomaticSignalInjection(options).then(
|
|
7837
7818
|
(prepared) => renderToReadableStream(component, props, prepared)
|
|
@@ -8422,6 +8403,7 @@ export {
|
|
|
8422
8403
|
ssrChildrenSources,
|
|
8423
8404
|
ssrClass,
|
|
8424
8405
|
ssrComponent,
|
|
8406
|
+
ssrComponentFromConfig,
|
|
8425
8407
|
ssrComponentNS,
|
|
8426
8408
|
ssrControl,
|
|
8427
8409
|
ssrElement,
|
package/dist/server/index.d.ts
CHANGED
|
@@ -37,4 +37,4 @@ export { version } from '../version.js';
|
|
|
37
37
|
export { StrictMode, unstable_batchedUpdates } from '../compatibility.js';
|
|
38
38
|
export { createSubSlot, subSlot, type SubSlot, type SlotlessSubSlot, type SubSlotOptions, } from '../sub-slot.js';
|
|
39
39
|
export { __methodDep } from '../method-dep.js';
|
|
40
|
-
export { renderToString, renderToStaticMarkup, renderToPipeableStream, renderToReadableStream, type RenderResult, type NativeSignalManifest, type NativeSignalReference, type RenderOptions, type ServerRenderNode, type ShellWitness, type StreamOptions, type StreamInjectionSource, setSsrSuspenseTimeout, getSsrSuspenseTimeout, EXTERNAL_HYDRATION_PROMISE, HYDRATION_RANGE_BOUNDARY, useState, useLinkedState, useReducer, __useStateWithGetter, __useLinkedStateWithGetter, __useReducerWithGetter, type LinkedStatePrevious, type LinkedStateOptions, useEffect, useLayoutEffect, useLayoutSnapshot, useInsertionEffect, useImperativeHandle, useMemo, useCallback, useRef, useLazyRef, useId, useEffectEvent, useTransition, useDeferredValue, useSyncExternalStore, useActionState, useActionState as useFormState, useFormStatus, useOptimistic, useDebugValue, memo, lazy, hookSlots, withSlot, manualHook, invokeManualHook, startTransition, flushSync, isChildrenBlock, isValidElement, cloneElement, Children, createPortal, requestFormReset, preload, preinit, preloadModule, preinitModule, preconnect, prefetchDNS, Suspense, ErrorBoundary, Hydrate, Fragment, Activity, Activity as unstable_Activity, ViewTransition, ViewTransition as unstable_ViewTransition, addTransitionType, addTransitionType as unstable_addTransitionType, createContext, createCompiledContext, CompiledContext, CompiledOutlet, use, useContext, ssrIsSuspense, type Context, type FormStatus, markChildrenBlock, markWarm, ssrHtml, ssrChildTextPre, ssrTextareaText, ssrChildPre, descriptorChildren, createElement, createScopedValue, createScopedElement, positionalChildren, escapeHtml, escapeAttr, ssrText, ssrTextPre, ssrTextSlot, ssrNestingText, ssrChild, ssrChildText, ssrAttr, normalizeClass, ssrStyle, ssrClass, ssrAttrs, ssrSignalValue, ssrSignalControlValue, ssrSignalControlAttrs, ssrSnapshotSpread, enableServerSignalBindings, ssrSpread, ssrInnerHtml, ssrScriptInnerHtml, ssrChildrenSources, ssrSpreadContent, ssrVoidContent, ssrValueAttr, ssrCheckedAttr, ssrInputAttrs, ssrFormAuthoringDiagnostics, ssrTextareaValue, ssrTextareaValueSources, ssrSelectAttrs, ssrSelectScope, ssrSelectScopeSources, ssrOptionValueSources, ssrOption, ssrElement, ssrComponent, ssrComponentNS, ssrInNamespace, ssrBlock, ssrFragmentMarker, ssrActivity, ssrForBlock, mapSlot, ssrControl, ssrArm, ssrForItem, ssrTry, ssrPortal, injectStyle, ssrHeadEl, styleMap, touchStyleMap, ssrStylesheetResource, ssrStyleResource, ssrScriptResource, namespaceHead, namespaceHeadElement, puMemo, puBatch, warmMemo, warmChild, } from '../runtime.server.js';
|
|
40
|
+
export { renderToString, renderToStaticMarkup, renderToPipeableStream, renderToReadableStream, type RenderResult, type NativeSignalManifest, type NativeSignalReference, type RenderOptions, type ServerRenderNode, type ShellWitness, type StreamOptions, type StreamInjectionSource, setSsrSuspenseTimeout, getSsrSuspenseTimeout, EXTERNAL_HYDRATION_PROMISE, HYDRATION_RANGE_BOUNDARY, useState, useLinkedState, useReducer, __useStateWithGetter, __useLinkedStateWithGetter, __useReducerWithGetter, type LinkedStatePrevious, type LinkedStateOptions, useEffect, useLayoutEffect, useLayoutSnapshot, useInsertionEffect, useImperativeHandle, useMemo, useCallback, useRef, useLazyRef, useId, useEffectEvent, useTransition, useDeferredValue, useSyncExternalStore, useActionState, useActionState as useFormState, useFormStatus, useOptimistic, useDebugValue, memo, lazy, hookSlots, withSlot, manualHook, invokeManualHook, startTransition, flushSync, isChildrenBlock, isValidElement, cloneElement, Children, createPortal, requestFormReset, preload, preinit, preloadModule, preinitModule, preconnect, prefetchDNS, Suspense, ErrorBoundary, Hydrate, Fragment, Activity, Activity as unstable_Activity, ViewTransition, ViewTransition as unstable_ViewTransition, addTransitionType, addTransitionType as unstable_addTransitionType, createContext, createCompiledContext, CompiledContext, CompiledOutlet, use, useContext, ssrIsSuspense, type Context, type FormStatus, markChildrenBlock, markWarm, ssrHtml, ssrChildTextPre, ssrTextareaText, ssrChildPre, descriptorChildren, createElement, createScopedValue, createScopedElement, positionalChildren, escapeHtml, escapeAttr, ssrText, ssrTextPre, ssrTextSlot, ssrNestingText, ssrChild, ssrChildText, ssrAttr, normalizeClass, ssrStyle, ssrClass, ssrAttrs, ssrSignalValue, ssrSignalControlValue, ssrSignalControlAttrs, ssrSnapshotSpread, enableServerSignalBindings, ssrSpread, ssrInnerHtml, ssrScriptInnerHtml, ssrChildrenSources, ssrSpreadContent, ssrVoidContent, ssrValueAttr, ssrCheckedAttr, ssrInputAttrs, ssrFormAuthoringDiagnostics, ssrTextareaValue, ssrTextareaValueSources, ssrSelectAttrs, ssrSelectScope, ssrSelectScopeSources, ssrOptionValueSources, ssrOption, ssrElement, ssrComponent, ssrComponentNS, ssrComponentFromConfig, ssrInNamespace, ssrBlock, ssrFragmentMarker, ssrActivity, ssrForBlock, mapSlot, ssrControl, ssrArm, ssrForItem, ssrTry, ssrPortal, injectStyle, ssrHeadEl, styleMap, touchStyleMap, ssrStylesheetResource, ssrStyleResource, ssrScriptResource, namespaceHead, namespaceHeadElement, puMemo, puBatch, warmMemo, warmChild, } from '../runtime.server.js';
|
package/dist/server/index.js
CHANGED
|
@@ -152,6 +152,7 @@ import {
|
|
|
152
152
|
ssrElement,
|
|
153
153
|
ssrComponent,
|
|
154
154
|
ssrComponentNS,
|
|
155
|
+
ssrComponentFromConfig,
|
|
155
156
|
ssrInNamespace,
|
|
156
157
|
ssrBlock,
|
|
157
158
|
ssrFragmentMarker,
|
|
@@ -267,6 +268,7 @@ export {
|
|
|
267
268
|
ssrChildrenSources,
|
|
268
269
|
ssrClass,
|
|
269
270
|
ssrComponent,
|
|
271
|
+
ssrComponentFromConfig,
|
|
270
272
|
ssrComponentNS,
|
|
271
273
|
ssrControl,
|
|
272
274
|
ssrElement,
|
|
@@ -39,7 +39,8 @@ function serializeScopeRead(root, read) {
|
|
|
39
39
|
const scope = root.owner;
|
|
40
40
|
if (!scope.seedable) return [];
|
|
41
41
|
const rootEntry = scopeSeedEntry(scope, root, read);
|
|
42
|
-
if (!rootEntry)
|
|
42
|
+
if (!rootEntry)
|
|
43
|
+
return read === "snapshot" && root.state?.snapshot.status !== "ready" ? [] : void 0;
|
|
43
44
|
const owners = /* @__PURE__ */ new Map();
|
|
44
45
|
const keys = /* @__PURE__ */ new Map();
|
|
45
46
|
const seen = /* @__PURE__ */ new Set();
|
package/dist/version.js
CHANGED