@solidjs/web 2.0.0-rc.2 → 2.0.0-rc.4
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/dev.cjs +433 -72
- package/dist/dev.js +426 -71
- package/dist/server.cjs +39 -21
- package/dist/server.js +40 -23
- package/dist/web.cjs +421 -70
- package/dist/web.js +414 -69
- package/frames/dist/client.cjs +8 -8
- package/frames/dist/client.dev.cjs +8 -8
- package/frames/dist/client.dev.js +8 -8
- package/frames/dist/client.js +8 -8
- package/frames/dist/server.cjs +28 -18
- package/frames/dist/server.js +29 -19
- package/package.json +20 -22
- package/serialization/dist/decode.cjs +3 -3
- package/serialization/dist/decode.js +3 -3
- package/serialization/dist/serialization.cjs +7 -11
- package/serialization/dist/serialization.js +7 -6
- package/serialization/types/index.d.ts +69 -157
- package/serialization/types/serializer-decode.d.ts +89 -112
- package/serialization/types/serializer.d.ts +94 -0
- package/serialization/types-cjs/index.d.cts +69 -157
- package/serialization/types-cjs/serializer-decode.d.cts +89 -112
- package/serialization/types-cjs/serializer.d.cts +94 -0
- package/server-functions/dist/client.cjs +126 -19
- package/server-functions/dist/client.js +123 -19
- package/server-functions/dist/server.cjs +156 -28
- package/server-functions/dist/server.dev.cjs +156 -28
- package/server-functions/dist/server.dev.js +153 -28
- package/server-functions/dist/server.js +153 -28
- package/types/client.d.ts +152 -290
- package/types/constants.d.ts +18 -0
- package/types/cookies.d.ts +31 -75
- package/types/frames/frame-client.d.ts +287 -277
- package/types/frames/frame-container-plugin.d.ts +71 -0
- package/types/frames/frame-sink.d.ts +58 -160
- package/types/frames/frame-transport.d.ts +161 -194
- package/types/frames/serializer-decode.d.ts +159 -0
- package/types/frames/serializer.d.ts +69 -157
- package/types/head.d.ts +16 -0
- package/types/index.d.ts +1 -65
- package/types/index.server.d.ts +125 -0
- package/types/jsx.d.ts +5 -13
- package/types/patch-driver.d.ts +3 -0
- package/types/reconcile.d.ts +1 -0
- package/types/render.d.ts +4 -0
- package/types/response.d.ts +48 -152
- package/types/serializer-decode.d.ts +89 -112
- package/types/serializer.d.ts +69 -157
- package/types/server-functions/client.d.ts +124 -222
- package/types/server-functions/flash.d.ts +10 -30
- package/types/server-functions/registry.d.ts +100 -0
- package/types/server-functions/rich-args.d.ts +1 -10
- package/types/server-functions/server.d.ts +295 -574
- package/types/server-functions/shared.d.ts +155 -458
- package/types/server-mock.d.ts +2 -2
- package/types/server.d.ts +242 -434
- package/types-cjs/client.d.cts +152 -290
- package/types-cjs/constants.d.cts +18 -0
- package/types-cjs/cookies.d.cts +31 -75
- package/types-cjs/frames/frame-client.d.cts +287 -277
- package/types-cjs/frames/frame-container-plugin.d.cts +71 -0
- package/types-cjs/frames/frame-sink.d.cts +58 -160
- package/types-cjs/frames/frame-transport.d.cts +161 -194
- package/types-cjs/frames/serializer-decode.d.cts +159 -0
- package/types-cjs/frames/serializer.d.cts +69 -157
- package/types-cjs/head.d.cts +16 -0
- package/types-cjs/index.d.cts +1 -65
- package/types-cjs/index.server.d.cts +125 -0
- package/types-cjs/jsx.d.cts +5 -13
- package/types-cjs/patch-driver.d.cts +3 -0
- package/types-cjs/reconcile.d.cts +1 -0
- package/types-cjs/render.d.cts +4 -0
- package/types-cjs/response.d.cts +48 -152
- package/types-cjs/serializer-decode.d.cts +89 -112
- package/types-cjs/serializer.d.cts +69 -157
- package/types-cjs/server-functions/client.d.cts +124 -222
- package/types-cjs/server-functions/flash.d.cts +10 -30
- package/types-cjs/server-functions/registry.d.cts +100 -0
- package/types-cjs/server-functions/rich-args.d.cts +1 -10
- package/types-cjs/server-functions/server.d.cts +295 -574
- package/types-cjs/server-functions/shared.d.cts +155 -458
- package/types-cjs/server-mock.d.cts +2 -2
- package/types-cjs/server.d.cts +242 -434
- package/LICENSE +0 -21
- package/types/core.d.ts +0 -9
- package/types-cjs/core.d.cts +0 -9
package/dist/server.cjs
CHANGED
|
@@ -57,14 +57,18 @@ const transparentOptions = {
|
|
|
57
57
|
const syncOptions = {
|
|
58
58
|
sync: true
|
|
59
59
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
function effect(fn, effectFn, options) {
|
|
61
|
+
solidJs.createRenderEffect(fn, effectFn, options ? {
|
|
62
|
+
sync: true,
|
|
63
|
+
...options,
|
|
64
|
+
transparent: !options.scope
|
|
65
|
+
} : transparentOptions);
|
|
66
|
+
}
|
|
67
|
+
function memo(fn) {
|
|
68
|
+
return solidJs.createMemo(() => fn(), syncOptions);
|
|
69
|
+
}
|
|
66
70
|
|
|
67
|
-
const STATE = Symbol.for("
|
|
71
|
+
const STATE = Symbol.for("solid.container-trace-state");
|
|
68
72
|
const state = globalThis[STATE] || (globalThis[STATE] = {
|
|
69
73
|
materialized: new WeakMap(),
|
|
70
74
|
materializedValues: new WeakSet()
|
|
@@ -75,7 +79,7 @@ function setContainerTraceResolver(fn) {
|
|
|
75
79
|
function setContainerTraceStreamMint(fn) {
|
|
76
80
|
state.streamOf = fn;
|
|
77
81
|
}
|
|
78
|
-
const TRACE = Symbol.for("
|
|
82
|
+
const TRACE = Symbol.for("solid.container-trace");
|
|
79
83
|
function materialize(marker) {
|
|
80
84
|
let value = state.materialized.get(marker.$tr);
|
|
81
85
|
if (value === undefined) {
|
|
@@ -94,7 +98,7 @@ function parseTrace(value, ctx) {
|
|
|
94
98
|
};
|
|
95
99
|
}
|
|
96
100
|
const ContainerTracePlugin = {
|
|
97
|
-
tag: "
|
|
101
|
+
tag: "solid/container-trace",
|
|
98
102
|
test(value) {
|
|
99
103
|
return value != null && typeof value === "object" && TRACE in value;
|
|
100
104
|
},
|
|
@@ -210,11 +214,14 @@ function isSafeError(value) {
|
|
|
210
214
|
return !!(value && (typeof value === "object" || typeof value === "function") && value[SAFE_ERROR]);
|
|
211
215
|
}
|
|
212
216
|
const REVALIDATE_HEADER = "X-Revalidate";
|
|
213
|
-
function initWithRevalidate(init) {
|
|
217
|
+
function initWithRevalidate(init = {}) {
|
|
218
|
+
const resolved = typeof init === "number" ? {
|
|
219
|
+
status: init
|
|
220
|
+
} : init;
|
|
214
221
|
const {
|
|
215
222
|
revalidate,
|
|
216
223
|
...responseInit
|
|
217
|
-
} =
|
|
224
|
+
} = resolved;
|
|
218
225
|
let headers;
|
|
219
226
|
if (responseInit.headers && responseInit.headers.getSetCookie) {
|
|
220
227
|
headers = new Headers();
|
|
@@ -240,13 +247,12 @@ function redirect(url, init = 302) {
|
|
|
240
247
|
const {
|
|
241
248
|
responseInit,
|
|
242
249
|
headers
|
|
243
|
-
} = initWithRevalidate(
|
|
244
|
-
status: init
|
|
245
|
-
} : init);
|
|
250
|
+
} = initWithRevalidate(init);
|
|
246
251
|
if (responseInit.status === undefined) {
|
|
247
252
|
responseInit.status = 302;
|
|
248
253
|
}
|
|
249
|
-
|
|
254
|
+
const target = typeof url === "string" ? url : url[HREF];
|
|
255
|
+
headers.set("Location", typeof target === "string" ? target : String(url));
|
|
250
256
|
return new Response(null, {
|
|
251
257
|
...responseInit,
|
|
252
258
|
headers
|
|
@@ -1877,6 +1883,15 @@ function createLiveHoles(sink, scoped) {
|
|
|
1877
1883
|
const stamp = typeof solidJs.creationStamp === "function" ? solidJs.creationStamp : () => 0;
|
|
1878
1884
|
const inScope = scoped && typeof solidJs.inServerComponentScope === "function" ? solidJs.inServerComponentScope : null;
|
|
1879
1885
|
const stripMarkers = html => html.replace(/<!--lh:\/?\d+-->/g, "");
|
|
1886
|
+
const swept = (owner, ctx, fn) => {
|
|
1887
|
+
const prev = solidJs.sharedConfig.context;
|
|
1888
|
+
solidJs.sharedConfig.context = ctx;
|
|
1889
|
+
try {
|
|
1890
|
+
return owner ? solidJs.runWithOwner(owner, fn) : fn();
|
|
1891
|
+
} finally {
|
|
1892
|
+
solidJs.sharedConfig.context = prev;
|
|
1893
|
+
}
|
|
1894
|
+
};
|
|
1880
1895
|
function resolveHoleValue(hole) {
|
|
1881
1896
|
const result = {
|
|
1882
1897
|
t: [""],
|
|
@@ -1942,6 +1957,7 @@ function createLiveHoles(sink, scoped) {
|
|
|
1942
1957
|
const recordsBefore = engine.recordStamp;
|
|
1943
1958
|
const ownersBefore = stamp();
|
|
1944
1959
|
const owner = solidJs.getOwner();
|
|
1960
|
+
const holeCtx = solidJs.sharedConfig.context;
|
|
1945
1961
|
const b = {
|
|
1946
1962
|
key: null,
|
|
1947
1963
|
children: [],
|
|
@@ -1955,7 +1971,7 @@ function createLiveHoles(sink, scoped) {
|
|
|
1955
1971
|
const sweepOwnersBefore = stamp();
|
|
1956
1972
|
let res;
|
|
1957
1973
|
try {
|
|
1958
|
-
res =
|
|
1974
|
+
res = swept(owner, holeCtx, () => resolveHoleValue(hole));
|
|
1959
1975
|
} catch (err) {
|
|
1960
1976
|
b.closed = true;
|
|
1961
1977
|
sink.closeBinding(b.key);
|
|
@@ -2063,6 +2079,7 @@ function createLiveHoles(sink, scoped) {
|
|
|
2063
2079
|
},
|
|
2064
2080
|
attr(cap) {
|
|
2065
2081
|
const owner = solidJs.getOwner();
|
|
2082
|
+
const holeCtx = solidJs.sharedConfig.context;
|
|
2066
2083
|
const b = {
|
|
2067
2084
|
key: "lha:" + cap.id,
|
|
2068
2085
|
children: [],
|
|
@@ -2098,7 +2115,7 @@ function createLiveHoles(sink, scoped) {
|
|
|
2098
2115
|
if (vt === "string" || vt === "number") html += v;
|
|
2099
2116
|
}
|
|
2100
2117
|
};
|
|
2101
|
-
|
|
2118
|
+
swept(owner, holeCtx, run);
|
|
2102
2119
|
} catch (err) {
|
|
2103
2120
|
if (solidJs.ssrHandleError(err, true)) return;
|
|
2104
2121
|
b.closed = true;
|
|
@@ -2434,7 +2451,7 @@ function ssrHydrationKey() {
|
|
|
2434
2451
|
const hk = getHydrationKey();
|
|
2435
2452
|
return hk ? ` _hk=${hk}` : "";
|
|
2436
2453
|
}
|
|
2437
|
-
const CLAIM_PROP = /*#__PURE__*/Symbol.for("
|
|
2454
|
+
const CLAIM_PROP = /*#__PURE__*/Symbol.for("solid.claim-prop");
|
|
2438
2455
|
const CLAIMS_STREAM = 1;
|
|
2439
2456
|
const CLAIMS_DOCUMENT = 2;
|
|
2440
2457
|
const CLAIM_UNSAFE = /[^A-Za-z0-9_.!~*'()-]/g;
|
|
@@ -2463,7 +2480,7 @@ function ssrClaim(map) {
|
|
|
2463
2480
|
function decodeSSREntities(s) {
|
|
2464
2481
|
return s.indexOf("&") < 0 ? s : s.replace(/"/g, '"').replace(/</g, "<").replace(/&/g, "&");
|
|
2465
2482
|
}
|
|
2466
|
-
const SELECT_VALUE_ATTR = /\svalue
|
|
2483
|
+
const SELECT_VALUE_ATTR = /\svalue(?:="([^"]*)")?(?=[\s>]|$)/;
|
|
2467
2484
|
function tagEnd(html, i) {
|
|
2468
2485
|
for (let j = i + 1; j < html.length; j++) {
|
|
2469
2486
|
const c = html.charCodeAt(j);
|
|
@@ -2515,7 +2532,7 @@ function resolveSSRSelectValues(html) {
|
|
|
2515
2532
|
cand = html.indexOf("<select", e0 + 1);
|
|
2516
2533
|
continue;
|
|
2517
2534
|
}
|
|
2518
|
-
const bound = decodeSSREntities(m[1]);
|
|
2535
|
+
const bound = decodeSSREntities(m[1] ?? "");
|
|
2519
2536
|
const sel = {
|
|
2520
2537
|
values: /\smultiple(?=[\s>=])/.test(open) ? bound.split(",") : [bound],
|
|
2521
2538
|
strip: cand + m.index,
|
|
@@ -2552,7 +2569,7 @@ function resolveSSRSelectValues(html) {
|
|
|
2552
2569
|
const attrs = html.slice(i + 7, e);
|
|
2553
2570
|
if (/\sselected(?=[\s=]|$)/.test(attrs)) sel.defaulted = true;else {
|
|
2554
2571
|
const vm = SELECT_VALUE_ATTR.exec(attrs);
|
|
2555
|
-
const value = vm ? decodeSSREntities(vm[1]) : decodeSSREntities(optionText(html, e + 1)).replace(/\s+/g, " ").trim();
|
|
2572
|
+
const value = vm ? decodeSSREntities(vm[1] ?? "") : decodeSSREntities(optionText(html, e + 1)).replace(/\s+/g, " ").trim();
|
|
2556
2573
|
if (sel.values.includes(value)) sel.marks.push(e);
|
|
2557
2574
|
}
|
|
2558
2575
|
}
|
|
@@ -3451,6 +3468,7 @@ exports.reload = reload;
|
|
|
3451
3468
|
exports.render = notSup;
|
|
3452
3469
|
exports.renderToStream = renderToStream;
|
|
3453
3470
|
exports.renderToString = renderToString;
|
|
3471
|
+
exports.resolveSSRNode = resolveSSRNode;
|
|
3454
3472
|
exports.resolveSSRSelectValues = resolveSSRSelectValues;
|
|
3455
3473
|
exports.respond = respond;
|
|
3456
3474
|
exports.runHydrationEvents = notSup;
|
package/dist/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRenderEffect, createMemo, sharedConfig, createRoot, inServerComponentScope, getOwner, ssrHandleError,
|
|
1
|
+
import { createRenderEffect, createMemo, sharedConfig, createRoot, inServerComponentScope, getOwner, ssrHandleError, creationStamp, runWithOwner, createComponent, omit, getNextChildId, onCleanup, getProjectionTrace } from 'solid-js';
|
|
2
2
|
export { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent, getOwner, merge as mergeProps, ssrScope as scope, sharedConfig, untrack } from 'solid-js';
|
|
3
3
|
import { Feature, createStream, Serializer, getCrossReferenceHeader } from 'seroval';
|
|
4
4
|
import { AbortSignalPlugin, CustomEventPlugin, DOMExceptionPlugin, EventPlugin, FormDataPlugin, HeadersPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLSearchParamsPlugin, URLPlugin } from 'seroval-plugins/web';
|
|
@@ -56,14 +56,18 @@ const transparentOptions = {
|
|
|
56
56
|
const syncOptions = {
|
|
57
57
|
sync: true
|
|
58
58
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
function effect(fn, effectFn, options) {
|
|
60
|
+
createRenderEffect(fn, effectFn, options ? {
|
|
61
|
+
sync: true,
|
|
62
|
+
...options,
|
|
63
|
+
transparent: !options.scope
|
|
64
|
+
} : transparentOptions);
|
|
65
|
+
}
|
|
66
|
+
function memo(fn) {
|
|
67
|
+
return createMemo(() => fn(), syncOptions);
|
|
68
|
+
}
|
|
65
69
|
|
|
66
|
-
const STATE = Symbol.for("
|
|
70
|
+
const STATE = Symbol.for("solid.container-trace-state");
|
|
67
71
|
const state = globalThis[STATE] || (globalThis[STATE] = {
|
|
68
72
|
materialized: new WeakMap(),
|
|
69
73
|
materializedValues: new WeakSet()
|
|
@@ -74,7 +78,7 @@ function setContainerTraceResolver(fn) {
|
|
|
74
78
|
function setContainerTraceStreamMint(fn) {
|
|
75
79
|
state.streamOf = fn;
|
|
76
80
|
}
|
|
77
|
-
const TRACE = Symbol.for("
|
|
81
|
+
const TRACE = Symbol.for("solid.container-trace");
|
|
78
82
|
function materialize(marker) {
|
|
79
83
|
let value = state.materialized.get(marker.$tr);
|
|
80
84
|
if (value === undefined) {
|
|
@@ -93,7 +97,7 @@ function parseTrace(value, ctx) {
|
|
|
93
97
|
};
|
|
94
98
|
}
|
|
95
99
|
const ContainerTracePlugin = {
|
|
96
|
-
tag: "
|
|
100
|
+
tag: "solid/container-trace",
|
|
97
101
|
test(value) {
|
|
98
102
|
return value != null && typeof value === "object" && TRACE in value;
|
|
99
103
|
},
|
|
@@ -209,11 +213,14 @@ function isSafeError(value) {
|
|
|
209
213
|
return !!(value && (typeof value === "object" || typeof value === "function") && value[SAFE_ERROR]);
|
|
210
214
|
}
|
|
211
215
|
const REVALIDATE_HEADER = "X-Revalidate";
|
|
212
|
-
function initWithRevalidate(init) {
|
|
216
|
+
function initWithRevalidate(init = {}) {
|
|
217
|
+
const resolved = typeof init === "number" ? {
|
|
218
|
+
status: init
|
|
219
|
+
} : init;
|
|
213
220
|
const {
|
|
214
221
|
revalidate,
|
|
215
222
|
...responseInit
|
|
216
|
-
} =
|
|
223
|
+
} = resolved;
|
|
217
224
|
let headers;
|
|
218
225
|
if (responseInit.headers && responseInit.headers.getSetCookie) {
|
|
219
226
|
headers = new Headers();
|
|
@@ -239,13 +246,12 @@ function redirect(url, init = 302) {
|
|
|
239
246
|
const {
|
|
240
247
|
responseInit,
|
|
241
248
|
headers
|
|
242
|
-
} = initWithRevalidate(
|
|
243
|
-
status: init
|
|
244
|
-
} : init);
|
|
249
|
+
} = initWithRevalidate(init);
|
|
245
250
|
if (responseInit.status === undefined) {
|
|
246
251
|
responseInit.status = 302;
|
|
247
252
|
}
|
|
248
|
-
|
|
253
|
+
const target = typeof url === "string" ? url : url[HREF];
|
|
254
|
+
headers.set("Location", typeof target === "string" ? target : String(url));
|
|
249
255
|
return new Response(null, {
|
|
250
256
|
...responseInit,
|
|
251
257
|
headers
|
|
@@ -1876,6 +1882,15 @@ function createLiveHoles(sink, scoped) {
|
|
|
1876
1882
|
const stamp = typeof creationStamp === "function" ? creationStamp : () => 0;
|
|
1877
1883
|
const inScope = scoped && typeof inServerComponentScope === "function" ? inServerComponentScope : null;
|
|
1878
1884
|
const stripMarkers = html => html.replace(/<!--lh:\/?\d+-->/g, "");
|
|
1885
|
+
const swept = (owner, ctx, fn) => {
|
|
1886
|
+
const prev = sharedConfig.context;
|
|
1887
|
+
sharedConfig.context = ctx;
|
|
1888
|
+
try {
|
|
1889
|
+
return owner ? runWithOwner(owner, fn) : fn();
|
|
1890
|
+
} finally {
|
|
1891
|
+
sharedConfig.context = prev;
|
|
1892
|
+
}
|
|
1893
|
+
};
|
|
1879
1894
|
function resolveHoleValue(hole) {
|
|
1880
1895
|
const result = {
|
|
1881
1896
|
t: [""],
|
|
@@ -1941,6 +1956,7 @@ function createLiveHoles(sink, scoped) {
|
|
|
1941
1956
|
const recordsBefore = engine.recordStamp;
|
|
1942
1957
|
const ownersBefore = stamp();
|
|
1943
1958
|
const owner = getOwner();
|
|
1959
|
+
const holeCtx = sharedConfig.context;
|
|
1944
1960
|
const b = {
|
|
1945
1961
|
key: null,
|
|
1946
1962
|
children: [],
|
|
@@ -1954,7 +1970,7 @@ function createLiveHoles(sink, scoped) {
|
|
|
1954
1970
|
const sweepOwnersBefore = stamp();
|
|
1955
1971
|
let res;
|
|
1956
1972
|
try {
|
|
1957
|
-
res =
|
|
1973
|
+
res = swept(owner, holeCtx, () => resolveHoleValue(hole));
|
|
1958
1974
|
} catch (err) {
|
|
1959
1975
|
b.closed = true;
|
|
1960
1976
|
sink.closeBinding(b.key);
|
|
@@ -2062,6 +2078,7 @@ function createLiveHoles(sink, scoped) {
|
|
|
2062
2078
|
},
|
|
2063
2079
|
attr(cap) {
|
|
2064
2080
|
const owner = getOwner();
|
|
2081
|
+
const holeCtx = sharedConfig.context;
|
|
2065
2082
|
const b = {
|
|
2066
2083
|
key: "lha:" + cap.id,
|
|
2067
2084
|
children: [],
|
|
@@ -2097,7 +2114,7 @@ function createLiveHoles(sink, scoped) {
|
|
|
2097
2114
|
if (vt === "string" || vt === "number") html += v;
|
|
2098
2115
|
}
|
|
2099
2116
|
};
|
|
2100
|
-
|
|
2117
|
+
swept(owner, holeCtx, run);
|
|
2101
2118
|
} catch (err) {
|
|
2102
2119
|
if (ssrHandleError(err, true)) return;
|
|
2103
2120
|
b.closed = true;
|
|
@@ -2433,7 +2450,7 @@ function ssrHydrationKey() {
|
|
|
2433
2450
|
const hk = getHydrationKey();
|
|
2434
2451
|
return hk ? ` _hk=${hk}` : "";
|
|
2435
2452
|
}
|
|
2436
|
-
const CLAIM_PROP = /*#__PURE__*/Symbol.for("
|
|
2453
|
+
const CLAIM_PROP = /*#__PURE__*/Symbol.for("solid.claim-prop");
|
|
2437
2454
|
const CLAIMS_STREAM = 1;
|
|
2438
2455
|
const CLAIMS_DOCUMENT = 2;
|
|
2439
2456
|
const CLAIM_UNSAFE = /[^A-Za-z0-9_.!~*'()-]/g;
|
|
@@ -2462,7 +2479,7 @@ function ssrClaim(map) {
|
|
|
2462
2479
|
function decodeSSREntities(s) {
|
|
2463
2480
|
return s.indexOf("&") < 0 ? s : s.replace(/"/g, '"').replace(/</g, "<").replace(/&/g, "&");
|
|
2464
2481
|
}
|
|
2465
|
-
const SELECT_VALUE_ATTR = /\svalue
|
|
2482
|
+
const SELECT_VALUE_ATTR = /\svalue(?:="([^"]*)")?(?=[\s>]|$)/;
|
|
2466
2483
|
function tagEnd(html, i) {
|
|
2467
2484
|
for (let j = i + 1; j < html.length; j++) {
|
|
2468
2485
|
const c = html.charCodeAt(j);
|
|
@@ -2514,7 +2531,7 @@ function resolveSSRSelectValues(html) {
|
|
|
2514
2531
|
cand = html.indexOf("<select", e0 + 1);
|
|
2515
2532
|
continue;
|
|
2516
2533
|
}
|
|
2517
|
-
const bound = decodeSSREntities(m[1]);
|
|
2534
|
+
const bound = decodeSSREntities(m[1] ?? "");
|
|
2518
2535
|
const sel = {
|
|
2519
2536
|
values: /\smultiple(?=[\s>=])/.test(open) ? bound.split(",") : [bound],
|
|
2520
2537
|
strip: cand + m.index,
|
|
@@ -2551,7 +2568,7 @@ function resolveSSRSelectValues(html) {
|
|
|
2551
2568
|
const attrs = html.slice(i + 7, e);
|
|
2552
2569
|
if (/\sselected(?=[\s=]|$)/.test(attrs)) sel.defaulted = true;else {
|
|
2553
2570
|
const vm = SELECT_VALUE_ATTR.exec(attrs);
|
|
2554
|
-
const value = vm ? decodeSSREntities(vm[1]) : decodeSSREntities(optionText(html, e + 1)).replace(/\s+/g, " ").trim();
|
|
2571
|
+
const value = vm ? decodeSSREntities(vm[1] ?? "") : decodeSSREntities(optionText(html, e + 1)).replace(/\s+/g, " ").trim();
|
|
2555
2572
|
if (sel.values.includes(value)) sel.marks.push(e);
|
|
2556
2573
|
}
|
|
2557
2574
|
}
|
|
@@ -3312,4 +3329,4 @@ function httpHeader(name, value, options) {
|
|
|
3312
3329
|
}
|
|
3313
3330
|
}
|
|
3314
3331
|
|
|
3315
|
-
export { CLAIMS_DOCUMENT, CLAIMS_STREAM, CLAIM_PROP, ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF, HydrationScript, MathMLElements, Namespaces, Portal, REVALIDATE_HEADER, RawTextElements, RequestContext, ResponseEnvelope, SAFE_ERROR, SVGElements, VoidElements, notSup as acquireAsset, notSup as addEvent, applyRef, notSup as assign, claimElement, claimElementTree, notSup as className, clearFlashCookie, clientOnly, commitEventResponse, commitResponseStub, composeMiddleware, createLiveHoles, createRequestEvent, createResponseStub, createSSRResponse, notSup as delegateEvents, dynamic, notSup as dynamicProperty, effect, escape, generateHydrationScript, notSup as getDelegatedRoot, getExpectedRedirectStatus, getHydrationKey, notSup as getNextElement, notSup as getNextMarker, notSup as getNextMatch, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, hasFlashCookie, httpHeader, httpStatus, notSup as hydrate, notSup as insert, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, redirect, notSup as ref, notSup as registerDelegatedContainer, notSup as registerDelegatedRoot, registerElementClaim, reload, notSup as render, renderToStream, renderToString, resolveSSRSelectValues, respond, notSup as runHydrationEvents, scriptNonce, serializeCookie, notSup as setAttribute, notSup as setAttributeNS, notSup as setProperty, notSup as setStyleProperty, notSup as spread, ssr, ssrAttribute, ssrClaim, ssrClassName, ssrElement, ssrGroup, ssrHydrationKey, ssrSelectValues, ssrStyle, ssrStyleProperty, notSup as style, styleNonce, notSup as template, notSup as unregisterDelegatedContainer, notSup as unregisterDelegatedRoot, useHead };
|
|
3332
|
+
export { CLAIMS_DOCUMENT, CLAIMS_STREAM, CLAIM_PROP, ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF, HydrationScript, MathMLElements, Namespaces, Portal, REVALIDATE_HEADER, RawTextElements, RequestContext, ResponseEnvelope, SAFE_ERROR, SVGElements, VoidElements, notSup as acquireAsset, notSup as addEvent, applyRef, notSup as assign, claimElement, claimElementTree, notSup as className, clearFlashCookie, clientOnly, commitEventResponse, commitResponseStub, composeMiddleware, createLiveHoles, createRequestEvent, createResponseStub, createSSRResponse, notSup as delegateEvents, dynamic, notSup as dynamicProperty, effect, escape, generateHydrationScript, notSup as getDelegatedRoot, getExpectedRedirectStatus, getHydrationKey, notSup as getNextElement, notSup as getNextMarker, notSup as getNextMatch, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, hasFlashCookie, httpHeader, httpStatus, notSup as hydrate, notSup as insert, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, redirect, notSup as ref, notSup as registerDelegatedContainer, notSup as registerDelegatedRoot, registerElementClaim, reload, notSup as render, renderToStream, renderToString, resolveSSRNode, resolveSSRSelectValues, respond, notSup as runHydrationEvents, scriptNonce, serializeCookie, notSup as setAttribute, notSup as setAttributeNS, notSup as setProperty, notSup as setStyleProperty, notSup as spread, ssr, ssrAttribute, ssrClaim, ssrClassName, ssrElement, ssrGroup, ssrHydrationKey, ssrSelectValues, ssrStyle, ssrStyleProperty, notSup as style, styleNonce, notSup as template, notSup as unregisterDelegatedContainer, notSup as unregisterDelegatedRoot, useHead };
|