solid-js 1.8.21 → 1.8.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/dev.cjs +6 -4
- package/dist/dev.js +325 -564
- package/dist/server.js +74 -168
- package/dist/solid.cjs +6 -4
- package/dist/solid.js +283 -491
- package/h/dist/h.cjs +1 -1
- package/h/dist/h.js +9 -38
- package/h/jsx-runtime/dist/jsx.js +1 -1
- package/h/jsx-runtime/types/index.d.ts +8 -11
- package/h/jsx-runtime/types/jsx.d.ts +2 -0
- package/h/types/hyperscript.d.ts +11 -11
- package/html/dist/html.js +94 -216
- package/html/types/lit.d.ts +33 -47
- package/package.json +1 -1
- package/store/dist/dev.js +43 -122
- package/store/dist/server.js +8 -19
- package/store/dist/store.js +40 -113
- package/store/types/index.d.ts +7 -21
- package/store/types/modifiers.d.ts +3 -6
- package/store/types/mutable.d.ts +2 -5
- package/store/types/server.d.ts +4 -12
- package/store/types/store.d.ts +61 -218
- package/types/index.d.ts +10 -75
- package/types/jsx.d.ts +8 -18
- package/types/reactive/array.d.ts +4 -12
- package/types/reactive/observable.d.ts +17 -25
- package/types/reactive/scheduler.d.ts +6 -9
- package/types/reactive/signal.d.ts +142 -233
- package/types/render/Suspense.d.ts +5 -5
- package/types/render/component.d.ts +33 -64
- package/types/render/flow.d.ts +31 -43
- package/types/render/hydration.d.ts +15 -15
- package/types/server/index.d.ts +2 -57
- package/types/server/reactive.d.ts +42 -73
- package/types/server/rendering.d.ts +98 -169
- package/universal/dist/dev.js +12 -28
- package/universal/dist/universal.js +12 -28
- package/universal/types/index.d.ts +1 -3
- package/universal/types/universal.d.ts +1 -0
- package/web/dist/dev.js +83 -625
- package/web/dist/server.js +96 -210
- package/web/dist/web.js +81 -616
- package/web/storage/dist/storage.js +3 -3
- package/web/types/client.d.ts +2 -2
- package/web/types/core.d.ts +1 -10
- package/web/types/index.d.ts +10 -27
- package/web/types/server-mock.d.ts +32 -47
package/web/dist/server.js
CHANGED
|
@@ -1,86 +1,30 @@
|
|
|
1
|
-
import { sharedConfig, createRoot, splitProps } from
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Index,
|
|
6
|
-
Match,
|
|
7
|
-
Show,
|
|
8
|
-
Suspense,
|
|
9
|
-
SuspenseList,
|
|
10
|
-
Switch,
|
|
11
|
-
createComponent,
|
|
12
|
-
mergeProps
|
|
13
|
-
} from "solid-js";
|
|
14
|
-
import { Feature, Serializer, getCrossReferenceHeader } from "seroval";
|
|
15
|
-
import {
|
|
16
|
-
CustomEventPlugin,
|
|
17
|
-
DOMExceptionPlugin,
|
|
18
|
-
EventPlugin,
|
|
19
|
-
FormDataPlugin,
|
|
20
|
-
HeadersPlugin,
|
|
21
|
-
ReadableStreamPlugin,
|
|
22
|
-
RequestPlugin,
|
|
23
|
-
ResponsePlugin,
|
|
24
|
-
URLSearchParamsPlugin,
|
|
25
|
-
URLPlugin
|
|
26
|
-
} from "seroval-plugins/web";
|
|
1
|
+
import { sharedConfig, createRoot, splitProps } from 'solid-js';
|
|
2
|
+
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, mergeProps } from 'solid-js';
|
|
3
|
+
import { Feature, Serializer, getCrossReferenceHeader } from 'seroval';
|
|
4
|
+
import { CustomEventPlugin, DOMExceptionPlugin, EventPlugin, FormDataPlugin, HeadersPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLSearchParamsPlugin, URLPlugin } from 'seroval-plugins/web';
|
|
27
5
|
|
|
28
|
-
const booleans = [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"autoplay",
|
|
33
|
-
"checked",
|
|
34
|
-
"controls",
|
|
35
|
-
"default",
|
|
36
|
-
"disabled",
|
|
37
|
-
"formnovalidate",
|
|
38
|
-
"hidden",
|
|
39
|
-
"indeterminate",
|
|
40
|
-
"inert",
|
|
41
|
-
"ismap",
|
|
42
|
-
"loop",
|
|
43
|
-
"multiple",
|
|
44
|
-
"muted",
|
|
45
|
-
"nomodule",
|
|
46
|
-
"novalidate",
|
|
47
|
-
"open",
|
|
48
|
-
"playsinline",
|
|
49
|
-
"readonly",
|
|
50
|
-
"required",
|
|
51
|
-
"reversed",
|
|
52
|
-
"seamless",
|
|
53
|
-
"selected"
|
|
54
|
-
];
|
|
55
|
-
const BooleanAttributes = /*#__PURE__*/ new Set(booleans);
|
|
56
|
-
const ChildProperties = /*#__PURE__*/ new Set([
|
|
57
|
-
"innerHTML",
|
|
58
|
-
"textContent",
|
|
59
|
-
"innerText",
|
|
60
|
-
"children"
|
|
61
|
-
]);
|
|
62
|
-
const Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {
|
|
6
|
+
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
7
|
+
const BooleanAttributes = /*#__PURE__*/new Set(booleans);
|
|
8
|
+
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
9
|
+
const Aliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
63
10
|
className: "class",
|
|
64
11
|
htmlFor: "for"
|
|
65
12
|
});
|
|
66
13
|
|
|
67
|
-
const ES2017FLAG = Feature.AggregateError
|
|
68
|
-
|
|
69
|
-
|
|
14
|
+
const ES2017FLAG = Feature.AggregateError
|
|
15
|
+
| Feature.BigIntTypedArray;
|
|
16
|
+
const GLOBAL_IDENTIFIER = '_$HY.r';
|
|
17
|
+
function createSerializer({
|
|
18
|
+
onData,
|
|
19
|
+
onDone,
|
|
20
|
+
scopeId,
|
|
21
|
+
onError
|
|
22
|
+
}) {
|
|
70
23
|
return new Serializer({
|
|
71
24
|
scopeId,
|
|
72
25
|
plugins: [
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
EventPlugin,
|
|
76
|
-
FormDataPlugin,
|
|
77
|
-
HeadersPlugin,
|
|
78
|
-
ReadableStreamPlugin,
|
|
79
|
-
RequestPlugin,
|
|
80
|
-
ResponsePlugin,
|
|
81
|
-
URLSearchParamsPlugin,
|
|
82
|
-
URLPlugin
|
|
83
|
-
],
|
|
26
|
+
CustomEventPlugin, DOMExceptionPlugin, EventPlugin,
|
|
27
|
+
FormDataPlugin, HeadersPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLSearchParamsPlugin, URLPlugin],
|
|
84
28
|
globalIdentifier: GLOBAL_IDENTIFIER,
|
|
85
29
|
disabledFeatures: ES2017FLAG,
|
|
86
30
|
onData,
|
|
@@ -89,14 +33,15 @@ function createSerializer({ onData, onDone, scopeId, onError }) {
|
|
|
89
33
|
});
|
|
90
34
|
}
|
|
91
35
|
function getLocalHeaderScript(id) {
|
|
92
|
-
return getCrossReferenceHeader(id) +
|
|
36
|
+
return getCrossReferenceHeader(id) + ';';
|
|
93
37
|
}
|
|
94
38
|
|
|
95
|
-
const VOID_ELEMENTS =
|
|
96
|
-
/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
|
|
39
|
+
const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
|
|
97
40
|
const REPLACE_SCRIPT = `function $df(e,n,o,t){if(n=document.getElementById(e),o=document.getElementById("pl-"+e)){for(;o&&8!==o.nodeType&&o.nodeValue!=="pl-"+e;)t=o.nextSibling,o.remove(),o=t;_$HY.done?o.remove():o.replaceWith(n.content)}n.remove(),_$HY.fe(e)}`;
|
|
98
41
|
function renderToString(code, options = {}) {
|
|
99
|
-
const {
|
|
42
|
+
const {
|
|
43
|
+
renderId
|
|
44
|
+
} = options;
|
|
100
45
|
let scripts = "";
|
|
101
46
|
const serializer = createSerializer({
|
|
102
47
|
scopeId: renderId,
|
|
@@ -134,7 +79,9 @@ function renderToString(code, options = {}) {
|
|
|
134
79
|
return html;
|
|
135
80
|
}
|
|
136
81
|
function renderToStringAsync(code, options = {}) {
|
|
137
|
-
const {
|
|
82
|
+
const {
|
|
83
|
+
timeoutMs = 30000
|
|
84
|
+
} = options;
|
|
138
85
|
let timeoutHandle;
|
|
139
86
|
const timeout = new Promise((_, reject) => {
|
|
140
87
|
timeoutHandle = setTimeout(() => reject("renderToString timed out"), timeoutMs);
|
|
@@ -145,7 +92,13 @@ function renderToStringAsync(code, options = {}) {
|
|
|
145
92
|
});
|
|
146
93
|
}
|
|
147
94
|
function renderToStream(code, options = {}) {
|
|
148
|
-
let {
|
|
95
|
+
let {
|
|
96
|
+
nonce,
|
|
97
|
+
onCompleteShell,
|
|
98
|
+
onCompleteAll,
|
|
99
|
+
renderId,
|
|
100
|
+
noScripts
|
|
101
|
+
} = options;
|
|
149
102
|
let dispose;
|
|
150
103
|
const blockingPromises = [];
|
|
151
104
|
const pushTask = task => {
|
|
@@ -161,12 +114,11 @@ function renderToStream(code, options = {}) {
|
|
|
161
114
|
const onDone = () => {
|
|
162
115
|
writeTasks();
|
|
163
116
|
doShell();
|
|
164
|
-
onCompleteAll &&
|
|
165
|
-
|
|
166
|
-
write(v)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
});
|
|
117
|
+
onCompleteAll && onCompleteAll({
|
|
118
|
+
write(v) {
|
|
119
|
+
!completed && buffer.write(v);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
170
122
|
writable && writable.end();
|
|
171
123
|
completed = true;
|
|
172
124
|
if (firstFlushed) dispose();
|
|
@@ -223,23 +175,17 @@ function renderToStream(code, options = {}) {
|
|
|
223
175
|
const first = html.indexOf(placeholder);
|
|
224
176
|
if (first === -1) return;
|
|
225
177
|
const last = html.indexOf(`<!--!$/${id}-->`, first + placeholder.length);
|
|
226
|
-
html = html.replace(
|
|
227
|
-
html.slice(first, last + placeholder.length + 1),
|
|
228
|
-
resolveSSRNode(payloadFn())
|
|
229
|
-
);
|
|
178
|
+
html = html.replace(html.slice(first, last + placeholder.length + 1), resolveSSRNode(payloadFn()));
|
|
230
179
|
},
|
|
231
180
|
serialize(id, p, wait) {
|
|
232
181
|
const serverOnly = sharedConfig.context.noHydrate;
|
|
233
182
|
if (!firstFlushed && wait && typeof p === "object" && "then" in p) {
|
|
234
183
|
blockingPromises.push(p);
|
|
235
|
-
!serverOnly &&
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
.catch(e => {
|
|
241
|
-
serializer.write(id, e);
|
|
242
|
-
});
|
|
184
|
+
!serverOnly && p.then(d => {
|
|
185
|
+
serializer.write(id, d);
|
|
186
|
+
}).catch(e => {
|
|
187
|
+
serializer.write(id, e);
|
|
188
|
+
});
|
|
243
189
|
} else if (!serverOnly) serializer.write(id, p);
|
|
244
190
|
},
|
|
245
191
|
roots: 0,
|
|
@@ -249,15 +195,11 @@ function renderToStream(code, options = {}) {
|
|
|
249
195
|
registerFragment(key) {
|
|
250
196
|
if (!registry.has(key)) {
|
|
251
197
|
let resolve, reject;
|
|
252
|
-
const p = new Promise((r, rej) => (
|
|
253
|
-
registry.set(key, err =>
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
queue(flushEnd);
|
|
258
|
-
})
|
|
259
|
-
)
|
|
260
|
-
);
|
|
198
|
+
const p = new Promise((r, rej) => (resolve = r, reject = rej));
|
|
199
|
+
registry.set(key, err => queue(() => queue(() => {
|
|
200
|
+
err ? reject(err) : resolve(true);
|
|
201
|
+
queue(flushEnd);
|
|
202
|
+
})));
|
|
261
203
|
serializer.write(key, p);
|
|
262
204
|
}
|
|
263
205
|
return (value, error) => {
|
|
@@ -270,7 +212,7 @@ function renderToStream(code, options = {}) {
|
|
|
270
212
|
}
|
|
271
213
|
if (!completed) {
|
|
272
214
|
if (!firstFlushed) {
|
|
273
|
-
queue(() =>
|
|
215
|
+
queue(() => html = replacePlaceholder(html, key, value !== undefined ? value : ""));
|
|
274
216
|
resolve(error);
|
|
275
217
|
} else {
|
|
276
218
|
buffer.write(`<template id="${key}">${value !== undefined ? value : " "}</template>`);
|
|
@@ -296,12 +238,11 @@ function renderToStream(code, options = {}) {
|
|
|
296
238
|
if (tasks.length) html = injectScripts(html, tasks, nonce);
|
|
297
239
|
buffer.write(html);
|
|
298
240
|
tasks = "";
|
|
299
|
-
onCompleteShell &&
|
|
300
|
-
|
|
301
|
-
write(v)
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
});
|
|
241
|
+
onCompleteShell && onCompleteShell({
|
|
242
|
+
write(v) {
|
|
243
|
+
!completed && buffer.write(v);
|
|
244
|
+
}
|
|
245
|
+
});
|
|
305
246
|
shellCompleted = true;
|
|
306
247
|
}
|
|
307
248
|
return {
|
|
@@ -336,7 +277,7 @@ function renderToStream(code, options = {}) {
|
|
|
336
277
|
pipeTo(w) {
|
|
337
278
|
return allSettled(blockingPromises).then(() => {
|
|
338
279
|
let resolve;
|
|
339
|
-
const p = new Promise(r =>
|
|
280
|
+
const p = new Promise(r => resolve = r);
|
|
340
281
|
setTimeout(() => {
|
|
341
282
|
doShell();
|
|
342
283
|
const encoder = new TextEncoder();
|
|
@@ -366,13 +307,13 @@ function renderToStream(code, options = {}) {
|
|
|
366
307
|
};
|
|
367
308
|
}
|
|
368
309
|
function HydrationScript(props) {
|
|
369
|
-
const {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
);
|
|
310
|
+
const {
|
|
311
|
+
nonce
|
|
312
|
+
} = sharedConfig.context;
|
|
313
|
+
return ssr(generateHydrationScript({
|
|
314
|
+
nonce,
|
|
315
|
+
...props
|
|
316
|
+
}));
|
|
376
317
|
}
|
|
377
318
|
function ssr(t, ...nodes) {
|
|
378
319
|
if (nodes.length) {
|
|
@@ -417,8 +358,7 @@ function ssrStyle(value) {
|
|
|
417
358
|
return result;
|
|
418
359
|
}
|
|
419
360
|
function ssrElement(tag, props, children, needsId) {
|
|
420
|
-
if (props == null) props = {};
|
|
421
|
-
else if (typeof props === "function") props = props();
|
|
361
|
+
if (props == null) props = {};else if (typeof props === "function") props = props();
|
|
422
362
|
const skipChildren = VOID_ELEMENTS.test(tag);
|
|
423
363
|
const keys = Object.keys(props);
|
|
424
364
|
let result = `<${tag}${needsId ? ssrHydrationKey() : ""} `;
|
|
@@ -426,8 +366,7 @@ function ssrElement(tag, props, children, needsId) {
|
|
|
426
366
|
for (let i = 0; i < keys.length; i++) {
|
|
427
367
|
const prop = keys[i];
|
|
428
368
|
if (ChildProperties.has(prop)) {
|
|
429
|
-
if (children === undefined && !skipChildren)
|
|
430
|
-
children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
|
|
369
|
+
if (children === undefined && !skipChildren) children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
|
|
431
370
|
continue;
|
|
432
371
|
}
|
|
433
372
|
const value = props[prop];
|
|
@@ -436,14 +375,10 @@ function ssrElement(tag, props, children, needsId) {
|
|
|
436
375
|
} else if (prop === "class" || prop === "className" || prop === "classList") {
|
|
437
376
|
if (classResolved) continue;
|
|
438
377
|
let n;
|
|
439
|
-
result += `class="${
|
|
440
|
-
escape(((n = props.class) ? n + " " : "") + ((n = props.className) ? n + " " : ""), true) +
|
|
441
|
-
ssrClassList(props.classList)
|
|
442
|
-
}"`;
|
|
378
|
+
result += `class="${escape(((n = props.class) ? n + " " : "") + ((n = props.className) ? n + " " : ""), true) + ssrClassList(props.classList)}"`;
|
|
443
379
|
classResolved = true;
|
|
444
380
|
} else if (BooleanAttributes.has(prop)) {
|
|
445
|
-
if (value) result += prop;
|
|
446
|
-
else continue;
|
|
381
|
+
if (value) result += prop;else continue;
|
|
447
382
|
} else if (value == undefined || prop === "ref" || prop.slice(0, 2) === "on") {
|
|
448
383
|
continue;
|
|
449
384
|
} else {
|
|
@@ -451,17 +386,16 @@ function ssrElement(tag, props, children, needsId) {
|
|
|
451
386
|
}
|
|
452
387
|
if (i !== keys.length - 1) result += " ";
|
|
453
388
|
}
|
|
454
|
-
if (skipChildren)
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
};
|
|
389
|
+
if (skipChildren) return {
|
|
390
|
+
t: result + "/>"
|
|
391
|
+
};
|
|
458
392
|
if (typeof children === "function") children = children();
|
|
459
393
|
return {
|
|
460
394
|
t: result + `>${resolveSSRNode(children, true)}</${tag}>`
|
|
461
395
|
};
|
|
462
396
|
}
|
|
463
397
|
function ssrAttribute(key, value, isBoolean) {
|
|
464
|
-
return isBoolean ?
|
|
398
|
+
return isBoolean ? value ? " " + key : "" : value != null ? ` ${key}="${value}"` : "";
|
|
465
399
|
}
|
|
466
400
|
function ssrHydrationKey() {
|
|
467
401
|
const hk = getHydrationKey();
|
|
@@ -505,13 +439,12 @@ function escape(s, attr) {
|
|
|
505
439
|
left = iDelim + 1;
|
|
506
440
|
iDelim = s.indexOf(delim, left);
|
|
507
441
|
} while (iDelim >= 0);
|
|
508
|
-
} else
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}
|
|
442
|
+
} else while (iAmp >= 0) {
|
|
443
|
+
if (left < iAmp) out += s.substring(left, iAmp);
|
|
444
|
+
out += "&";
|
|
445
|
+
left = iAmp + 1;
|
|
446
|
+
iAmp = s.indexOf("&", left);
|
|
447
|
+
}
|
|
515
448
|
return left < s.length ? out + s.substring(left) : out;
|
|
516
449
|
}
|
|
517
450
|
function resolveSSRNode(node, top) {
|
|
@@ -523,7 +456,7 @@ function resolveSSRNode(node, top) {
|
|
|
523
456
|
let mapped = "";
|
|
524
457
|
for (let i = 0, len = node.length; i < len; i++) {
|
|
525
458
|
if (!top && typeof prev !== "object" && typeof node[i] !== "object") mapped += `<!--!$-->`;
|
|
526
|
-
mapped += resolveSSRNode(
|
|
459
|
+
mapped += resolveSSRNode(prev = node[i]);
|
|
527
460
|
}
|
|
528
461
|
return mapped;
|
|
529
462
|
}
|
|
@@ -544,12 +477,11 @@ function getAssets() {
|
|
|
544
477
|
for (let i = 0, len = assets.length; i < len; i++) out += assets[i]();
|
|
545
478
|
return out;
|
|
546
479
|
}
|
|
547
|
-
function generateHydrationScript({
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
)}"].forEach((o=>document.addEventListener(o,(o=>{if(!e.events)return;let s=t(o.composedPath&&o.composedPath()[0]||o.target);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});</script><!--xs-->`;
|
|
480
|
+
function generateHydrationScript({
|
|
481
|
+
eventNames = ["click", "input"],
|
|
482
|
+
nonce
|
|
483
|
+
} = {}) {
|
|
484
|
+
return `<script${nonce ? ` nonce="${nonce}"` : ""}>window._$HY||(e=>{let t=e=>e&&e.hasAttribute&&(e.hasAttribute("data-hk")?e:t(e.host&&e.host.nodeType?e.host:e.parentNode));["${eventNames.join('", "')}"].forEach((o=>document.addEventListener(o,(o=>{if(!e.events)return;let s=t(o.composedPath&&o.composedPath()[0]||o.target);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});</script><!--xs-->`;
|
|
553
485
|
}
|
|
554
486
|
function Hydration(props) {
|
|
555
487
|
if (!sharedConfig.context.noHydrate) return props.children;
|
|
@@ -608,20 +540,16 @@ function replacePlaceholder(html, key, value) {
|
|
|
608
540
|
}
|
|
609
541
|
const RequestContext = Symbol();
|
|
610
542
|
function getRequestEvent() {
|
|
611
|
-
return globalThis[RequestContext]
|
|
612
|
-
? globalThis[RequestContext].getStore() ||
|
|
613
|
-
(sharedConfig.context && sharedConfig.context.event) ||
|
|
614
|
-
console.log(
|
|
615
|
-
"RequestEvent is missing. This is most likely due to accessing `getRequestEvent` non-managed async scope in a partially polyfilled environment. Try moving it above all `await` calls."
|
|
616
|
-
)
|
|
617
|
-
: undefined;
|
|
543
|
+
return globalThis[RequestContext] ? globalThis[RequestContext].getStore() || sharedConfig.context && sharedConfig.context.event || console.log("RequestEvent is missing. This is most likely due to accessing `getRequestEvent` non-managed async scope in a partially polyfilled environment. Try moving it above all `await` calls.") : undefined;
|
|
618
544
|
}
|
|
619
545
|
function Assets(props) {
|
|
620
546
|
useAssets(() => props.children);
|
|
621
547
|
}
|
|
622
548
|
function pipeToNodeWritable(code, writable, options = {}) {
|
|
623
549
|
if (options.onReady) {
|
|
624
|
-
options.onCompleteShell = ({
|
|
550
|
+
options.onCompleteShell = ({
|
|
551
|
+
write
|
|
552
|
+
}) => {
|
|
625
553
|
options.onReady({
|
|
626
554
|
write,
|
|
627
555
|
startWriting() {
|
|
@@ -635,7 +563,9 @@ function pipeToNodeWritable(code, writable, options = {}) {
|
|
|
635
563
|
}
|
|
636
564
|
function pipeToWritable(code, writable, options = {}) {
|
|
637
565
|
if (options.onReady) {
|
|
638
|
-
options.onCompleteShell = ({
|
|
566
|
+
options.onCompleteShell = ({
|
|
567
|
+
write
|
|
568
|
+
}) => {
|
|
639
569
|
options.onReady({
|
|
640
570
|
write,
|
|
641
571
|
startWriting() {
|
|
@@ -665,19 +595,11 @@ function ssrSpread(props, isSVG, skipChildren) {
|
|
|
665
595
|
} else if (prop === "class" || prop === "className" || prop === "classList") {
|
|
666
596
|
if (classResolved) continue;
|
|
667
597
|
let n;
|
|
668
|
-
result += `class="${(n = props.class) ? n + " " : ""}${
|
|
669
|
-
(n = props.className) ? n + " " : ""
|
|
670
|
-
}${ssrClassList(props.classList)}"`;
|
|
598
|
+
result += `class="${(n = props.class) ? n + " " : ""}${(n = props.className) ? n + " " : ""}${ssrClassList(props.classList)}"`;
|
|
671
599
|
classResolved = true;
|
|
672
600
|
} else if (prop !== "value" && Properties.has(prop)) {
|
|
673
|
-
if (value) result += prop;
|
|
674
|
-
|
|
675
|
-
} else if (
|
|
676
|
-
value == undefined ||
|
|
677
|
-
prop === "ref" ||
|
|
678
|
-
prop.slice(0, 2) === "on" ||
|
|
679
|
-
prop.slice(0, 5) === "prop:"
|
|
680
|
-
) {
|
|
601
|
+
if (value) result += prop;else continue;
|
|
602
|
+
} else if (value == undefined || prop === "ref" || prop.slice(0, 2) === "on" || prop.slice(0, 5) === "prop:") {
|
|
681
603
|
continue;
|
|
682
604
|
} else {
|
|
683
605
|
if (prop.slice(0, 5) === "attr:") prop = prop.slice(5);
|
|
@@ -701,8 +623,7 @@ function Dynamic(props) {
|
|
|
701
623
|
const comp = p.component,
|
|
702
624
|
t = typeof comp;
|
|
703
625
|
if (comp) {
|
|
704
|
-
if (t === "function") return comp(others);
|
|
705
|
-
else if (t === "string") {
|
|
626
|
+
if (t === "function") return comp(others);else if (t === "string") {
|
|
706
627
|
return ssrElement(comp, others, undefined, true);
|
|
707
628
|
}
|
|
708
629
|
}
|
|
@@ -711,39 +632,4 @@ function Portal(props) {
|
|
|
711
632
|
return "";
|
|
712
633
|
}
|
|
713
634
|
|
|
714
|
-
export {
|
|
715
|
-
Assets,
|
|
716
|
-
Dynamic,
|
|
717
|
-
Hydration,
|
|
718
|
-
HydrationScript,
|
|
719
|
-
NoHydration,
|
|
720
|
-
Portal,
|
|
721
|
-
RequestContext,
|
|
722
|
-
addEventListener,
|
|
723
|
-
delegateEvents,
|
|
724
|
-
escape,
|
|
725
|
-
generateHydrationScript,
|
|
726
|
-
getAssets,
|
|
727
|
-
getHydrationKey,
|
|
728
|
-
getRequestEvent,
|
|
729
|
-
hydrate,
|
|
730
|
-
insert,
|
|
731
|
-
isDev,
|
|
732
|
-
isServer,
|
|
733
|
-
pipeToNodeWritable,
|
|
734
|
-
pipeToWritable,
|
|
735
|
-
render,
|
|
736
|
-
renderToStream,
|
|
737
|
-
renderToString,
|
|
738
|
-
renderToStringAsync,
|
|
739
|
-
resolveSSRNode,
|
|
740
|
-
spread,
|
|
741
|
-
ssr,
|
|
742
|
-
ssrAttribute,
|
|
743
|
-
ssrClassList,
|
|
744
|
-
ssrElement,
|
|
745
|
-
ssrHydrationKey,
|
|
746
|
-
ssrSpread,
|
|
747
|
-
ssrStyle,
|
|
748
|
-
useAssets
|
|
749
|
-
};
|
|
635
|
+
export { Assets, Dynamic, Hydration, HydrationScript, NoHydration, Portal, RequestContext, addEventListener, delegateEvents, escape, generateHydrationScript, getAssets, getHydrationKey, getRequestEvent, hydrate, insert, isDev, isServer, pipeToNodeWritable, pipeToWritable, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, useAssets };
|