solid-js 1.8.10 → 1.8.12
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/package.json +1 -1
- package/store/dist/dev.cjs +12 -2
- package/store/dist/dev.js +16 -2
- package/store/dist/store.cjs +12 -2
- package/store/dist/store.js +16 -2
- package/web/dist/dev.cjs +6 -3
- package/web/dist/dev.js +8 -3
- package/web/dist/server.cjs +10 -15
- package/web/dist/server.js +15 -12
- package/web/dist/web.cjs +3 -3
- package/web/dist/web.js +3 -3
package/package.json
CHANGED
package/store/dist/dev.cjs
CHANGED
|
@@ -281,19 +281,29 @@ function wrap(value) {
|
|
|
281
281
|
});
|
|
282
282
|
const keys = Object.keys(value),
|
|
283
283
|
desc = Object.getOwnPropertyDescriptors(value);
|
|
284
|
+
const proto = Object.getPrototypeOf(value);
|
|
285
|
+
const isClass = value !== null && typeof value === "object" && !Array.isArray(value) && proto !== Object.prototype;
|
|
286
|
+
if (isClass) {
|
|
287
|
+
const descriptors = Object.getOwnPropertyDescriptors(proto);
|
|
288
|
+
keys.push(...Object.keys(descriptors));
|
|
289
|
+
Object.assign(desc, descriptors);
|
|
290
|
+
}
|
|
284
291
|
for (let i = 0, l = keys.length; i < l; i++) {
|
|
285
292
|
const prop = keys[i];
|
|
293
|
+
if (isClass && prop === "constructor") continue;
|
|
286
294
|
if (desc[prop].get) {
|
|
287
295
|
const get = desc[prop].get.bind(p);
|
|
288
296
|
Object.defineProperty(value, prop, {
|
|
289
|
-
get
|
|
297
|
+
get,
|
|
298
|
+
configurable: true
|
|
290
299
|
});
|
|
291
300
|
}
|
|
292
301
|
if (desc[prop].set) {
|
|
293
302
|
const og = desc[prop].set,
|
|
294
303
|
set = v => solidJs.batch(() => og.call(p, v));
|
|
295
304
|
Object.defineProperty(value, prop, {
|
|
296
|
-
set
|
|
305
|
+
set,
|
|
306
|
+
configurable: true
|
|
297
307
|
});
|
|
298
308
|
}
|
|
299
309
|
}
|
package/store/dist/dev.js
CHANGED
|
@@ -322,19 +322,33 @@ function wrap(value) {
|
|
|
322
322
|
});
|
|
323
323
|
const keys = Object.keys(value),
|
|
324
324
|
desc = Object.getOwnPropertyDescriptors(value);
|
|
325
|
+
const proto = Object.getPrototypeOf(value);
|
|
326
|
+
const isClass =
|
|
327
|
+
value !== null &&
|
|
328
|
+
typeof value === "object" &&
|
|
329
|
+
!Array.isArray(value) &&
|
|
330
|
+
proto !== Object.prototype;
|
|
331
|
+
if (isClass) {
|
|
332
|
+
const descriptors = Object.getOwnPropertyDescriptors(proto);
|
|
333
|
+
keys.push(...Object.keys(descriptors));
|
|
334
|
+
Object.assign(desc, descriptors);
|
|
335
|
+
}
|
|
325
336
|
for (let i = 0, l = keys.length; i < l; i++) {
|
|
326
337
|
const prop = keys[i];
|
|
338
|
+
if (isClass && prop === "constructor") continue;
|
|
327
339
|
if (desc[prop].get) {
|
|
328
340
|
const get = desc[prop].get.bind(p);
|
|
329
341
|
Object.defineProperty(value, prop, {
|
|
330
|
-
get
|
|
342
|
+
get,
|
|
343
|
+
configurable: true
|
|
331
344
|
});
|
|
332
345
|
}
|
|
333
346
|
if (desc[prop].set) {
|
|
334
347
|
const og = desc[prop].set,
|
|
335
348
|
set = v => batch(() => og.call(p, v));
|
|
336
349
|
Object.defineProperty(value, prop, {
|
|
337
|
-
set
|
|
350
|
+
set,
|
|
351
|
+
configurable: true
|
|
338
352
|
});
|
|
339
353
|
}
|
|
340
354
|
}
|
package/store/dist/store.cjs
CHANGED
|
@@ -270,19 +270,29 @@ function wrap(value) {
|
|
|
270
270
|
});
|
|
271
271
|
const keys = Object.keys(value),
|
|
272
272
|
desc = Object.getOwnPropertyDescriptors(value);
|
|
273
|
+
const proto = Object.getPrototypeOf(value);
|
|
274
|
+
const isClass = value !== null && typeof value === "object" && !Array.isArray(value) && proto !== Object.prototype;
|
|
275
|
+
if (isClass) {
|
|
276
|
+
const descriptors = Object.getOwnPropertyDescriptors(proto);
|
|
277
|
+
keys.push(...Object.keys(descriptors));
|
|
278
|
+
Object.assign(desc, descriptors);
|
|
279
|
+
}
|
|
273
280
|
for (let i = 0, l = keys.length; i < l; i++) {
|
|
274
281
|
const prop = keys[i];
|
|
282
|
+
if (isClass && prop === "constructor") continue;
|
|
275
283
|
if (desc[prop].get) {
|
|
276
284
|
const get = desc[prop].get.bind(p);
|
|
277
285
|
Object.defineProperty(value, prop, {
|
|
278
|
-
get
|
|
286
|
+
get,
|
|
287
|
+
configurable: true
|
|
279
288
|
});
|
|
280
289
|
}
|
|
281
290
|
if (desc[prop].set) {
|
|
282
291
|
const og = desc[prop].set,
|
|
283
292
|
set = v => solidJs.batch(() => og.call(p, v));
|
|
284
293
|
Object.defineProperty(value, prop, {
|
|
285
|
-
set
|
|
294
|
+
set,
|
|
295
|
+
configurable: true
|
|
286
296
|
});
|
|
287
297
|
}
|
|
288
298
|
}
|
package/store/dist/store.js
CHANGED
|
@@ -308,19 +308,33 @@ function wrap(value) {
|
|
|
308
308
|
});
|
|
309
309
|
const keys = Object.keys(value),
|
|
310
310
|
desc = Object.getOwnPropertyDescriptors(value);
|
|
311
|
+
const proto = Object.getPrototypeOf(value);
|
|
312
|
+
const isClass =
|
|
313
|
+
value !== null &&
|
|
314
|
+
typeof value === "object" &&
|
|
315
|
+
!Array.isArray(value) &&
|
|
316
|
+
proto !== Object.prototype;
|
|
317
|
+
if (isClass) {
|
|
318
|
+
const descriptors = Object.getOwnPropertyDescriptors(proto);
|
|
319
|
+
keys.push(...Object.keys(descriptors));
|
|
320
|
+
Object.assign(desc, descriptors);
|
|
321
|
+
}
|
|
311
322
|
for (let i = 0, l = keys.length; i < l; i++) {
|
|
312
323
|
const prop = keys[i];
|
|
324
|
+
if (isClass && prop === "constructor") continue;
|
|
313
325
|
if (desc[prop].get) {
|
|
314
326
|
const get = desc[prop].get.bind(p);
|
|
315
327
|
Object.defineProperty(value, prop, {
|
|
316
|
-
get
|
|
328
|
+
get,
|
|
329
|
+
configurable: true
|
|
317
330
|
});
|
|
318
331
|
}
|
|
319
332
|
if (desc[prop].set) {
|
|
320
333
|
const og = desc[prop].set,
|
|
321
334
|
set = v => batch(() => og.call(p, v));
|
|
322
335
|
Object.defineProperty(value, prop, {
|
|
323
|
-
set
|
|
336
|
+
set,
|
|
337
|
+
configurable: true
|
|
324
338
|
});
|
|
325
339
|
}
|
|
326
340
|
}
|
package/web/dist/dev.cjs
CHANGED
|
@@ -109,6 +109,9 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
109
109
|
|
|
110
110
|
const $$EVENTS = "_$DX_DELEGATE";
|
|
111
111
|
function render(code, element, init, options = {}) {
|
|
112
|
+
if (!element) {
|
|
113
|
+
throw new Error("The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.");
|
|
114
|
+
}
|
|
112
115
|
let disposer;
|
|
113
116
|
solidJs.createRoot(dispose => {
|
|
114
117
|
disposer = dispose;
|
|
@@ -335,7 +338,7 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
335
338
|
let isCE, isProp, isChildProp, propAlias, forceProp;
|
|
336
339
|
if (prop === "style") return style(node, value, prev);
|
|
337
340
|
if (prop === "classList") return classList(node, value, prev);
|
|
338
|
-
if (value === prev
|
|
341
|
+
if (value === prev) return prev;
|
|
339
342
|
if (prop === "ref") {
|
|
340
343
|
if (!skipRef) value(node);
|
|
341
344
|
} else if (prop.slice(0, 3) === "on:") {
|
|
@@ -418,7 +421,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
418
421
|
if (multi) {
|
|
419
422
|
let node = current[0];
|
|
420
423
|
if (node && node.nodeType === 3) {
|
|
421
|
-
node.data = value;
|
|
424
|
+
node.data !== value && (node.data = value);
|
|
422
425
|
} else node = document.createTextNode(value);
|
|
423
426
|
current = cleanChildren(parent, current, marker, node);
|
|
424
427
|
} else {
|
|
@@ -536,7 +539,7 @@ function NoHydration(props) {
|
|
|
536
539
|
function Hydration(props) {
|
|
537
540
|
return props.children;
|
|
538
541
|
}
|
|
539
|
-
|
|
542
|
+
const voidFn = () => undefined;
|
|
540
543
|
const RequestContext = Symbol();
|
|
541
544
|
function innerHTML(parent, content) {
|
|
542
545
|
!solidJs.sharedConfig.context && (parent.innerHTML = content);
|
package/web/dist/dev.js
CHANGED
|
@@ -553,6 +553,11 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
553
553
|
|
|
554
554
|
const $$EVENTS = "_$DX_DELEGATE";
|
|
555
555
|
function render(code, element, init, options = {}) {
|
|
556
|
+
if (!element) {
|
|
557
|
+
throw new Error(
|
|
558
|
+
"The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document."
|
|
559
|
+
);
|
|
560
|
+
}
|
|
556
561
|
let disposer;
|
|
557
562
|
createRoot(dispose => {
|
|
558
563
|
disposer = dispose;
|
|
@@ -791,7 +796,7 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
791
796
|
let isCE, isProp, isChildProp, propAlias, forceProp;
|
|
792
797
|
if (prop === "style") return style(node, value, prev);
|
|
793
798
|
if (prop === "classList") return classList(node, value, prev);
|
|
794
|
-
if (value === prev
|
|
799
|
+
if (value === prev) return prev;
|
|
795
800
|
if (prop === "ref") {
|
|
796
801
|
if (!skipRef) value(node);
|
|
797
802
|
} else if (prop.slice(0, 3) === "on:") {
|
|
@@ -884,7 +889,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
884
889
|
if (multi) {
|
|
885
890
|
let node = current[0];
|
|
886
891
|
if (node && node.nodeType === 3) {
|
|
887
|
-
node.data = value;
|
|
892
|
+
node.data !== value && (node.data = value);
|
|
888
893
|
} else node = document.createTextNode(value);
|
|
889
894
|
current = cleanChildren(parent, current, marker, node);
|
|
890
895
|
} else {
|
|
@@ -1012,7 +1017,7 @@ function NoHydration(props) {
|
|
|
1012
1017
|
function Hydration(props) {
|
|
1013
1018
|
return props.children;
|
|
1014
1019
|
}
|
|
1015
|
-
|
|
1020
|
+
const voidFn = () => undefined;
|
|
1016
1021
|
const RequestContext = Symbol();
|
|
1017
1022
|
function innerHTML(parent, content) {
|
|
1018
1023
|
!sharedConfig.context && (parent.innerHTML = content);
|
package/web/dist/server.cjs
CHANGED
|
@@ -13,7 +13,6 @@ const Aliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
const ES2017FLAG = seroval.Feature.AggregateError
|
|
16
|
-
| seroval.Feature.BigInt
|
|
17
16
|
| seroval.Feature.BigIntTypedArray;
|
|
18
17
|
const GLOBAL_IDENTIFIER = '_$HY.r';
|
|
19
18
|
function createSerializer({
|
|
@@ -133,7 +132,7 @@ function renderToStream(code, options = {}) {
|
|
|
133
132
|
});
|
|
134
133
|
const flushEnd = () => {
|
|
135
134
|
if (!registry.size) {
|
|
136
|
-
serializer.flush();
|
|
135
|
+
queue(() => queue(() => serializer.flush()));
|
|
137
136
|
}
|
|
138
137
|
};
|
|
139
138
|
const registry = new Map();
|
|
@@ -198,36 +197,32 @@ function renderToStream(code, options = {}) {
|
|
|
198
197
|
if (!registry.has(key)) {
|
|
199
198
|
let resolve, reject;
|
|
200
199
|
const p = new Promise((r, rej) => (resolve = r, reject = rej));
|
|
201
|
-
registry.set(key, {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
});
|
|
200
|
+
registry.set(key, err => queue(() => queue(() => {
|
|
201
|
+
err ? reject(err) : resolve(true);
|
|
202
|
+
queue(flushEnd);
|
|
203
|
+
})));
|
|
205
204
|
serializer.write(key, p);
|
|
206
205
|
}
|
|
207
206
|
return (value, error) => {
|
|
208
207
|
if (registry.has(key)) {
|
|
209
|
-
const
|
|
210
|
-
resolve,
|
|
211
|
-
reject
|
|
212
|
-
} = registry.get(key);
|
|
208
|
+
const resolve = registry.get(key);
|
|
213
209
|
registry.delete(key);
|
|
214
210
|
if (waitForFragments(registry, key)) {
|
|
215
|
-
resolve(
|
|
211
|
+
resolve();
|
|
216
212
|
return;
|
|
217
213
|
}
|
|
218
|
-
if (
|
|
214
|
+
if (!completed) {
|
|
219
215
|
if (!firstFlushed) {
|
|
220
216
|
queue(() => html = replacePlaceholder(html, key, value !== undefined ? value : ""));
|
|
221
|
-
|
|
217
|
+
resolve(error);
|
|
222
218
|
} else {
|
|
223
219
|
buffer.write(`<template id="${key}">${value !== undefined ? value : " "}</template>`);
|
|
224
220
|
pushTask(`$df("${key}")${!scriptFlushed ? ";" + REPLACE_SCRIPT : ""}`);
|
|
225
|
-
|
|
221
|
+
resolve(error);
|
|
226
222
|
scriptFlushed = true;
|
|
227
223
|
}
|
|
228
224
|
}
|
|
229
225
|
}
|
|
230
|
-
if (!registry.size) queue(flushEnd);
|
|
231
226
|
return firstFlushed;
|
|
232
227
|
};
|
|
233
228
|
}
|
package/web/dist/server.js
CHANGED
|
@@ -64,7 +64,7 @@ const Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {
|
|
|
64
64
|
htmlFor: "for"
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
-
const ES2017FLAG = Feature.AggregateError | Feature.
|
|
67
|
+
const ES2017FLAG = Feature.AggregateError | Feature.BigIntTypedArray;
|
|
68
68
|
const GLOBAL_IDENTIFIER = "_$HY.r";
|
|
69
69
|
function createSerializer({ onData, onDone, scopeId, onError }) {
|
|
70
70
|
return new Serializer({
|
|
@@ -179,7 +179,7 @@ function renderToStream(code, options = {}) {
|
|
|
179
179
|
});
|
|
180
180
|
const flushEnd = () => {
|
|
181
181
|
if (!registry.size) {
|
|
182
|
-
serializer.flush();
|
|
182
|
+
queue(() => queue(() => serializer.flush()));
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
185
|
const registry = new Map();
|
|
@@ -250,33 +250,36 @@ function renderToStream(code, options = {}) {
|
|
|
250
250
|
if (!registry.has(key)) {
|
|
251
251
|
let resolve, reject;
|
|
252
252
|
const p = new Promise((r, rej) => ((resolve = r), (reject = rej)));
|
|
253
|
-
registry.set(key,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
253
|
+
registry.set(key, err =>
|
|
254
|
+
queue(() =>
|
|
255
|
+
queue(() => {
|
|
256
|
+
err ? reject(err) : resolve(true);
|
|
257
|
+
queue(flushEnd);
|
|
258
|
+
})
|
|
259
|
+
)
|
|
260
|
+
);
|
|
257
261
|
serializer.write(key, p);
|
|
258
262
|
}
|
|
259
263
|
return (value, error) => {
|
|
260
264
|
if (registry.has(key)) {
|
|
261
|
-
const
|
|
265
|
+
const resolve = registry.get(key);
|
|
262
266
|
registry.delete(key);
|
|
263
267
|
if (waitForFragments(registry, key)) {
|
|
264
|
-
resolve(
|
|
268
|
+
resolve();
|
|
265
269
|
return;
|
|
266
270
|
}
|
|
267
|
-
if (
|
|
271
|
+
if (!completed) {
|
|
268
272
|
if (!firstFlushed) {
|
|
269
273
|
queue(() => (html = replacePlaceholder(html, key, value !== undefined ? value : "")));
|
|
270
|
-
|
|
274
|
+
resolve(error);
|
|
271
275
|
} else {
|
|
272
276
|
buffer.write(`<template id="${key}">${value !== undefined ? value : " "}</template>`);
|
|
273
277
|
pushTask(`$df("${key}")${!scriptFlushed ? ";" + REPLACE_SCRIPT : ""}`);
|
|
274
|
-
|
|
278
|
+
resolve(error);
|
|
275
279
|
scriptFlushed = true;
|
|
276
280
|
}
|
|
277
281
|
}
|
|
278
282
|
}
|
|
279
|
-
if (!registry.size) queue(flushEnd);
|
|
280
283
|
return firstFlushed;
|
|
281
284
|
};
|
|
282
285
|
}
|
package/web/dist/web.cjs
CHANGED
|
@@ -333,7 +333,7 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
333
333
|
let isCE, isProp, isChildProp, propAlias, forceProp;
|
|
334
334
|
if (prop === "style") return style(node, value, prev);
|
|
335
335
|
if (prop === "classList") return classList(node, value, prev);
|
|
336
|
-
if (value === prev
|
|
336
|
+
if (value === prev) return prev;
|
|
337
337
|
if (prop === "ref") {
|
|
338
338
|
if (!skipRef) value(node);
|
|
339
339
|
} else if (prop.slice(0, 3) === "on:") {
|
|
@@ -416,7 +416,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
416
416
|
if (multi) {
|
|
417
417
|
let node = current[0];
|
|
418
418
|
if (node && node.nodeType === 3) {
|
|
419
|
-
node.data = value;
|
|
419
|
+
node.data !== value && (node.data = value);
|
|
420
420
|
} else node = document.createTextNode(value);
|
|
421
421
|
current = cleanChildren(parent, current, marker, node);
|
|
422
422
|
} else {
|
|
@@ -534,7 +534,7 @@ function NoHydration(props) {
|
|
|
534
534
|
function Hydration(props) {
|
|
535
535
|
return props.children;
|
|
536
536
|
}
|
|
537
|
-
|
|
537
|
+
const voidFn = () => undefined;
|
|
538
538
|
const RequestContext = Symbol();
|
|
539
539
|
function innerHTML(parent, content) {
|
|
540
540
|
!solidJs.sharedConfig.context && (parent.innerHTML = content);
|
package/web/dist/web.js
CHANGED
|
@@ -784,7 +784,7 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
784
784
|
let isCE, isProp, isChildProp, propAlias, forceProp;
|
|
785
785
|
if (prop === "style") return style(node, value, prev);
|
|
786
786
|
if (prop === "classList") return classList(node, value, prev);
|
|
787
|
-
if (value === prev
|
|
787
|
+
if (value === prev) return prev;
|
|
788
788
|
if (prop === "ref") {
|
|
789
789
|
if (!skipRef) value(node);
|
|
790
790
|
} else if (prop.slice(0, 3) === "on:") {
|
|
@@ -877,7 +877,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
877
877
|
if (multi) {
|
|
878
878
|
let node = current[0];
|
|
879
879
|
if (node && node.nodeType === 3) {
|
|
880
|
-
node.data = value;
|
|
880
|
+
node.data !== value && (node.data = value);
|
|
881
881
|
} else node = document.createTextNode(value);
|
|
882
882
|
current = cleanChildren(parent, current, marker, node);
|
|
883
883
|
} else {
|
|
@@ -1005,7 +1005,7 @@ function NoHydration(props) {
|
|
|
1005
1005
|
function Hydration(props) {
|
|
1006
1006
|
return props.children;
|
|
1007
1007
|
}
|
|
1008
|
-
|
|
1008
|
+
const voidFn = () => undefined;
|
|
1009
1009
|
const RequestContext = Symbol();
|
|
1010
1010
|
function innerHTML(parent, content) {
|
|
1011
1011
|
!sharedConfig.context && (parent.innerHTML = content);
|