solid-js 1.3.14 → 1.3.15
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 +4 -3
- package/dist/dev.js +4 -3
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/dist/solid.cjs +4 -3
- package/dist/solid.js +4 -3
- package/package.json +2 -2
- package/types/reactive/signal.d.ts +1 -1
- package/types/render/hydration.d.ts +1 -0
- package/web/dist/dev.cjs +4 -0
- package/web/dist/dev.js +4 -0
- package/web/dist/server.cjs +2 -2
- package/web/dist/server.js +2 -2
- package/web/dist/web.cjs +4 -0
- package/web/dist/web.js +4 -0
package/dist/dev.cjs
CHANGED
|
@@ -448,8 +448,8 @@ options) {
|
|
|
448
448
|
return prevValue => {
|
|
449
449
|
let input;
|
|
450
450
|
if (isArray) {
|
|
451
|
-
input =
|
|
452
|
-
for (let i = 0; i < deps.length; i++) input
|
|
451
|
+
input = Array(deps.length);
|
|
452
|
+
for (let i = 0; i < deps.length; i++) input[i] = deps[i]();
|
|
453
453
|
} else input = deps();
|
|
454
454
|
if (defer) {
|
|
455
455
|
defer = false;
|
|
@@ -880,6 +880,7 @@ function runUserEffects(queue) {
|
|
|
880
880
|
const e = queue[i];
|
|
881
881
|
if (!e.user) runTop(e);else queue[userLength++] = e;
|
|
882
882
|
}
|
|
883
|
+
if (sharedConfig.context) setHydrateContext();
|
|
883
884
|
const resume = queue.length;
|
|
884
885
|
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
885
886
|
for (i = resume; i < queue.length; i++) runTop(queue[i]);
|
|
@@ -1532,7 +1533,7 @@ function Suspense(props) {
|
|
|
1532
1533
|
});
|
|
1533
1534
|
flicker = s;
|
|
1534
1535
|
p.then(err => {
|
|
1535
|
-
if (error = err) return set();
|
|
1536
|
+
if ((error = err) || sharedConfig.done) return set();
|
|
1536
1537
|
sharedConfig.gather(key);
|
|
1537
1538
|
setHydrateContext(ctx);
|
|
1538
1539
|
set();
|
package/dist/dev.js
CHANGED
|
@@ -444,8 +444,8 @@ options) {
|
|
|
444
444
|
return prevValue => {
|
|
445
445
|
let input;
|
|
446
446
|
if (isArray) {
|
|
447
|
-
input =
|
|
448
|
-
for (let i = 0; i < deps.length; i++) input
|
|
447
|
+
input = Array(deps.length);
|
|
448
|
+
for (let i = 0; i < deps.length; i++) input[i] = deps[i]();
|
|
449
449
|
} else input = deps();
|
|
450
450
|
if (defer) {
|
|
451
451
|
defer = false;
|
|
@@ -876,6 +876,7 @@ function runUserEffects(queue) {
|
|
|
876
876
|
const e = queue[i];
|
|
877
877
|
if (!e.user) runTop(e);else queue[userLength++] = e;
|
|
878
878
|
}
|
|
879
|
+
if (sharedConfig.context) setHydrateContext();
|
|
879
880
|
const resume = queue.length;
|
|
880
881
|
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
881
882
|
for (i = resume; i < queue.length; i++) runTop(queue[i]);
|
|
@@ -1528,7 +1529,7 @@ function Suspense(props) {
|
|
|
1528
1529
|
});
|
|
1529
1530
|
flicker = s;
|
|
1530
1531
|
p.then(err => {
|
|
1531
|
-
if (error = err) return set();
|
|
1532
|
+
if ((error = err) || sharedConfig.done) return set();
|
|
1532
1533
|
sharedConfig.gather(key);
|
|
1533
1534
|
setHydrateContext(ctx);
|
|
1534
1535
|
set();
|
package/dist/server.cjs
CHANGED
|
@@ -508,7 +508,7 @@ function Suspense(props) {
|
|
|
508
508
|
if (ctx.streaming) {
|
|
509
509
|
setHydrateContext(undefined);
|
|
510
510
|
const res = {
|
|
511
|
-
t: `<span id="pl
|
|
511
|
+
t: `<span id="pl-${id}">${resolveSSRNode(props.fallback)}</span>`
|
|
512
512
|
};
|
|
513
513
|
setHydrateContext(ctx);
|
|
514
514
|
return res;
|
package/dist/server.js
CHANGED
|
@@ -504,7 +504,7 @@ function Suspense(props) {
|
|
|
504
504
|
if (ctx.streaming) {
|
|
505
505
|
setHydrateContext(undefined);
|
|
506
506
|
const res = {
|
|
507
|
-
t: `<span id="pl
|
|
507
|
+
t: `<span id="pl-${id}">${resolveSSRNode(props.fallback)}</span>`
|
|
508
508
|
};
|
|
509
509
|
setHydrateContext(ctx);
|
|
510
510
|
return res;
|
package/dist/solid.cjs
CHANGED
|
@@ -445,8 +445,8 @@ options) {
|
|
|
445
445
|
return prevValue => {
|
|
446
446
|
let input;
|
|
447
447
|
if (isArray) {
|
|
448
|
-
input =
|
|
449
|
-
for (let i = 0; i < deps.length; i++) input
|
|
448
|
+
input = Array(deps.length);
|
|
449
|
+
for (let i = 0; i < deps.length; i++) input[i] = deps[i]();
|
|
450
450
|
} else input = deps();
|
|
451
451
|
if (defer) {
|
|
452
452
|
defer = false;
|
|
@@ -822,6 +822,7 @@ function runUserEffects(queue) {
|
|
|
822
822
|
const e = queue[i];
|
|
823
823
|
if (!e.user) runTop(e);else queue[userLength++] = e;
|
|
824
824
|
}
|
|
825
|
+
if (sharedConfig.context) setHydrateContext();
|
|
825
826
|
const resume = queue.length;
|
|
826
827
|
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
827
828
|
for (i = resume; i < queue.length; i++) runTop(queue[i]);
|
|
@@ -1447,7 +1448,7 @@ function Suspense(props) {
|
|
|
1447
1448
|
});
|
|
1448
1449
|
flicker = s;
|
|
1449
1450
|
p.then(err => {
|
|
1450
|
-
if (error = err) return set();
|
|
1451
|
+
if ((error = err) || sharedConfig.done) return set();
|
|
1451
1452
|
sharedConfig.gather(key);
|
|
1452
1453
|
setHydrateContext(ctx);
|
|
1453
1454
|
set();
|
package/dist/solid.js
CHANGED
|
@@ -441,8 +441,8 @@ options) {
|
|
|
441
441
|
return prevValue => {
|
|
442
442
|
let input;
|
|
443
443
|
if (isArray) {
|
|
444
|
-
input =
|
|
445
|
-
for (let i = 0; i < deps.length; i++) input
|
|
444
|
+
input = Array(deps.length);
|
|
445
|
+
for (let i = 0; i < deps.length; i++) input[i] = deps[i]();
|
|
446
446
|
} else input = deps();
|
|
447
447
|
if (defer) {
|
|
448
448
|
defer = false;
|
|
@@ -818,6 +818,7 @@ function runUserEffects(queue) {
|
|
|
818
818
|
const e = queue[i];
|
|
819
819
|
if (!e.user) runTop(e);else queue[userLength++] = e;
|
|
820
820
|
}
|
|
821
|
+
if (sharedConfig.context) setHydrateContext();
|
|
821
822
|
const resume = queue.length;
|
|
822
823
|
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
823
824
|
for (i = resume; i < queue.length; i++) runTop(queue[i]);
|
|
@@ -1443,7 +1444,7 @@ function Suspense(props) {
|
|
|
1443
1444
|
});
|
|
1444
1445
|
flicker = s;
|
|
1445
1446
|
p.then(err => {
|
|
1446
|
-
if (error = err) return set();
|
|
1447
|
+
if ((error = err) || sharedConfig.done) return set();
|
|
1447
1448
|
sharedConfig.gather(key);
|
|
1448
1449
|
setHydrateContext(ctx);
|
|
1449
1450
|
set();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-js",
|
|
3
3
|
"description": "A declarative JavaScript library for building user interfaces.",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.15",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -144,5 +144,5 @@
|
|
|
144
144
|
"compiler",
|
|
145
145
|
"performance"
|
|
146
146
|
],
|
|
147
|
-
"gitHead": "
|
|
147
|
+
"gitHead": "0a6fc7bbeebf14f1a9297358801acf365dfbb716"
|
|
148
148
|
}
|
|
@@ -201,7 +201,7 @@ export interface Resource<T> extends Accessor<T> {
|
|
|
201
201
|
}
|
|
202
202
|
export declare type ResourceActions<T> = {
|
|
203
203
|
mutate: Setter<T>;
|
|
204
|
-
refetch: (info?: unknown) =>
|
|
204
|
+
refetch: (info?: unknown) => T | Promise<T> | undefined | null;
|
|
205
205
|
};
|
|
206
206
|
export declare type ResourceReturn<T> = [Resource<T>, ResourceActions<T>];
|
|
207
207
|
export declare type ResourceSource<S> = S | false | null | undefined | (() => S | false | null | undefined);
|
|
@@ -10,6 +10,7 @@ declare type SharedConfig = {
|
|
|
10
10
|
load?: (id: string) => Promise<any> | undefined;
|
|
11
11
|
gather?: (key: string) => void;
|
|
12
12
|
registry?: Map<string, Element>;
|
|
13
|
+
done?: boolean;
|
|
13
14
|
};
|
|
14
15
|
export declare const sharedConfig: SharedConfig;
|
|
15
16
|
export declare function setHydrateContext(context?: HydrationContext): void;
|
package/web/dist/dev.cjs
CHANGED
|
@@ -337,6 +337,10 @@ function eventHandler(e) {
|
|
|
337
337
|
return node || document;
|
|
338
338
|
}
|
|
339
339
|
});
|
|
340
|
+
if (window._$HY && !solidJs.sharedConfig.done) {
|
|
341
|
+
solidJs.sharedConfig.done = true;
|
|
342
|
+
document.querySelectorAll("[id^=pl-]").forEach(elem => elem.remove());
|
|
343
|
+
}
|
|
340
344
|
while (node !== null) {
|
|
341
345
|
const handler = node[key];
|
|
342
346
|
if (handler && !node.disabled) {
|
package/web/dist/dev.js
CHANGED
|
@@ -334,6 +334,10 @@ function eventHandler(e) {
|
|
|
334
334
|
return node || document;
|
|
335
335
|
}
|
|
336
336
|
});
|
|
337
|
+
if (window._$HY && !sharedConfig.done) {
|
|
338
|
+
sharedConfig.done = true;
|
|
339
|
+
document.querySelectorAll("[id^=pl-]").forEach(elem => elem.remove());
|
|
340
|
+
}
|
|
337
341
|
while (node !== null) {
|
|
338
342
|
const handler = node[key];
|
|
339
343
|
if (handler && !node.disabled) {
|
package/web/dist/server.cjs
CHANGED
|
@@ -232,7 +232,7 @@ function stringifyString(str) {
|
|
|
232
232
|
return result;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
const REPLACE_SCRIPT = `function $df(e,
|
|
235
|
+
const REPLACE_SCRIPT = `function $df(e,t,d,l){d=document.getElementById(e),(l=document.getElementById("pl-"+e))&&l.replaceWith(...d.childNodes),d.remove(),_$HY.set(e,t||null)}`;
|
|
236
236
|
const FRAGMENT_REPLACE = /<!\[([\d-]+)\]>/;
|
|
237
237
|
function renderToString(code, options = {}) {
|
|
238
238
|
let scripts = "";
|
|
@@ -675,7 +675,7 @@ function Dynamic(props) {
|
|
|
675
675
|
if (comp) {
|
|
676
676
|
if (t === "function") return comp(others);else if (t === "string") {
|
|
677
677
|
const [local, sOthers] = solidJs.splitProps(others, ["children"]);
|
|
678
|
-
return ssr([`<${comp}`, ' ', ">", `</${comp}>`], ssrHydrationKey(), ssrSpread(sOthers), local.children || "");
|
|
678
|
+
return ssr([`<${comp}`, ' ', ">", `</${comp}>`], ssrHydrationKey(), ssrSpread(sOthers), escape(local.children || ""));
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
681
|
}
|
package/web/dist/server.js
CHANGED
|
@@ -229,7 +229,7 @@ function stringifyString(str) {
|
|
|
229
229
|
return result;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
const REPLACE_SCRIPT = `function $df(e,
|
|
232
|
+
const REPLACE_SCRIPT = `function $df(e,t,d,l){d=document.getElementById(e),(l=document.getElementById("pl-"+e))&&l.replaceWith(...d.childNodes),d.remove(),_$HY.set(e,t||null)}`;
|
|
233
233
|
const FRAGMENT_REPLACE = /<!\[([\d-]+)\]>/;
|
|
234
234
|
function renderToString(code, options = {}) {
|
|
235
235
|
let scripts = "";
|
|
@@ -672,7 +672,7 @@ function Dynamic(props) {
|
|
|
672
672
|
if (comp) {
|
|
673
673
|
if (t === "function") return comp(others);else if (t === "string") {
|
|
674
674
|
const [local, sOthers] = splitProps(others, ["children"]);
|
|
675
|
-
return ssr([`<${comp}`, ' ', ">", `</${comp}>`], ssrHydrationKey(), ssrSpread(sOthers), local.children || "");
|
|
675
|
+
return ssr([`<${comp}`, ' ', ">", `</${comp}>`], ssrHydrationKey(), ssrSpread(sOthers), escape(local.children || ""));
|
|
676
676
|
}
|
|
677
677
|
}
|
|
678
678
|
}
|
package/web/dist/web.cjs
CHANGED
|
@@ -336,6 +336,10 @@ function eventHandler(e) {
|
|
|
336
336
|
return node || document;
|
|
337
337
|
}
|
|
338
338
|
});
|
|
339
|
+
if (window._$HY && !solidJs.sharedConfig.done) {
|
|
340
|
+
solidJs.sharedConfig.done = true;
|
|
341
|
+
document.querySelectorAll("[id^=pl-]").forEach(elem => elem.remove());
|
|
342
|
+
}
|
|
339
343
|
while (node !== null) {
|
|
340
344
|
const handler = node[key];
|
|
341
345
|
if (handler && !node.disabled) {
|
package/web/dist/web.js
CHANGED
|
@@ -333,6 +333,10 @@ function eventHandler(e) {
|
|
|
333
333
|
return node || document;
|
|
334
334
|
}
|
|
335
335
|
});
|
|
336
|
+
if (window._$HY && !sharedConfig.done) {
|
|
337
|
+
sharedConfig.done = true;
|
|
338
|
+
document.querySelectorAll("[id^=pl-]").forEach(elem => elem.remove());
|
|
339
|
+
}
|
|
336
340
|
while (node !== null) {
|
|
337
341
|
const handler = node[key];
|
|
338
342
|
if (handler && !node.disabled) {
|