solid-js 1.8.4 → 1.8.5
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 +1 -1
- package/dist/dev.js +299 -534
- package/dist/server.js +75 -170
- package/dist/solid.cjs +1 -1
- package/dist/solid.js +257 -461
- 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 +33 -47
- package/package.json +1 -1
- 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 +13 -13
- package/types/server/index.d.ts +2 -57
- package/types/server/reactive.d.ts +42 -73
- 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 -619
- package/web/dist/server.js +94 -177
- package/web/dist/storage.js +3 -3
- package/web/dist/web.js +80 -613
- 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,59 +1,25 @@
|
|
|
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
|
+
onError
|
|
22
|
+
}) {
|
|
57
23
|
return new Serializer({
|
|
58
24
|
scopeId,
|
|
59
25
|
globalIdentifier: GLOBAL_IDENTIFIER,
|
|
@@ -70,11 +36,12 @@ function getLocalHeaderScript(id) {
|
|
|
70
36
|
return getCrossReferenceHeader(id);
|
|
71
37
|
}
|
|
72
38
|
|
|
73
|
-
const VOID_ELEMENTS =
|
|
74
|
-
/^(?: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;
|
|
75
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)}`;
|
|
76
41
|
function renderToString(code, options = {}) {
|
|
77
|
-
const {
|
|
42
|
+
const {
|
|
43
|
+
renderId
|
|
44
|
+
} = options;
|
|
78
45
|
let scripts = "";
|
|
79
46
|
const serializer = createSerializer({
|
|
80
47
|
scopeId: renderId,
|
|
@@ -108,7 +75,9 @@ function renderToString(code, options = {}) {
|
|
|
108
75
|
return html;
|
|
109
76
|
}
|
|
110
77
|
function renderToStringAsync(code, options = {}) {
|
|
111
|
-
const {
|
|
78
|
+
const {
|
|
79
|
+
timeoutMs = 30000
|
|
80
|
+
} = options;
|
|
112
81
|
let timeoutHandle;
|
|
113
82
|
const timeout = new Promise((_, reject) => {
|
|
114
83
|
timeoutHandle = setTimeout(() => reject("renderToString timed out"), timeoutMs);
|
|
@@ -119,7 +88,13 @@ function renderToStringAsync(code, options = {}) {
|
|
|
119
88
|
});
|
|
120
89
|
}
|
|
121
90
|
function renderToStream(code, options = {}) {
|
|
122
|
-
let {
|
|
91
|
+
let {
|
|
92
|
+
nonce,
|
|
93
|
+
onCompleteShell,
|
|
94
|
+
onCompleteAll,
|
|
95
|
+
renderId,
|
|
96
|
+
noScripts
|
|
97
|
+
} = options;
|
|
123
98
|
let dispose;
|
|
124
99
|
const blockingPromises = [];
|
|
125
100
|
const pushTask = task => {
|
|
@@ -135,12 +110,11 @@ function renderToStream(code, options = {}) {
|
|
|
135
110
|
const checkEnd = () => {
|
|
136
111
|
if (!registry.size && !completed) {
|
|
137
112
|
writeTasks();
|
|
138
|
-
onCompleteAll &&
|
|
139
|
-
|
|
140
|
-
write(v)
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
});
|
|
113
|
+
onCompleteAll && onCompleteAll({
|
|
114
|
+
write(v) {
|
|
115
|
+
!completed && buffer.write(v);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
144
118
|
writable && writable.end();
|
|
145
119
|
completed = true;
|
|
146
120
|
setTimeout(dispose);
|
|
@@ -197,29 +171,23 @@ function renderToStream(code, options = {}) {
|
|
|
197
171
|
const first = html.indexOf(placeholder);
|
|
198
172
|
if (first === -1) return;
|
|
199
173
|
const last = html.indexOf(`<!--!$/${id}-->`, first + placeholder.length);
|
|
200
|
-
html = html.replace(
|
|
201
|
-
html.slice(first, last + placeholder.length + 1),
|
|
202
|
-
resolveSSRNode(payloadFn())
|
|
203
|
-
);
|
|
174
|
+
html = html.replace(html.slice(first, last + placeholder.length + 1), resolveSSRNode(payloadFn()));
|
|
204
175
|
},
|
|
205
176
|
serialize(id, p, wait) {
|
|
206
177
|
const serverOnly = sharedConfig.context.noHydrate;
|
|
207
178
|
if (!firstFlushed && wait && typeof p === "object" && "then" in p) {
|
|
208
179
|
blockingPromises.push(p);
|
|
209
|
-
!serverOnly &&
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
.catch(e => {
|
|
215
|
-
serializer.write(id, e);
|
|
216
|
-
});
|
|
180
|
+
!serverOnly && p.then(d => {
|
|
181
|
+
serializer.write(id, d);
|
|
182
|
+
}).catch(e => {
|
|
183
|
+
serializer.write(id, e);
|
|
184
|
+
});
|
|
217
185
|
} else if (!serverOnly) serializer.write(id, p);
|
|
218
186
|
},
|
|
219
187
|
registerFragment(key) {
|
|
220
188
|
if (!registry.has(key)) {
|
|
221
189
|
let resolve, reject;
|
|
222
|
-
const p = new Promise((r, rej) => (
|
|
190
|
+
const p = new Promise((r, rej) => (resolve = r, reject = rej));
|
|
223
191
|
registry.set(key, {
|
|
224
192
|
resolve,
|
|
225
193
|
reject
|
|
@@ -228,7 +196,10 @@ function renderToStream(code, options = {}) {
|
|
|
228
196
|
}
|
|
229
197
|
return (value, error) => {
|
|
230
198
|
if (registry.has(key)) {
|
|
231
|
-
const {
|
|
199
|
+
const {
|
|
200
|
+
resolve,
|
|
201
|
+
reject
|
|
202
|
+
} = registry.get(key);
|
|
232
203
|
registry.delete(key);
|
|
233
204
|
if (waitForFragments(registry, key)) {
|
|
234
205
|
resolve(true);
|
|
@@ -236,9 +207,7 @@ function renderToStream(code, options = {}) {
|
|
|
236
207
|
}
|
|
237
208
|
if ((value !== undefined || error) && !completed) {
|
|
238
209
|
if (!firstFlushed) {
|
|
239
|
-
Promise.resolve().then(
|
|
240
|
-
() => (html = replacePlaceholder(html, key, value !== undefined ? value : ""))
|
|
241
|
-
);
|
|
210
|
+
Promise.resolve().then(() => html = replacePlaceholder(html, key, value !== undefined ? value : ""));
|
|
242
211
|
error ? reject(error) : resolve(true);
|
|
243
212
|
} else {
|
|
244
213
|
buffer.write(`<template id="${key}">${value !== undefined ? value : " "}</template>`);
|
|
@@ -264,12 +233,11 @@ function renderToStream(code, options = {}) {
|
|
|
264
233
|
if (tasks.length) html = injectScripts(html, tasks, nonce);
|
|
265
234
|
buffer.write(html);
|
|
266
235
|
tasks = "";
|
|
267
|
-
onCompleteShell &&
|
|
268
|
-
|
|
269
|
-
write(v)
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
});
|
|
236
|
+
onCompleteShell && onCompleteShell({
|
|
237
|
+
write(v) {
|
|
238
|
+
!completed && buffer.write(v);
|
|
239
|
+
}
|
|
240
|
+
});
|
|
273
241
|
}
|
|
274
242
|
return {
|
|
275
243
|
then(fn) {
|
|
@@ -292,8 +260,7 @@ function renderToStream(code, options = {}) {
|
|
|
292
260
|
buffer = writable = w;
|
|
293
261
|
buffer.write(tmp);
|
|
294
262
|
firstFlushed = true;
|
|
295
|
-
if (completed) writable.end();
|
|
296
|
-
else setTimeout(flushEnd);
|
|
263
|
+
if (completed) writable.end();else setTimeout(flushEnd);
|
|
297
264
|
});
|
|
298
265
|
},
|
|
299
266
|
pipeTo(w) {
|
|
@@ -302,7 +269,7 @@ function renderToStream(code, options = {}) {
|
|
|
302
269
|
const encoder = new TextEncoder();
|
|
303
270
|
const writer = w.getWriter();
|
|
304
271
|
let resolve;
|
|
305
|
-
const p = new Promise(r =>
|
|
272
|
+
const p = new Promise(r => resolve = r);
|
|
306
273
|
writable = {
|
|
307
274
|
end() {
|
|
308
275
|
writer.releaseLock();
|
|
@@ -317,21 +284,20 @@ function renderToStream(code, options = {}) {
|
|
|
317
284
|
};
|
|
318
285
|
buffer.write(tmp);
|
|
319
286
|
firstFlushed = true;
|
|
320
|
-
if (completed) writable.end();
|
|
321
|
-
else setTimeout(flushEnd);
|
|
287
|
+
if (completed) writable.end();else setTimeout(flushEnd);
|
|
322
288
|
return p;
|
|
323
289
|
});
|
|
324
290
|
}
|
|
325
291
|
};
|
|
326
292
|
}
|
|
327
293
|
function HydrationScript(props) {
|
|
328
|
-
const {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
);
|
|
294
|
+
const {
|
|
295
|
+
nonce
|
|
296
|
+
} = sharedConfig.context;
|
|
297
|
+
return ssr(generateHydrationScript({
|
|
298
|
+
nonce,
|
|
299
|
+
...props
|
|
300
|
+
}));
|
|
335
301
|
}
|
|
336
302
|
function ssr(t, ...nodes) {
|
|
337
303
|
if (nodes.length) {
|
|
@@ -376,8 +342,7 @@ function ssrStyle(value) {
|
|
|
376
342
|
return result;
|
|
377
343
|
}
|
|
378
344
|
function ssrElement(tag, props, children, needsId) {
|
|
379
|
-
if (props == null) props = {};
|
|
380
|
-
else if (typeof props === "function") props = props();
|
|
345
|
+
if (props == null) props = {};else if (typeof props === "function") props = props();
|
|
381
346
|
const skipChildren = VOID_ELEMENTS.test(tag);
|
|
382
347
|
const keys = Object.keys(props);
|
|
383
348
|
let result = `<${tag}${needsId ? ssrHydrationKey() : ""} `;
|
|
@@ -385,8 +350,7 @@ function ssrElement(tag, props, children, needsId) {
|
|
|
385
350
|
for (let i = 0; i < keys.length; i++) {
|
|
386
351
|
const prop = keys[i];
|
|
387
352
|
if (ChildProperties.has(prop)) {
|
|
388
|
-
if (children === undefined && !skipChildren)
|
|
389
|
-
children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
|
|
353
|
+
if (children === undefined && !skipChildren) children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
|
|
390
354
|
continue;
|
|
391
355
|
}
|
|
392
356
|
const value = props[prop];
|
|
@@ -395,14 +359,10 @@ function ssrElement(tag, props, children, needsId) {
|
|
|
395
359
|
} else if (prop === "class" || prop === "className" || prop === "classList") {
|
|
396
360
|
if (classResolved) continue;
|
|
397
361
|
let n;
|
|
398
|
-
result += `class="${
|
|
399
|
-
escape(((n = props.class) ? n + " " : "") + ((n = props.className) ? n + " " : ""), true) +
|
|
400
|
-
ssrClassList(props.classList)
|
|
401
|
-
}"`;
|
|
362
|
+
result += `class="${escape(((n = props.class) ? n + " " : "") + ((n = props.className) ? n + " " : ""), true) + ssrClassList(props.classList)}"`;
|
|
402
363
|
classResolved = true;
|
|
403
364
|
} else if (BooleanAttributes.has(prop)) {
|
|
404
|
-
if (value) result += prop;
|
|
405
|
-
else continue;
|
|
365
|
+
if (value) result += prop;else continue;
|
|
406
366
|
} else if (value == undefined || prop === "ref" || prop.slice(0, 2) === "on") {
|
|
407
367
|
continue;
|
|
408
368
|
} else {
|
|
@@ -410,17 +370,16 @@ function ssrElement(tag, props, children, needsId) {
|
|
|
410
370
|
}
|
|
411
371
|
if (i !== keys.length - 1) result += " ";
|
|
412
372
|
}
|
|
413
|
-
if (skipChildren)
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
};
|
|
373
|
+
if (skipChildren) return {
|
|
374
|
+
t: result + "/>"
|
|
375
|
+
};
|
|
417
376
|
if (typeof children === "function") children = children();
|
|
418
377
|
return {
|
|
419
378
|
t: result + `>${resolveSSRNode(children, true)}</${tag}>`
|
|
420
379
|
};
|
|
421
380
|
}
|
|
422
381
|
function ssrAttribute(key, value, isBoolean) {
|
|
423
|
-
return isBoolean ?
|
|
382
|
+
return isBoolean ? value ? " " + key : "" : value != null ? ` ${key}="${value}"` : "";
|
|
424
383
|
}
|
|
425
384
|
function ssrHydrationKey() {
|
|
426
385
|
const hk = getHydrationKey();
|
|
@@ -464,13 +423,12 @@ function escape(s, attr) {
|
|
|
464
423
|
left = iDelim + 1;
|
|
465
424
|
iDelim = s.indexOf(delim, left);
|
|
466
425
|
} while (iDelim >= 0);
|
|
467
|
-
} else
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
}
|
|
426
|
+
} else while (iAmp >= 0) {
|
|
427
|
+
if (left < iAmp) out += s.substring(left, iAmp);
|
|
428
|
+
out += "&";
|
|
429
|
+
left = iAmp + 1;
|
|
430
|
+
iAmp = s.indexOf("&", left);
|
|
431
|
+
}
|
|
474
432
|
return left < s.length ? out + s.substring(left) : out;
|
|
475
433
|
}
|
|
476
434
|
function resolveSSRNode(node, top) {
|
|
@@ -482,7 +440,7 @@ function resolveSSRNode(node, top) {
|
|
|
482
440
|
let mapped = "";
|
|
483
441
|
for (let i = 0, len = node.length; i < len; i++) {
|
|
484
442
|
if (!top && typeof prev !== "object" && typeof node[i] !== "object") mapped += `<!--!$-->`;
|
|
485
|
-
mapped += resolveSSRNode(
|
|
443
|
+
mapped += resolveSSRNode(prev = node[i]);
|
|
486
444
|
}
|
|
487
445
|
return mapped;
|
|
488
446
|
}
|
|
@@ -503,12 +461,11 @@ function getAssets() {
|
|
|
503
461
|
for (let i = 0, len = assets.length; i < len; i++) out += assets[i]();
|
|
504
462
|
return out;
|
|
505
463
|
}
|
|
506
|
-
function generateHydrationScript({
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
)}"].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-->`;
|
|
464
|
+
function generateHydrationScript({
|
|
465
|
+
eventNames = ["click", "input"],
|
|
466
|
+
nonce
|
|
467
|
+
} = {}) {
|
|
468
|
+
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-->`;
|
|
512
469
|
}
|
|
513
470
|
function Hydration(props) {
|
|
514
471
|
if (!sharedConfig.context.noHydrate) return props.children;
|
|
@@ -564,7 +521,9 @@ function Assets(props) {
|
|
|
564
521
|
}
|
|
565
522
|
function pipeToNodeWritable(code, writable, options = {}) {
|
|
566
523
|
if (options.onReady) {
|
|
567
|
-
options.onCompleteShell = ({
|
|
524
|
+
options.onCompleteShell = ({
|
|
525
|
+
write
|
|
526
|
+
}) => {
|
|
568
527
|
options.onReady({
|
|
569
528
|
write,
|
|
570
529
|
startWriting() {
|
|
@@ -578,7 +537,9 @@ function pipeToNodeWritable(code, writable, options = {}) {
|
|
|
578
537
|
}
|
|
579
538
|
function pipeToWritable(code, writable, options = {}) {
|
|
580
539
|
if (options.onReady) {
|
|
581
|
-
options.onCompleteShell = ({
|
|
540
|
+
options.onCompleteShell = ({
|
|
541
|
+
write
|
|
542
|
+
}) => {
|
|
582
543
|
options.onReady({
|
|
583
544
|
write,
|
|
584
545
|
startWriting() {
|
|
@@ -608,19 +569,11 @@ function ssrSpread(props, isSVG, skipChildren) {
|
|
|
608
569
|
} else if (prop === "class" || prop === "className" || prop === "classList") {
|
|
609
570
|
if (classResolved) continue;
|
|
610
571
|
let n;
|
|
611
|
-
result += `class="${(n = props.class) ? n + " " : ""}${
|
|
612
|
-
(n = props.className) ? n + " " : ""
|
|
613
|
-
}${ssrClassList(props.classList)}"`;
|
|
572
|
+
result += `class="${(n = props.class) ? n + " " : ""}${(n = props.className) ? n + " " : ""}${ssrClassList(props.classList)}"`;
|
|
614
573
|
classResolved = true;
|
|
615
574
|
} else if (BooleanAttributes.has(prop)) {
|
|
616
|
-
if (value) result += prop;
|
|
617
|
-
|
|
618
|
-
} else if (
|
|
619
|
-
value == undefined ||
|
|
620
|
-
prop === "ref" ||
|
|
621
|
-
prop.slice(0, 2) === "on" ||
|
|
622
|
-
prop.slice(0, 5) === "prop:"
|
|
623
|
-
) {
|
|
575
|
+
if (value) result += prop;else continue;
|
|
576
|
+
} else if (value == undefined || prop === "ref" || prop.slice(0, 2) === "on" || prop.slice(0, 5) === "prop:") {
|
|
624
577
|
continue;
|
|
625
578
|
} else {
|
|
626
579
|
if (prop.slice(0, 5) === "attr:") prop = prop.slice(5);
|
|
@@ -644,8 +597,7 @@ function Dynamic(props) {
|
|
|
644
597
|
const comp = p.component,
|
|
645
598
|
t = typeof comp;
|
|
646
599
|
if (comp) {
|
|
647
|
-
if (t === "function") return comp(others);
|
|
648
|
-
else if (t === "string") {
|
|
600
|
+
if (t === "function") return comp(others);else if (t === "string") {
|
|
649
601
|
return ssrElement(comp, others, undefined, true);
|
|
650
602
|
}
|
|
651
603
|
}
|
|
@@ -654,39 +606,4 @@ function Portal(props) {
|
|
|
654
606
|
return "";
|
|
655
607
|
}
|
|
656
608
|
|
|
657
|
-
export {
|
|
658
|
-
Assets,
|
|
659
|
-
Dynamic,
|
|
660
|
-
Hydration,
|
|
661
|
-
HydrationScript,
|
|
662
|
-
NoHydration,
|
|
663
|
-
Portal,
|
|
664
|
-
RequestContext,
|
|
665
|
-
addEventListener,
|
|
666
|
-
delegateEvents,
|
|
667
|
-
escape,
|
|
668
|
-
generateHydrationScript,
|
|
669
|
-
getAssets,
|
|
670
|
-
getHydrationKey,
|
|
671
|
-
getRequestEvent,
|
|
672
|
-
hydrate,
|
|
673
|
-
insert,
|
|
674
|
-
isDev,
|
|
675
|
-
isServer,
|
|
676
|
-
pipeToNodeWritable,
|
|
677
|
-
pipeToWritable,
|
|
678
|
-
render,
|
|
679
|
-
renderToStream,
|
|
680
|
-
renderToString,
|
|
681
|
-
renderToStringAsync,
|
|
682
|
-
resolveSSRNode,
|
|
683
|
-
spread,
|
|
684
|
-
ssr,
|
|
685
|
-
ssrAttribute,
|
|
686
|
-
ssrClassList,
|
|
687
|
-
ssrElement,
|
|
688
|
-
ssrHydrationKey,
|
|
689
|
-
ssrSpread,
|
|
690
|
-
ssrStyle,
|
|
691
|
-
useAssets
|
|
692
|
-
};
|
|
609
|
+
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 };
|
package/web/dist/storage.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from
|
|
2
|
-
import { isServer, RequestContext } from
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import { isServer, RequestContext } from 'solid-js/web';
|
|
3
3
|
|
|
4
4
|
function provideRequestEvent(init, cb) {
|
|
5
5
|
if (!isServer) throw new Error("Attempting to use server context in non-server build");
|
|
6
|
-
const ctx =
|
|
6
|
+
const ctx = globalThis[RequestContext] = globalThis[RequestContext] || new AsyncLocalStorage();
|
|
7
7
|
return ctx.run(init, cb);
|
|
8
8
|
}
|
|
9
9
|
|