solid-js 1.8.1 → 1.8.2
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 +5 -1
- package/dist/dev.js +301 -532
- package/dist/server.cjs +18 -4
- package/dist/server.js +89 -170
- package/dist/solid.cjs +5 -1
- package/dist/solid.js +259 -459
- package/h/dist/h.js +8 -34
- package/h/jsx-runtime/dist/jsx.js +1 -1
- package/h/jsx-runtime/types/index.d.ts +8 -11
- package/h/types/hyperscript.d.ts +11 -11
- package/html/dist/html.js +94 -216
- package/html/types/lit.d.ts +31 -45
- package/package.json +2 -2
- package/store/dist/dev.js +42 -114
- package/store/dist/server.js +8 -19
- package/store/dist/store.js +39 -105
- 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 +9 -72
- 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 +140 -228
- package/types/render/Suspense.d.ts +5 -5
- package/types/render/component.d.ts +31 -62
- package/types/render/flow.d.ts +31 -43
- package/types/render/hydration.d.ts +14 -14
- package/types/server/index.d.ts +2 -56
- package/types/server/reactive.d.ts +44 -68
- package/types/server/rendering.d.ts +95 -166
- 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 +81 -617
- package/web/dist/server.cjs +1 -1
- package/web/dist/server.js +93 -176
- package/web/dist/web.js +80 -611
- 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.cjs
CHANGED
|
@@ -207,7 +207,7 @@ function renderToStream(code, options = {}) {
|
|
|
207
207
|
} else {
|
|
208
208
|
buffer.write(`<template id="${key}">${value !== undefined ? value : " "}</template>`);
|
|
209
209
|
pushTask(`$df("${key}")${!scriptFlushed ? ";" + REPLACE_SCRIPT : ""}`);
|
|
210
|
-
resolve(true);
|
|
210
|
+
error ? reject(error) : resolve(true);
|
|
211
211
|
scriptFlushed = true;
|
|
212
212
|
}
|
|
213
213
|
}
|
package/web/dist/server.js
CHANGED
|
@@ -1,59 +1,24 @@
|
|
|
1
|
-
import { sharedConfig, createRoot, splitProps } from
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
For,
|
|
5
|
-
Index,
|
|
6
|
-
Match,
|
|
7
|
-
Show,
|
|
8
|
-
Suspense,
|
|
9
|
-
SuspenseList,
|
|
10
|
-
Switch,
|
|
11
|
-
createComponent,
|
|
12
|
-
mergeProps
|
|
13
|
-
} from "solid-js";
|
|
14
|
-
import { Feature, Serializer, GLOBAL_CONTEXT_API_SCRIPT, getCrossReferenceHeader } from "seroval";
|
|
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, GLOBAL_CONTEXT_API_SCRIPT, getCrossReferenceHeader } from 'seroval';
|
|
15
4
|
|
|
16
|
-
const booleans = [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"autoplay",
|
|
21
|
-
"checked",
|
|
22
|
-
"controls",
|
|
23
|
-
"default",
|
|
24
|
-
"disabled",
|
|
25
|
-
"formnovalidate",
|
|
26
|
-
"hidden",
|
|
27
|
-
"indeterminate",
|
|
28
|
-
"ismap",
|
|
29
|
-
"loop",
|
|
30
|
-
"multiple",
|
|
31
|
-
"muted",
|
|
32
|
-
"nomodule",
|
|
33
|
-
"novalidate",
|
|
34
|
-
"open",
|
|
35
|
-
"playsinline",
|
|
36
|
-
"readonly",
|
|
37
|
-
"required",
|
|
38
|
-
"reversed",
|
|
39
|
-
"seamless",
|
|
40
|
-
"selected"
|
|
41
|
-
];
|
|
42
|
-
const BooleanAttributes = /*#__PURE__*/ new Set(booleans);
|
|
43
|
-
const ChildProperties = /*#__PURE__*/ new Set([
|
|
44
|
-
"innerHTML",
|
|
45
|
-
"textContent",
|
|
46
|
-
"innerText",
|
|
47
|
-
"children"
|
|
48
|
-
]);
|
|
49
|
-
const Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {
|
|
5
|
+
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
6
|
+
const BooleanAttributes = /*#__PURE__*/new Set(booleans);
|
|
7
|
+
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
8
|
+
const Aliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
50
9
|
className: "class",
|
|
51
10
|
htmlFor: "for"
|
|
52
11
|
});
|
|
53
12
|
|
|
54
|
-
const ES2017FLAG = Feature.AggregateError
|
|
55
|
-
|
|
56
|
-
|
|
13
|
+
const ES2017FLAG = Feature.AggregateError
|
|
14
|
+
| Feature.BigInt
|
|
15
|
+
| Feature.BigIntTypedArray;
|
|
16
|
+
const GLOBAL_IDENTIFIER = '_$HY.r';
|
|
17
|
+
function createSerializer({
|
|
18
|
+
onData,
|
|
19
|
+
onDone,
|
|
20
|
+
scopeId
|
|
21
|
+
}) {
|
|
57
22
|
return new Serializer({
|
|
58
23
|
scopeId,
|
|
59
24
|
globalIdentifier: GLOBAL_IDENTIFIER,
|
|
@@ -69,11 +34,12 @@ function getLocalHeaderScript(id) {
|
|
|
69
34
|
return getCrossReferenceHeader(id);
|
|
70
35
|
}
|
|
71
36
|
|
|
72
|
-
const VOID_ELEMENTS =
|
|
73
|
-
/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
|
|
37
|
+
const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
|
|
74
38
|
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)}`;
|
|
75
39
|
function renderToString(code, options = {}) {
|
|
76
|
-
const {
|
|
40
|
+
const {
|
|
41
|
+
renderId
|
|
42
|
+
} = options;
|
|
77
43
|
let scripts = "";
|
|
78
44
|
const serializer = createSerializer({
|
|
79
45
|
scopeId: renderId,
|
|
@@ -106,7 +72,9 @@ function renderToString(code, options = {}) {
|
|
|
106
72
|
return html;
|
|
107
73
|
}
|
|
108
74
|
function renderToStringAsync(code, options = {}) {
|
|
109
|
-
const {
|
|
75
|
+
const {
|
|
76
|
+
timeoutMs = 30000
|
|
77
|
+
} = options;
|
|
110
78
|
let timeoutHandle;
|
|
111
79
|
const timeout = new Promise((_, reject) => {
|
|
112
80
|
timeoutHandle = setTimeout(() => reject("renderToString timed out"), timeoutMs);
|
|
@@ -117,7 +85,12 @@ function renderToStringAsync(code, options = {}) {
|
|
|
117
85
|
});
|
|
118
86
|
}
|
|
119
87
|
function renderToStream(code, options = {}) {
|
|
120
|
-
let {
|
|
88
|
+
let {
|
|
89
|
+
nonce,
|
|
90
|
+
onCompleteShell,
|
|
91
|
+
onCompleteAll,
|
|
92
|
+
renderId
|
|
93
|
+
} = options;
|
|
121
94
|
let dispose;
|
|
122
95
|
const blockingPromises = [];
|
|
123
96
|
const pushTask = task => {
|
|
@@ -132,12 +105,11 @@ function renderToStream(code, options = {}) {
|
|
|
132
105
|
const checkEnd = () => {
|
|
133
106
|
if (!registry.size && !completed) {
|
|
134
107
|
writeTasks();
|
|
135
|
-
onCompleteAll &&
|
|
136
|
-
|
|
137
|
-
write(v)
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
});
|
|
108
|
+
onCompleteAll && onCompleteAll({
|
|
109
|
+
write(v) {
|
|
110
|
+
!completed && buffer.write(v);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
141
113
|
writable && writable.end();
|
|
142
114
|
completed = true;
|
|
143
115
|
setTimeout(dispose);
|
|
@@ -193,29 +165,23 @@ function renderToStream(code, options = {}) {
|
|
|
193
165
|
const first = html.indexOf(placeholder);
|
|
194
166
|
if (first === -1) return;
|
|
195
167
|
const last = html.indexOf(`<!--!$/${id}-->`, first + placeholder.length);
|
|
196
|
-
html = html.replace(
|
|
197
|
-
html.slice(first, last + placeholder.length + 1),
|
|
198
|
-
resolveSSRNode(payloadFn())
|
|
199
|
-
);
|
|
168
|
+
html = html.replace(html.slice(first, last + placeholder.length + 1), resolveSSRNode(payloadFn()));
|
|
200
169
|
},
|
|
201
170
|
serialize(id, p, wait) {
|
|
202
171
|
const serverOnly = sharedConfig.context.noHydrate;
|
|
203
172
|
if (!firstFlushed && wait && typeof p === "object" && "then" in p) {
|
|
204
173
|
blockingPromises.push(p);
|
|
205
|
-
!serverOnly &&
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
.catch(e => {
|
|
211
|
-
serializer.write(id, e);
|
|
212
|
-
});
|
|
174
|
+
!serverOnly && p.then(d => {
|
|
175
|
+
serializer.write(id, d);
|
|
176
|
+
}).catch(e => {
|
|
177
|
+
serializer.write(id, e);
|
|
178
|
+
});
|
|
213
179
|
} else if (!serverOnly) serializer.write(id, p);
|
|
214
180
|
},
|
|
215
181
|
registerFragment(key) {
|
|
216
182
|
if (!registry.has(key)) {
|
|
217
183
|
let resolve, reject;
|
|
218
|
-
const p = new Promise((r, rej) => (
|
|
184
|
+
const p = new Promise((r, rej) => (resolve = r, reject = rej));
|
|
219
185
|
registry.set(key, {
|
|
220
186
|
resolve,
|
|
221
187
|
reject
|
|
@@ -224,7 +190,10 @@ function renderToStream(code, options = {}) {
|
|
|
224
190
|
}
|
|
225
191
|
return (value, error) => {
|
|
226
192
|
if (registry.has(key)) {
|
|
227
|
-
const {
|
|
193
|
+
const {
|
|
194
|
+
resolve,
|
|
195
|
+
reject
|
|
196
|
+
} = registry.get(key);
|
|
228
197
|
registry.delete(key);
|
|
229
198
|
if (waitForFragments(registry, key)) {
|
|
230
199
|
resolve(true);
|
|
@@ -232,14 +201,12 @@ function renderToStream(code, options = {}) {
|
|
|
232
201
|
}
|
|
233
202
|
if ((value !== undefined || error) && !completed) {
|
|
234
203
|
if (!firstFlushed) {
|
|
235
|
-
Promise.resolve().then(
|
|
236
|
-
() => (html = replacePlaceholder(html, key, value !== undefined ? value : ""))
|
|
237
|
-
);
|
|
204
|
+
Promise.resolve().then(() => html = replacePlaceholder(html, key, value !== undefined ? value : ""));
|
|
238
205
|
error ? reject(error) : resolve(true);
|
|
239
206
|
} else {
|
|
240
207
|
buffer.write(`<template id="${key}">${value !== undefined ? value : " "}</template>`);
|
|
241
208
|
pushTask(`$df("${key}")${!scriptFlushed ? ";" + REPLACE_SCRIPT : ""}`);
|
|
242
|
-
resolve(true);
|
|
209
|
+
error ? reject(error) : resolve(true);
|
|
243
210
|
scriptFlushed = true;
|
|
244
211
|
}
|
|
245
212
|
}
|
|
@@ -260,12 +227,11 @@ function renderToStream(code, options = {}) {
|
|
|
260
227
|
if (tasks.length) html = injectScripts(html, tasks, nonce);
|
|
261
228
|
buffer.write(html);
|
|
262
229
|
tasks = "";
|
|
263
|
-
onCompleteShell &&
|
|
264
|
-
|
|
265
|
-
write(v)
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
});
|
|
230
|
+
onCompleteShell && onCompleteShell({
|
|
231
|
+
write(v) {
|
|
232
|
+
!completed && buffer.write(v);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
269
235
|
}
|
|
270
236
|
return {
|
|
271
237
|
then(fn) {
|
|
@@ -288,8 +254,7 @@ function renderToStream(code, options = {}) {
|
|
|
288
254
|
buffer = writable = w;
|
|
289
255
|
buffer.write(tmp);
|
|
290
256
|
firstFlushed = true;
|
|
291
|
-
if (completed) writable.end();
|
|
292
|
-
else setTimeout(flushEnd);
|
|
257
|
+
if (completed) writable.end();else setTimeout(flushEnd);
|
|
293
258
|
});
|
|
294
259
|
},
|
|
295
260
|
pipeTo(w) {
|
|
@@ -298,7 +263,7 @@ function renderToStream(code, options = {}) {
|
|
|
298
263
|
const encoder = new TextEncoder();
|
|
299
264
|
const writer = w.getWriter();
|
|
300
265
|
let resolve;
|
|
301
|
-
const p = new Promise(r =>
|
|
266
|
+
const p = new Promise(r => resolve = r);
|
|
302
267
|
writable = {
|
|
303
268
|
end() {
|
|
304
269
|
writer.releaseLock();
|
|
@@ -313,21 +278,20 @@ function renderToStream(code, options = {}) {
|
|
|
313
278
|
};
|
|
314
279
|
buffer.write(tmp);
|
|
315
280
|
firstFlushed = true;
|
|
316
|
-
if (completed) writable.end();
|
|
317
|
-
else setTimeout(flushEnd);
|
|
281
|
+
if (completed) writable.end();else setTimeout(flushEnd);
|
|
318
282
|
return p;
|
|
319
283
|
});
|
|
320
284
|
}
|
|
321
285
|
};
|
|
322
286
|
}
|
|
323
287
|
function HydrationScript(props) {
|
|
324
|
-
const {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
);
|
|
288
|
+
const {
|
|
289
|
+
nonce
|
|
290
|
+
} = sharedConfig.context;
|
|
291
|
+
return ssr(generateHydrationScript({
|
|
292
|
+
nonce,
|
|
293
|
+
...props
|
|
294
|
+
}));
|
|
331
295
|
}
|
|
332
296
|
function ssr(t, ...nodes) {
|
|
333
297
|
if (nodes.length) {
|
|
@@ -372,8 +336,7 @@ function ssrStyle(value) {
|
|
|
372
336
|
return result;
|
|
373
337
|
}
|
|
374
338
|
function ssrElement(tag, props, children, needsId) {
|
|
375
|
-
if (props == null) props = {};
|
|
376
|
-
else if (typeof props === "function") props = props();
|
|
339
|
+
if (props == null) props = {};else if (typeof props === "function") props = props();
|
|
377
340
|
const skipChildren = VOID_ELEMENTS.test(tag);
|
|
378
341
|
const keys = Object.keys(props);
|
|
379
342
|
let result = `<${tag}${needsId ? ssrHydrationKey() : ""} `;
|
|
@@ -381,8 +344,7 @@ function ssrElement(tag, props, children, needsId) {
|
|
|
381
344
|
for (let i = 0; i < keys.length; i++) {
|
|
382
345
|
const prop = keys[i];
|
|
383
346
|
if (ChildProperties.has(prop)) {
|
|
384
|
-
if (children === undefined && !skipChildren)
|
|
385
|
-
children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
|
|
347
|
+
if (children === undefined && !skipChildren) children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
|
|
386
348
|
continue;
|
|
387
349
|
}
|
|
388
350
|
const value = props[prop];
|
|
@@ -391,14 +353,10 @@ function ssrElement(tag, props, children, needsId) {
|
|
|
391
353
|
} else if (prop === "class" || prop === "className" || prop === "classList") {
|
|
392
354
|
if (classResolved) continue;
|
|
393
355
|
let n;
|
|
394
|
-
result += `class="${
|
|
395
|
-
escape(((n = props.class) ? n + " " : "") + ((n = props.className) ? n + " " : ""), true) +
|
|
396
|
-
ssrClassList(props.classList)
|
|
397
|
-
}"`;
|
|
356
|
+
result += `class="${escape(((n = props.class) ? n + " " : "") + ((n = props.className) ? n + " " : ""), true) + ssrClassList(props.classList)}"`;
|
|
398
357
|
classResolved = true;
|
|
399
358
|
} else if (BooleanAttributes.has(prop)) {
|
|
400
|
-
if (value) result += prop;
|
|
401
|
-
else continue;
|
|
359
|
+
if (value) result += prop;else continue;
|
|
402
360
|
} else if (value == undefined || prop === "ref" || prop.slice(0, 2) === "on") {
|
|
403
361
|
continue;
|
|
404
362
|
} else {
|
|
@@ -406,17 +364,16 @@ function ssrElement(tag, props, children, needsId) {
|
|
|
406
364
|
}
|
|
407
365
|
if (i !== keys.length - 1) result += " ";
|
|
408
366
|
}
|
|
409
|
-
if (skipChildren)
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
};
|
|
367
|
+
if (skipChildren) return {
|
|
368
|
+
t: result + "/>"
|
|
369
|
+
};
|
|
413
370
|
if (typeof children === "function") children = children();
|
|
414
371
|
return {
|
|
415
372
|
t: result + `>${resolveSSRNode(children, true)}</${tag}>`
|
|
416
373
|
};
|
|
417
374
|
}
|
|
418
375
|
function ssrAttribute(key, value, isBoolean) {
|
|
419
|
-
return isBoolean ?
|
|
376
|
+
return isBoolean ? value ? " " + key : "" : value != null ? ` ${key}="${value}"` : "";
|
|
420
377
|
}
|
|
421
378
|
function ssrHydrationKey() {
|
|
422
379
|
const hk = getHydrationKey();
|
|
@@ -460,13 +417,12 @@ function escape(s, attr) {
|
|
|
460
417
|
left = iDelim + 1;
|
|
461
418
|
iDelim = s.indexOf(delim, left);
|
|
462
419
|
} while (iDelim >= 0);
|
|
463
|
-
} else
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
}
|
|
420
|
+
} else while (iAmp >= 0) {
|
|
421
|
+
if (left < iAmp) out += s.substring(left, iAmp);
|
|
422
|
+
out += "&";
|
|
423
|
+
left = iAmp + 1;
|
|
424
|
+
iAmp = s.indexOf("&", left);
|
|
425
|
+
}
|
|
470
426
|
return left < s.length ? out + s.substring(left) : out;
|
|
471
427
|
}
|
|
472
428
|
function resolveSSRNode(node, top) {
|
|
@@ -478,7 +434,7 @@ function resolveSSRNode(node, top) {
|
|
|
478
434
|
let mapped = "";
|
|
479
435
|
for (let i = 0, len = node.length; i < len; i++) {
|
|
480
436
|
if (!top && typeof prev !== "object" && typeof node[i] !== "object") mapped += `<!--!$-->`;
|
|
481
|
-
mapped += resolveSSRNode(
|
|
437
|
+
mapped += resolveSSRNode(prev = node[i]);
|
|
482
438
|
}
|
|
483
439
|
return mapped;
|
|
484
440
|
}
|
|
@@ -499,12 +455,11 @@ function getAssets() {
|
|
|
499
455
|
for (let i = 0, len = assets.length; i < len; i++) out += assets[i]();
|
|
500
456
|
return out;
|
|
501
457
|
}
|
|
502
|
-
function generateHydrationScript({
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
)}"].forEach((o=>document.addEventListener(o,(o=>{let a=o.composedPath&&o.composedPath()[0]||o.target,s=t(a);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});${getGlobalHeaderScript()}</script><!--xs-->`;
|
|
458
|
+
function generateHydrationScript({
|
|
459
|
+
eventNames = ["click", "input"],
|
|
460
|
+
nonce
|
|
461
|
+
} = {}) {
|
|
462
|
+
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=>{let a=o.composedPath&&o.composedPath()[0]||o.target,s=t(a);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});${getGlobalHeaderScript()}</script><!--xs-->`;
|
|
508
463
|
}
|
|
509
464
|
function Hydration(props) {
|
|
510
465
|
if (!sharedConfig.context.noHydrate) return props.children;
|
|
@@ -556,7 +511,9 @@ function Assets(props) {
|
|
|
556
511
|
}
|
|
557
512
|
function pipeToNodeWritable(code, writable, options = {}) {
|
|
558
513
|
if (options.onReady) {
|
|
559
|
-
options.onCompleteShell = ({
|
|
514
|
+
options.onCompleteShell = ({
|
|
515
|
+
write
|
|
516
|
+
}) => {
|
|
560
517
|
options.onReady({
|
|
561
518
|
write,
|
|
562
519
|
startWriting() {
|
|
@@ -570,7 +527,9 @@ function pipeToNodeWritable(code, writable, options = {}) {
|
|
|
570
527
|
}
|
|
571
528
|
function pipeToWritable(code, writable, options = {}) {
|
|
572
529
|
if (options.onReady) {
|
|
573
|
-
options.onCompleteShell = ({
|
|
530
|
+
options.onCompleteShell = ({
|
|
531
|
+
write
|
|
532
|
+
}) => {
|
|
574
533
|
options.onReady({
|
|
575
534
|
write,
|
|
576
535
|
startWriting() {
|
|
@@ -600,19 +559,11 @@ function ssrSpread(props, isSVG, skipChildren) {
|
|
|
600
559
|
} else if (prop === "class" || prop === "className" || prop === "classList") {
|
|
601
560
|
if (classResolved) continue;
|
|
602
561
|
let n;
|
|
603
|
-
result += `class="${(n = props.class) ? n + " " : ""}${
|
|
604
|
-
(n = props.className) ? n + " " : ""
|
|
605
|
-
}${ssrClassList(props.classList)}"`;
|
|
562
|
+
result += `class="${(n = props.class) ? n + " " : ""}${(n = props.className) ? n + " " : ""}${ssrClassList(props.classList)}"`;
|
|
606
563
|
classResolved = true;
|
|
607
564
|
} else if (BooleanAttributes.has(prop)) {
|
|
608
|
-
if (value) result += prop;
|
|
609
|
-
|
|
610
|
-
} else if (
|
|
611
|
-
value == undefined ||
|
|
612
|
-
prop === "ref" ||
|
|
613
|
-
prop.slice(0, 2) === "on" ||
|
|
614
|
-
prop.slice(0, 5) === "prop:"
|
|
615
|
-
) {
|
|
565
|
+
if (value) result += prop;else continue;
|
|
566
|
+
} else if (value == undefined || prop === "ref" || prop.slice(0, 2) === "on" || prop.slice(0, 5) === "prop:") {
|
|
616
567
|
continue;
|
|
617
568
|
} else {
|
|
618
569
|
if (prop.slice(0, 5) === "attr:") prop = prop.slice(5);
|
|
@@ -636,8 +587,7 @@ function Dynamic(props) {
|
|
|
636
587
|
const comp = p.component,
|
|
637
588
|
t = typeof comp;
|
|
638
589
|
if (comp) {
|
|
639
|
-
if (t === "function") return comp(others);
|
|
640
|
-
else if (t === "string") {
|
|
590
|
+
if (t === "function") return comp(others);else if (t === "string") {
|
|
641
591
|
return ssrElement(comp, others, undefined, true);
|
|
642
592
|
}
|
|
643
593
|
}
|
|
@@ -646,37 +596,4 @@ function Portal(props) {
|
|
|
646
596
|
return "";
|
|
647
597
|
}
|
|
648
598
|
|
|
649
|
-
export {
|
|
650
|
-
Assets,
|
|
651
|
-
Dynamic,
|
|
652
|
-
Hydration,
|
|
653
|
-
HydrationScript,
|
|
654
|
-
NoHydration,
|
|
655
|
-
Portal,
|
|
656
|
-
addEventListener,
|
|
657
|
-
delegateEvents,
|
|
658
|
-
escape,
|
|
659
|
-
generateHydrationScript,
|
|
660
|
-
getAssets,
|
|
661
|
-
getHydrationKey,
|
|
662
|
-
hydrate,
|
|
663
|
-
insert,
|
|
664
|
-
isDev,
|
|
665
|
-
isServer,
|
|
666
|
-
pipeToNodeWritable,
|
|
667
|
-
pipeToWritable,
|
|
668
|
-
render,
|
|
669
|
-
renderToStream,
|
|
670
|
-
renderToString,
|
|
671
|
-
renderToStringAsync,
|
|
672
|
-
resolveSSRNode,
|
|
673
|
-
spread,
|
|
674
|
-
ssr,
|
|
675
|
-
ssrAttribute,
|
|
676
|
-
ssrClassList,
|
|
677
|
-
ssrElement,
|
|
678
|
-
ssrHydrationKey,
|
|
679
|
-
ssrSpread,
|
|
680
|
-
ssrStyle,
|
|
681
|
-
useAssets
|
|
682
|
-
};
|
|
599
|
+
export { Assets, Dynamic, Hydration, HydrationScript, NoHydration, Portal, addEventListener, delegateEvents, escape, generateHydrationScript, getAssets, getHydrationKey, hydrate, insert, isDev, isServer, pipeToNodeWritable, pipeToWritable, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, useAssets };
|