@solidjs/web 2.0.0-beta.1 → 2.0.0-beta.10
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 +27 -4
- package/dist/dev.cjs +223 -95
- package/dist/dev.js +211 -91
- package/dist/server.cjs +184 -79
- package/dist/server.js +178 -79
- package/dist/web.cjs +209 -86
- package/dist/web.js +197 -82
- package/package.json +98 -33
- package/storage/package.json +8 -3
- package/storage/types/src/index.d.ts +147 -21
- package/storage/types/src/jsx.d.ts +29 -0
- package/storage/types/src/server-mock.d.ts +89 -0
- package/storage/types-cjs/index.d.cts +2 -0
- package/storage/types-cjs/package.json +3 -0
- package/storage/types-cjs/src/client.d.cts +1 -0
- package/storage/types-cjs/src/index.d.cts +171 -0
- package/storage/types-cjs/src/jsx.d.cts +29 -0
- package/storage/types-cjs/src/server-mock.d.cts +161 -0
- package/storage/types-cjs/storage/src/index.d.cts +2 -0
- package/types/client.d.ts +31 -15
- package/types/core.d.ts +1 -1
- package/types/index.d.ts +147 -21
- package/types/jsx-properties.d.ts +92 -0
- package/types/jsx.d.ts +4321 -1
- package/types/server-mock.d.ts +89 -0
- package/types/server.d.ts +35 -17
- package/types-cjs/client.d.cts +104 -0
- package/types-cjs/core.d.cts +3 -0
- package/types-cjs/index.d.cts +171 -0
- package/types-cjs/jsx-properties.d.cts +92 -0
- package/types-cjs/jsx.d.cts +4321 -0
- package/types-cjs/package.json +3 -0
- package/types-cjs/server-mock.d.cts +161 -0
- package/types-cjs/server.d.cts +174 -0
package/dist/server.cjs
CHANGED
|
@@ -4,8 +4,6 @@ var solidJs = require('solid-js');
|
|
|
4
4
|
var seroval = require('seroval');
|
|
5
5
|
var web = require('seroval-plugins/web');
|
|
6
6
|
|
|
7
|
-
const Properties = /*#__PURE__*/new Set([
|
|
8
|
-
"value", "checked", "selected", "muted"]);
|
|
9
7
|
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
10
8
|
const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
|
|
11
9
|
const SVGElements = /*#__PURE__*/new Set([
|
|
@@ -13,22 +11,31 @@ const SVGElements = /*#__PURE__*/new Set([
|
|
|
13
11
|
"set", "stop",
|
|
14
12
|
"svg", "switch", "symbol", "text", "textPath",
|
|
15
13
|
"tref", "tspan", "use", "view", "vkern"]);
|
|
16
|
-
const
|
|
14
|
+
const MathMLElements = /*#__PURE__*/new Set(["annotation", "annotation-xml", "maction", "math", "menclose", "merror", "mfenced", "mfrac", "mi", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mprescripts", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msubsup", "msup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "semantics"]);
|
|
15
|
+
const Namespaces = {
|
|
16
|
+
svg: "http://www.w3.org/2000/svg",
|
|
17
|
+
mathml: "http://www.w3.org/1998/Math/MathML",
|
|
17
18
|
xlink: "http://www.w3.org/1999/xlink",
|
|
18
19
|
xml: "http://www.w3.org/XML/1998/namespace"
|
|
19
20
|
};
|
|
21
|
+
const VoidElements = /*#__PURE__*/new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]);
|
|
22
|
+
const RawTextElements = /*#__PURE__*/new Set(["style", "script", "noscript", "template", "textarea", "title"]);
|
|
20
23
|
const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input", "h1", "h2", "h3", "h4", "h5", "h6",
|
|
21
24
|
"webview",
|
|
22
25
|
"isindex", "listing", "multicol", "nextid", "noindex", "search"]);
|
|
23
26
|
|
|
24
|
-
const
|
|
27
|
+
const transparentOptions = {
|
|
25
28
|
transparent: true
|
|
26
|
-
}
|
|
29
|
+
};
|
|
30
|
+
const effect = (fn, effectFn, options) => solidJs.createRenderEffect(fn, effectFn, options ? {
|
|
31
|
+
transparent: true,
|
|
32
|
+
...options
|
|
33
|
+
} : transparentOptions);
|
|
27
34
|
const memo = fn => solidJs.createMemo(() => fn());
|
|
28
35
|
|
|
29
|
-
const ES2017FLAG = seroval.Feature.AggregateError
|
|
30
|
-
|
|
31
|
-
const GLOBAL_IDENTIFIER =
|
|
36
|
+
const ES2017FLAG = seroval.Feature.AggregateError |
|
|
37
|
+
seroval.Feature.BigIntTypedArray;
|
|
38
|
+
const GLOBAL_IDENTIFIER = "_$HY.r";
|
|
32
39
|
function createSerializer({
|
|
33
40
|
onData,
|
|
34
41
|
onDone,
|
|
@@ -51,7 +58,7 @@ function createSerializer({
|
|
|
51
58
|
});
|
|
52
59
|
}
|
|
53
60
|
function getLocalHeaderScript(id) {
|
|
54
|
-
return seroval.getCrossReferenceHeader(id) +
|
|
61
|
+
return seroval.getCrossReferenceHeader(id) + ";";
|
|
55
62
|
}
|
|
56
63
|
|
|
57
64
|
function resolveAssets(moduleUrl, manifest) {
|
|
@@ -107,11 +114,11 @@ function createAssetTracking() {
|
|
|
107
114
|
currentBoundaryId = v;
|
|
108
115
|
},
|
|
109
116
|
registerModule(moduleUrl, entryUrl) {
|
|
110
|
-
|
|
111
|
-
let map = boundaryModules.get(
|
|
117
|
+
const id = currentBoundaryId || "";
|
|
118
|
+
let map = boundaryModules.get(id);
|
|
112
119
|
if (!map) {
|
|
113
120
|
map = {};
|
|
114
|
-
boundaryModules.set(
|
|
121
|
+
boundaryModules.set(id, map);
|
|
115
122
|
}
|
|
116
123
|
map[moduleUrl] = entryUrl;
|
|
117
124
|
},
|
|
@@ -139,7 +146,7 @@ function applyAssetTracking(context, tracking, manifest) {
|
|
|
139
146
|
if (manifest) context.resolveAssets = moduleUrl => resolveAssets(moduleUrl, manifest);
|
|
140
147
|
}
|
|
141
148
|
const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
|
|
142
|
-
const REPLACE_SCRIPT = `function $df(e,n,o,t){if(n=document.getElementById(e)
|
|
149
|
+
const REPLACE_SCRIPT = `function $df(e,n,o,t){if(!(n=document.getElementById(e))||!(o=document.getElementById("pl-"+e)))return 0;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);return 1}function $dfl(e,o,n){if(!(o=document.getElementById("pl-"+e)))return 0;if(o._$fl)return 1;for(n=o.nextSibling;n;){if(8===n.nodeType&&n.nodeValue==="pl-"+e){o.parentNode&&o.parentNode.insertBefore(o.content.cloneNode(!0),n),o._$fl=1;return 1}n=n.nextSibling}return 0}function $dflj(e,i){for(i=0;i<e.length;i++)$dfl(e[i])}function $dfs(e,c,d){(_$HY.sc=_$HY.sc||{})[e]=c,d&&((_$HY.sd=_$HY.sd||{})[e]=1)}function $dfg(e,g,i,k){if(!(g=_$HY.sg&&_$HY.sg[e]))return;for(i=0;i<g.length;i++)if(_$HY.sc&&_$HY.sc[g[i]]>0)return;for(i=0;i<g.length;i++)k=g[i],delete _$HY.sg[k],$df(k)}function $dfc(e){if(--_$HY.sc[e]<=0){delete _$HY.sc[e],_$HY.sg&&_$HY.sg[e]?$dfg(e):!(_$HY.sd&&_$HY.sd[e])&&$df(e);_$HY.sd&&delete _$HY.sd[e]}}function $dfj(e,i,n){for(i=0;i<e.length;i++)if(_$HY.sc&&_$HY.sc[e[i]]>0){for(n=0;n<e.length;n++)(_$HY.sg=_$HY.sg||{})[e[n]]=e;return}for(i=0;i<e.length;i++)$df(e[i])}`;
|
|
143
150
|
function renderToString(code, options = {}) {
|
|
144
151
|
const {
|
|
145
152
|
renderId = "",
|
|
@@ -194,6 +201,7 @@ function renderToString(code, options = {}) {
|
|
|
194
201
|
}, {
|
|
195
202
|
id: renderId
|
|
196
203
|
});
|
|
204
|
+
serializeFragmentAssets("", tracking.boundaryModules, solidJs.sharedConfig.context);
|
|
197
205
|
solidJs.sharedConfig.context.noHydrate = true;
|
|
198
206
|
serializer.close();
|
|
199
207
|
html = injectAssets(solidJs.sharedConfig.context.assets, html);
|
|
@@ -212,10 +220,12 @@ function renderToStream(code, options = {}) {
|
|
|
212
220
|
} = options;
|
|
213
221
|
let dispose;
|
|
214
222
|
const blockingPromises = new Set();
|
|
223
|
+
let headerEmitted = false;
|
|
215
224
|
const pushTask = task => {
|
|
216
225
|
if (noScripts) return;
|
|
217
|
-
if (!
|
|
218
|
-
|
|
226
|
+
if (!headerEmitted) {
|
|
227
|
+
headerEmitted = true;
|
|
228
|
+
tasks += getLocalHeaderScript(renderId);
|
|
219
229
|
}
|
|
220
230
|
tasks += task + ";";
|
|
221
231
|
if (!timer && firstFlushed) {
|
|
@@ -241,8 +251,15 @@ function renderToStream(code, options = {}) {
|
|
|
241
251
|
onDone,
|
|
242
252
|
onError: options.onError
|
|
243
253
|
});
|
|
254
|
+
let rootAssetsSerialized = false;
|
|
255
|
+
const serializeRootAssets = () => {
|
|
256
|
+
if (rootAssetsSerialized) return;
|
|
257
|
+
rootAssetsSerialized = true;
|
|
258
|
+
serializeFragmentAssets("", tracking.boundaryModules, context);
|
|
259
|
+
};
|
|
244
260
|
const flushEnd = () => {
|
|
245
261
|
if (!registry.size) {
|
|
262
|
+
serializeRootAssets();
|
|
246
263
|
queue(() => queue(() => serializer.flush()));
|
|
247
264
|
}
|
|
248
265
|
};
|
|
@@ -264,7 +281,29 @@ function renderToStream(code, options = {}) {
|
|
|
264
281
|
let shellCompleted = false;
|
|
265
282
|
let scriptFlushed = false;
|
|
266
283
|
let headStyles;
|
|
284
|
+
const revealGroups = new Map();
|
|
267
285
|
let timer = null;
|
|
286
|
+
const emitTask = task => {
|
|
287
|
+
pushTask(`${task}${!scriptFlushed ? ";" + REPLACE_SCRIPT : ""}`);
|
|
288
|
+
scriptFlushed = true;
|
|
289
|
+
};
|
|
290
|
+
function resolveRevealKeys(groupOrKeys, release, consume) {
|
|
291
|
+
if (Array.isArray(groupOrKeys)) return groupOrKeys.slice();
|
|
292
|
+
let group = revealGroups.get(groupOrKeys);
|
|
293
|
+
if (!group) {
|
|
294
|
+
if (!release) return;
|
|
295
|
+
group = {
|
|
296
|
+
order: [],
|
|
297
|
+
keys: new Set(),
|
|
298
|
+
released: true
|
|
299
|
+
};
|
|
300
|
+
revealGroups.set(groupOrKeys, group);
|
|
301
|
+
} else if (release) group.released = true;
|
|
302
|
+
if (!group.order.length) return;
|
|
303
|
+
const keys = group.order.slice();
|
|
304
|
+
if (consume) revealGroups.delete(groupOrKeys);
|
|
305
|
+
return keys;
|
|
306
|
+
}
|
|
268
307
|
let rootHoles = null;
|
|
269
308
|
let nextHoleId = 0;
|
|
270
309
|
let buffer = {
|
|
@@ -314,7 +353,26 @@ function renderToStream(code, options = {}) {
|
|
|
314
353
|
escape: escape,
|
|
315
354
|
resolve: resolveSSRNode,
|
|
316
355
|
ssr: ssr,
|
|
317
|
-
registerFragment(key) {
|
|
356
|
+
registerFragment(key, options) {
|
|
357
|
+
const revealGroup = options && options.revealGroup;
|
|
358
|
+
if (revealGroup) {
|
|
359
|
+
let group = revealGroups.get(revealGroup);
|
|
360
|
+
if (!group) {
|
|
361
|
+
group = {
|
|
362
|
+
order: [],
|
|
363
|
+
keys: new Set(),
|
|
364
|
+
released: false
|
|
365
|
+
};
|
|
366
|
+
revealGroups.set(revealGroup, group);
|
|
367
|
+
}
|
|
368
|
+
if (!group.keys.has(key)) {
|
|
369
|
+
group.keys.add(key);
|
|
370
|
+
group.order.push(key);
|
|
371
|
+
}
|
|
372
|
+
if (group.released) {
|
|
373
|
+
throw new Error("registerFragment() for reveal group '" + revealGroup + "' was called after revealFragments(). Ensure template payload is emitted before grouped reveal.");
|
|
374
|
+
}
|
|
375
|
+
}
|
|
318
376
|
if (!registry.has(key)) {
|
|
319
377
|
let resolve, reject;
|
|
320
378
|
const p = new Promise((r, rej) => (resolve = r, reject = rej));
|
|
@@ -324,7 +382,7 @@ function renderToStream(code, options = {}) {
|
|
|
324
382
|
queue(flushEnd);
|
|
325
383
|
}))
|
|
326
384
|
});
|
|
327
|
-
serializer.write(key, p);
|
|
385
|
+
serializer.write(key + "_fr", p);
|
|
328
386
|
}
|
|
329
387
|
return (value, error) => {
|
|
330
388
|
if (registry.has(key)) {
|
|
@@ -353,9 +411,9 @@ function renderToStream(code, options = {}) {
|
|
|
353
411
|
} else {
|
|
354
412
|
serializeFragmentAssets(key, tracking.boundaryModules, context);
|
|
355
413
|
const styles = collectStreamStyles(key, tracking, headStyles);
|
|
414
|
+
const deferActivation = !!revealGroup;
|
|
356
415
|
if (styles.length) {
|
|
357
|
-
|
|
358
|
-
scriptFlushed = true;
|
|
416
|
+
emitTask(`$dfs("${key}",${styles.length},${deferActivation ? 1 : 0})`);
|
|
359
417
|
writeTasks();
|
|
360
418
|
for (const url of styles) {
|
|
361
419
|
buffer.write(`<link rel="stylesheet" href="${url}" onload="$dfc('${key}')" onerror="$dfc('${key}')">`);
|
|
@@ -363,8 +421,9 @@ function renderToStream(code, options = {}) {
|
|
|
363
421
|
buffer.write(`<template id="${key}">${value !== undefined ? value : " "}</template>`);
|
|
364
422
|
} else {
|
|
365
423
|
buffer.write(`<template id="${key}">${value !== undefined ? value : " "}</template>`);
|
|
366
|
-
|
|
367
|
-
|
|
424
|
+
if (!deferActivation) {
|
|
425
|
+
emitTask(`$df("${key}")`);
|
|
426
|
+
}
|
|
368
427
|
}
|
|
369
428
|
item.resolve(error);
|
|
370
429
|
}
|
|
@@ -372,6 +431,16 @@ function renderToStream(code, options = {}) {
|
|
|
372
431
|
}
|
|
373
432
|
return firstFlushed;
|
|
374
433
|
};
|
|
434
|
+
},
|
|
435
|
+
revealFragments(groupOrKeys) {
|
|
436
|
+
const keys = resolveRevealKeys(groupOrKeys, true, true);
|
|
437
|
+
if (!keys) return;
|
|
438
|
+
emitTask(`$dfj(${JSON.stringify(keys)})`);
|
|
439
|
+
},
|
|
440
|
+
revealFallbacks(groupOrKeys) {
|
|
441
|
+
const keys = resolveRevealKeys(groupOrKeys, false, false);
|
|
442
|
+
if (!keys) return;
|
|
443
|
+
emitTask(`$dflj(${JSON.stringify(keys)})`);
|
|
375
444
|
}
|
|
376
445
|
};
|
|
377
446
|
applyAssetTracking(context, tracking, manifest);
|
|
@@ -398,13 +467,32 @@ function renderToStream(code, options = {}) {
|
|
|
398
467
|
function doShell() {
|
|
399
468
|
if (shellCompleted) return;
|
|
400
469
|
if (rootHoles) {
|
|
470
|
+
const pending = [];
|
|
401
471
|
for (const {
|
|
402
472
|
id,
|
|
403
473
|
fn
|
|
404
474
|
} of rootHoles) {
|
|
405
475
|
const marker = `<!--rh${id}-->`;
|
|
406
476
|
const res = resolveSSRNode(fn);
|
|
407
|
-
|
|
477
|
+
if (!res.h.length) {
|
|
478
|
+
html = html.replace(marker, res.t[0]);
|
|
479
|
+
} else {
|
|
480
|
+
let out = res.t[0];
|
|
481
|
+
for (let j = 0; j < res.h.length; j++) {
|
|
482
|
+
const newId = nextHoleId++;
|
|
483
|
+
pending.push({
|
|
484
|
+
id: newId,
|
|
485
|
+
fn: res.h[j]
|
|
486
|
+
});
|
|
487
|
+
out += `<!--rh${newId}-->` + res.t[j + 1];
|
|
488
|
+
}
|
|
489
|
+
html = html.replace(marker, out);
|
|
490
|
+
for (const p of res.p) blockingPromises.add(p);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
if (pending.length) {
|
|
494
|
+
rootHoles = pending;
|
|
495
|
+
return;
|
|
408
496
|
}
|
|
409
497
|
rootHoles = null;
|
|
410
498
|
}
|
|
@@ -415,6 +503,7 @@ function renderToStream(code, options = {}) {
|
|
|
415
503
|
if (url.endsWith(".css")) headStyles.add(url);
|
|
416
504
|
}
|
|
417
505
|
html = injectPreloadLinks(tracking.emittedAssets, html);
|
|
506
|
+
serializeRootAssets();
|
|
418
507
|
if (tasks.length) html = injectScripts(html, tasks, nonce);
|
|
419
508
|
buffer.write(html);
|
|
420
509
|
tasks = "";
|
|
@@ -441,48 +530,56 @@ function renderToStream(code, options = {}) {
|
|
|
441
530
|
queue(flushEnd);
|
|
442
531
|
},
|
|
443
532
|
pipe(w) {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
533
|
+
function flush() {
|
|
534
|
+
allSettled(blockingPromises).then(() => {
|
|
535
|
+
setTimeout(() => {
|
|
536
|
+
doShell();
|
|
537
|
+
if (!shellCompleted) return flush();
|
|
538
|
+
buffer = writable = w;
|
|
539
|
+
buffer.write(tmp);
|
|
540
|
+
firstFlushed = true;
|
|
541
|
+
if (completed) {
|
|
542
|
+
dispose();
|
|
543
|
+
writable.end();
|
|
544
|
+
} else flushEnd();
|
|
545
|
+
});
|
|
454
546
|
});
|
|
455
|
-
}
|
|
547
|
+
}
|
|
548
|
+
flush();
|
|
456
549
|
},
|
|
457
550
|
pipeTo(w) {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
551
|
+
let resolve;
|
|
552
|
+
const p = new Promise(r => resolve = r);
|
|
553
|
+
function flush() {
|
|
554
|
+
allSettled(blockingPromises).then(() => {
|
|
555
|
+
setTimeout(() => {
|
|
556
|
+
doShell();
|
|
557
|
+
if (!shellCompleted) return flush();
|
|
558
|
+
const encoder = new TextEncoder();
|
|
559
|
+
const writer = w.getWriter();
|
|
560
|
+
writable = {
|
|
561
|
+
end() {
|
|
562
|
+
writer.releaseLock();
|
|
563
|
+
w.close().catch(() => {});
|
|
564
|
+
resolve();
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
buffer = {
|
|
568
|
+
write(payload) {
|
|
569
|
+
writer.write(encoder.encode(payload)).catch(() => {});
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
buffer.write(tmp);
|
|
573
|
+
firstFlushed = true;
|
|
574
|
+
if (completed) {
|
|
575
|
+
dispose();
|
|
576
|
+
writable.end();
|
|
577
|
+
} else flushEnd();
|
|
578
|
+
});
|
|
483
579
|
});
|
|
484
|
-
|
|
485
|
-
|
|
580
|
+
}
|
|
581
|
+
flush();
|
|
582
|
+
return p;
|
|
486
583
|
}
|
|
487
584
|
};
|
|
488
585
|
}
|
|
@@ -512,7 +609,7 @@ function ssrClassName(value) {
|
|
|
512
609
|
classValue = !!value[key];
|
|
513
610
|
if (!key || key === "undefined" || !classValue) continue;
|
|
514
611
|
i && (result += " ");
|
|
515
|
-
result += escape(key);
|
|
612
|
+
result += escape(key, true);
|
|
516
613
|
}
|
|
517
614
|
return result;
|
|
518
615
|
}
|
|
@@ -522,8 +619,8 @@ function ssrStyle(value) {
|
|
|
522
619
|
let result = "";
|
|
523
620
|
const k = Object.keys(value);
|
|
524
621
|
for (let i = 0; i < k.length; i++) {
|
|
525
|
-
const s = k[i];
|
|
526
|
-
const v = value[
|
|
622
|
+
const s = escape(k[i], true);
|
|
623
|
+
const v = value[k[i]];
|
|
527
624
|
if (v != undefined) {
|
|
528
625
|
if (i) result += ";";
|
|
529
626
|
const r = escape(v, true);
|
|
@@ -665,7 +762,7 @@ function generateHydrationScript({
|
|
|
665
762
|
eventNames = ["click", "input"],
|
|
666
763
|
nonce
|
|
667
764
|
} = {}) {
|
|
668
|
-
return `<script${nonce ? ` nonce="${nonce}"` : ""}>window._$HY||(e=>{let t=e=>e&&e.hasAttribute&&(e.hasAttribute("_hk")?e:t(e.host&&e.host.nodeType?e.host:e.parentNode));["${eventNames.join('",
|
|
765
|
+
return `<script${nonce ? ` nonce="${nonce}"` : ""}>window._$HY||(e=>{let t=e=>e&&e.hasAttribute&&(e.hasAttribute("_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-->`;
|
|
669
766
|
}
|
|
670
767
|
function queue(fn) {
|
|
671
768
|
return Promise.resolve().then(fn);
|
|
@@ -832,23 +929,25 @@ function notSup() {
|
|
|
832
929
|
|
|
833
930
|
const isServer = true;
|
|
834
931
|
const isDev = false;
|
|
835
|
-
function
|
|
932
|
+
function dynamic(source) {
|
|
836
933
|
const o = solidJs.getOwner();
|
|
837
934
|
if (o?.id != null) solidJs.getNextChildId(o);
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
if (
|
|
844
|
-
return
|
|
935
|
+
return props => {
|
|
936
|
+
const memoOwner = solidJs.createOwner();
|
|
937
|
+
return solidJs.runWithOwner(memoOwner, () => {
|
|
938
|
+
const comp = source(),
|
|
939
|
+
t = typeof comp;
|
|
940
|
+
if (comp) {
|
|
941
|
+
if (t === "function") return comp(props);else if (t === "string") {
|
|
942
|
+
return ssrElement(comp, props, undefined, true);
|
|
943
|
+
}
|
|
845
944
|
}
|
|
846
|
-
}
|
|
847
|
-
}
|
|
945
|
+
});
|
|
946
|
+
};
|
|
848
947
|
}
|
|
849
948
|
function Dynamic(props) {
|
|
850
|
-
const
|
|
851
|
-
return
|
|
949
|
+
const Comp = dynamic(() => props.component);
|
|
950
|
+
return solidJs.createComponent(Comp, solidJs.omit(props, "component"));
|
|
852
951
|
}
|
|
853
952
|
function Portal(props) {
|
|
854
953
|
throw new Error("Portal is not supported on the server");
|
|
@@ -882,6 +981,10 @@ Object.defineProperty(exports, "Repeat", {
|
|
|
882
981
|
enumerable: true,
|
|
883
982
|
get: function () { return solidJs.Repeat; }
|
|
884
983
|
});
|
|
984
|
+
Object.defineProperty(exports, "Reveal", {
|
|
985
|
+
enumerable: true,
|
|
986
|
+
get: function () { return solidJs.Reveal; }
|
|
987
|
+
});
|
|
885
988
|
Object.defineProperty(exports, "Show", {
|
|
886
989
|
enumerable: true,
|
|
887
990
|
get: function () { return solidJs.Show; }
|
|
@@ -911,17 +1014,19 @@ exports.DOMElements = DOMElements;
|
|
|
911
1014
|
exports.DelegatedEvents = DelegatedEvents;
|
|
912
1015
|
exports.Dynamic = Dynamic;
|
|
913
1016
|
exports.HydrationScript = HydrationScript;
|
|
1017
|
+
exports.MathMLElements = MathMLElements;
|
|
1018
|
+
exports.Namespaces = Namespaces;
|
|
914
1019
|
exports.Portal = Portal;
|
|
915
|
-
exports.
|
|
1020
|
+
exports.RawTextElements = RawTextElements;
|
|
916
1021
|
exports.RequestContext = RequestContext;
|
|
917
1022
|
exports.SVGElements = SVGElements;
|
|
918
|
-
exports.
|
|
1023
|
+
exports.VoidElements = VoidElements;
|
|
919
1024
|
exports.addEventListener = notSup;
|
|
920
1025
|
exports.applyRef = applyRef;
|
|
921
1026
|
exports.assign = notSup;
|
|
922
1027
|
exports.className = notSup;
|
|
923
|
-
exports.createDynamic = createDynamic;
|
|
924
1028
|
exports.delegateEvents = notSup;
|
|
1029
|
+
exports.dynamic = dynamic;
|
|
925
1030
|
exports.dynamicProperty = notSup;
|
|
926
1031
|
exports.effect = effect;
|
|
927
1032
|
exports.escape = escape;
|