solid-js 1.7.6 → 1.7.8
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 +35 -16
- package/dist/dev.js +35 -16
- package/dist/server.cjs +9 -5
- package/dist/server.js +9 -5
- package/dist/solid.cjs +35 -16
- package/dist/solid.js +35 -16
- package/h/jsx-runtime/types/jsx.d.ts +127 -100
- package/package.json +55 -109
- package/store/package.json +14 -28
- package/types/jsx.d.ts +7 -6
- package/types/reactive/signal.d.ts +1 -1
- package/types/render/hydration.d.ts +3 -0
- package/types/server/reactive.d.ts +1 -1
- package/universal/package.json +4 -8
- package/web/dist/dev.cjs +2 -2
- package/web/dist/dev.js +3 -3
- package/web/dist/server.cjs +4 -4
- package/web/dist/server.js +4 -4
- package/web/dist/web.cjs +2 -2
- package/web/dist/web.js +3 -3
- package/web/package.json +14 -28
package/dist/dev.cjs
CHANGED
|
@@ -880,7 +880,18 @@ 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)
|
|
883
|
+
if (sharedConfig.context) {
|
|
884
|
+
if (sharedConfig.count) {
|
|
885
|
+
sharedConfig.effects || (sharedConfig.effects = []);
|
|
886
|
+
sharedConfig.effects.push(...queue.slice(0, userLength));
|
|
887
|
+
return;
|
|
888
|
+
} else if (sharedConfig.effects) {
|
|
889
|
+
queue = [...sharedConfig.effects, ...queue];
|
|
890
|
+
userLength += sharedConfig.effects.length;
|
|
891
|
+
delete sharedConfig.effects;
|
|
892
|
+
}
|
|
893
|
+
setHydrateContext();
|
|
894
|
+
}
|
|
884
895
|
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
885
896
|
}
|
|
886
897
|
function lookUpstream(node, ignore) {
|
|
@@ -958,19 +969,23 @@ function castError(err) {
|
|
|
958
969
|
cause: err
|
|
959
970
|
});
|
|
960
971
|
}
|
|
961
|
-
function runErrors(fns,
|
|
962
|
-
|
|
972
|
+
function runErrors(err, fns, owner) {
|
|
973
|
+
try {
|
|
974
|
+
for (const f of fns) f(err);
|
|
975
|
+
} catch (e) {
|
|
976
|
+
handleError(e, owner && owner.owner || null);
|
|
977
|
+
}
|
|
963
978
|
}
|
|
964
|
-
function handleError(err) {
|
|
965
|
-
const fns = ERROR && lookup(
|
|
966
|
-
if (!fns) throw err;
|
|
979
|
+
function handleError(err, owner = Owner) {
|
|
980
|
+
const fns = ERROR && lookup(owner, ERROR);
|
|
967
981
|
const error = castError(err);
|
|
982
|
+
if (!fns) throw error;
|
|
968
983
|
if (Effects) Effects.push({
|
|
969
984
|
fn() {
|
|
970
|
-
runErrors(fns,
|
|
985
|
+
runErrors(error, fns, owner);
|
|
971
986
|
},
|
|
972
987
|
state: STALE
|
|
973
|
-
});else runErrors(fns,
|
|
988
|
+
});else runErrors(error, fns, owner);
|
|
974
989
|
}
|
|
975
990
|
function lookup(owner, key) {
|
|
976
991
|
return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;
|
|
@@ -1301,28 +1316,29 @@ function mergeProps(...sources) {
|
|
|
1301
1316
|
}
|
|
1302
1317
|
const target = {};
|
|
1303
1318
|
const sourcesMap = {};
|
|
1304
|
-
|
|
1319
|
+
const defined = new Set();
|
|
1305
1320
|
for (let i = sources.length - 1; i >= 0; i--) {
|
|
1306
1321
|
const source = sources[i];
|
|
1307
1322
|
if (!source) continue;
|
|
1308
1323
|
const sourceKeys = Object.getOwnPropertyNames(source);
|
|
1309
|
-
someNonTargetKey = someNonTargetKey || i !== 0 && !!sourceKeys.length;
|
|
1310
1324
|
for (let i = 0, length = sourceKeys.length; i < length; i++) {
|
|
1311
1325
|
const key = sourceKeys[i];
|
|
1312
|
-
if (key === "__proto__" || key === "constructor")
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1326
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
1327
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1328
|
+
if (!defined.has(key)) {
|
|
1316
1329
|
if (desc.get) {
|
|
1330
|
+
defined.add(key);
|
|
1317
1331
|
Object.defineProperty(target, key, {
|
|
1318
1332
|
enumerable: true,
|
|
1319
1333
|
configurable: true,
|
|
1320
1334
|
get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])
|
|
1321
1335
|
});
|
|
1322
|
-
} else
|
|
1336
|
+
} else {
|
|
1337
|
+
if (desc.value !== undefined) defined.add(key);
|
|
1338
|
+
target[key] = desc.value;
|
|
1339
|
+
}
|
|
1323
1340
|
} else {
|
|
1324
1341
|
const sources = sourcesMap[key];
|
|
1325
|
-
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1326
1342
|
if (sources) {
|
|
1327
1343
|
if (desc.get) {
|
|
1328
1344
|
sources.push(desc.get.bind(source));
|
|
@@ -1391,8 +1407,11 @@ function lazy(fn) {
|
|
|
1391
1407
|
const ctx = sharedConfig.context;
|
|
1392
1408
|
if (ctx) {
|
|
1393
1409
|
const [s, set] = createSignal();
|
|
1410
|
+
sharedConfig.count || (sharedConfig.count = 0);
|
|
1411
|
+
sharedConfig.count++;
|
|
1394
1412
|
(p || (p = fn())).then(mod => {
|
|
1395
1413
|
setHydrateContext(ctx);
|
|
1414
|
+
sharedConfig.count--;
|
|
1396
1415
|
set(() => mod.default);
|
|
1397
1416
|
setHydrateContext();
|
|
1398
1417
|
});
|
package/dist/dev.js
CHANGED
|
@@ -878,7 +878,18 @@ function runUserEffects(queue) {
|
|
|
878
878
|
const e = queue[i];
|
|
879
879
|
if (!e.user) runTop(e);else queue[userLength++] = e;
|
|
880
880
|
}
|
|
881
|
-
if (sharedConfig.context)
|
|
881
|
+
if (sharedConfig.context) {
|
|
882
|
+
if (sharedConfig.count) {
|
|
883
|
+
sharedConfig.effects || (sharedConfig.effects = []);
|
|
884
|
+
sharedConfig.effects.push(...queue.slice(0, userLength));
|
|
885
|
+
return;
|
|
886
|
+
} else if (sharedConfig.effects) {
|
|
887
|
+
queue = [...sharedConfig.effects, ...queue];
|
|
888
|
+
userLength += sharedConfig.effects.length;
|
|
889
|
+
delete sharedConfig.effects;
|
|
890
|
+
}
|
|
891
|
+
setHydrateContext();
|
|
892
|
+
}
|
|
882
893
|
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
883
894
|
}
|
|
884
895
|
function lookUpstream(node, ignore) {
|
|
@@ -956,19 +967,23 @@ function castError(err) {
|
|
|
956
967
|
cause: err
|
|
957
968
|
});
|
|
958
969
|
}
|
|
959
|
-
function runErrors(fns,
|
|
960
|
-
|
|
970
|
+
function runErrors(err, fns, owner) {
|
|
971
|
+
try {
|
|
972
|
+
for (const f of fns) f(err);
|
|
973
|
+
} catch (e) {
|
|
974
|
+
handleError(e, owner && owner.owner || null);
|
|
975
|
+
}
|
|
961
976
|
}
|
|
962
|
-
function handleError(err) {
|
|
963
|
-
const fns = ERROR && lookup(
|
|
964
|
-
if (!fns) throw err;
|
|
977
|
+
function handleError(err, owner = Owner) {
|
|
978
|
+
const fns = ERROR && lookup(owner, ERROR);
|
|
965
979
|
const error = castError(err);
|
|
980
|
+
if (!fns) throw error;
|
|
966
981
|
if (Effects) Effects.push({
|
|
967
982
|
fn() {
|
|
968
|
-
runErrors(fns,
|
|
983
|
+
runErrors(error, fns, owner);
|
|
969
984
|
},
|
|
970
985
|
state: STALE
|
|
971
|
-
});else runErrors(fns,
|
|
986
|
+
});else runErrors(error, fns, owner);
|
|
972
987
|
}
|
|
973
988
|
function lookup(owner, key) {
|
|
974
989
|
return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;
|
|
@@ -1299,28 +1314,29 @@ function mergeProps(...sources) {
|
|
|
1299
1314
|
}
|
|
1300
1315
|
const target = {};
|
|
1301
1316
|
const sourcesMap = {};
|
|
1302
|
-
|
|
1317
|
+
const defined = new Set();
|
|
1303
1318
|
for (let i = sources.length - 1; i >= 0; i--) {
|
|
1304
1319
|
const source = sources[i];
|
|
1305
1320
|
if (!source) continue;
|
|
1306
1321
|
const sourceKeys = Object.getOwnPropertyNames(source);
|
|
1307
|
-
someNonTargetKey = someNonTargetKey || i !== 0 && !!sourceKeys.length;
|
|
1308
1322
|
for (let i = 0, length = sourceKeys.length; i < length; i++) {
|
|
1309
1323
|
const key = sourceKeys[i];
|
|
1310
|
-
if (key === "__proto__" || key === "constructor")
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1324
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
1325
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1326
|
+
if (!defined.has(key)) {
|
|
1314
1327
|
if (desc.get) {
|
|
1328
|
+
defined.add(key);
|
|
1315
1329
|
Object.defineProperty(target, key, {
|
|
1316
1330
|
enumerable: true,
|
|
1317
1331
|
configurable: true,
|
|
1318
1332
|
get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])
|
|
1319
1333
|
});
|
|
1320
|
-
} else
|
|
1334
|
+
} else {
|
|
1335
|
+
if (desc.value !== undefined) defined.add(key);
|
|
1336
|
+
target[key] = desc.value;
|
|
1337
|
+
}
|
|
1321
1338
|
} else {
|
|
1322
1339
|
const sources = sourcesMap[key];
|
|
1323
|
-
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1324
1340
|
if (sources) {
|
|
1325
1341
|
if (desc.get) {
|
|
1326
1342
|
sources.push(desc.get.bind(source));
|
|
@@ -1389,8 +1405,11 @@ function lazy(fn) {
|
|
|
1389
1405
|
const ctx = sharedConfig.context;
|
|
1390
1406
|
if (ctx) {
|
|
1391
1407
|
const [s, set] = createSignal();
|
|
1408
|
+
sharedConfig.count || (sharedConfig.count = 0);
|
|
1409
|
+
sharedConfig.count++;
|
|
1392
1410
|
(p || (p = fn())).then(mod => {
|
|
1393
1411
|
setHydrateContext(ctx);
|
|
1412
|
+
sharedConfig.count--;
|
|
1394
1413
|
set(() => mod.default);
|
|
1395
1414
|
setHydrateContext();
|
|
1396
1415
|
});
|
package/dist/server.cjs
CHANGED
|
@@ -12,11 +12,15 @@ function castError(err) {
|
|
|
12
12
|
cause: err
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
function handleError(err) {
|
|
15
|
+
function handleError(err, owner = Owner) {
|
|
16
|
+
const fns = lookup(owner, ERROR);
|
|
16
17
|
const error = castError(err);
|
|
17
|
-
const fns = lookup(Owner, ERROR);
|
|
18
18
|
if (!fns) throw error;
|
|
19
|
-
|
|
19
|
+
try {
|
|
20
|
+
for (const f of fns) f(error);
|
|
21
|
+
} catch (e) {
|
|
22
|
+
handleError(e, owner && owner.owner || null);
|
|
23
|
+
}
|
|
20
24
|
}
|
|
21
25
|
const UNOWNED = {
|
|
22
26
|
context: null,
|
|
@@ -420,7 +424,7 @@ function ErrorBoundary(props) {
|
|
|
420
424
|
if (error) return displayFallback();
|
|
421
425
|
sync = false;
|
|
422
426
|
return {
|
|
423
|
-
t:
|
|
427
|
+
t: `<!--!$e${id}-->${resolveSSRNode(res)}<!--!$/e${id}-->`
|
|
424
428
|
};
|
|
425
429
|
}
|
|
426
430
|
const SuspenseContext = createContext();
|
|
@@ -631,7 +635,7 @@ function Suspense(props) {
|
|
|
631
635
|
noHydrate: true
|
|
632
636
|
});
|
|
633
637
|
const res = {
|
|
634
|
-
t: `<template id="pl-${id}"></template>${resolveSSRNode(props.fallback)}
|
|
638
|
+
t: `<template id="pl-${id}"></template>${resolveSSRNode(props.fallback)}<!--pl-${id}-->`
|
|
635
639
|
};
|
|
636
640
|
setHydrateContext(ctx);
|
|
637
641
|
return res;
|
package/dist/server.js
CHANGED
|
@@ -10,11 +10,15 @@ function castError(err) {
|
|
|
10
10
|
cause: err
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
function handleError(err) {
|
|
13
|
+
function handleError(err, owner = Owner) {
|
|
14
|
+
const fns = lookup(owner, ERROR);
|
|
14
15
|
const error = castError(err);
|
|
15
|
-
const fns = lookup(Owner, ERROR);
|
|
16
16
|
if (!fns) throw error;
|
|
17
|
-
|
|
17
|
+
try {
|
|
18
|
+
for (const f of fns) f(error);
|
|
19
|
+
} catch (e) {
|
|
20
|
+
handleError(e, owner && owner.owner || null);
|
|
21
|
+
}
|
|
18
22
|
}
|
|
19
23
|
const UNOWNED = {
|
|
20
24
|
context: null,
|
|
@@ -418,7 +422,7 @@ function ErrorBoundary(props) {
|
|
|
418
422
|
if (error) return displayFallback();
|
|
419
423
|
sync = false;
|
|
420
424
|
return {
|
|
421
|
-
t:
|
|
425
|
+
t: `<!--!$e${id}-->${resolveSSRNode(res)}<!--!$/e${id}-->`
|
|
422
426
|
};
|
|
423
427
|
}
|
|
424
428
|
const SuspenseContext = createContext();
|
|
@@ -629,7 +633,7 @@ function Suspense(props) {
|
|
|
629
633
|
noHydrate: true
|
|
630
634
|
});
|
|
631
635
|
const res = {
|
|
632
|
-
t: `<template id="pl-${id}"></template>${resolveSSRNode(props.fallback)}
|
|
636
|
+
t: `<template id="pl-${id}"></template>${resolveSSRNode(props.fallback)}<!--pl-${id}-->`
|
|
633
637
|
};
|
|
634
638
|
setHydrateContext(ctx);
|
|
635
639
|
return res;
|
package/dist/solid.cjs
CHANGED
|
@@ -840,7 +840,18 @@ function runUserEffects(queue) {
|
|
|
840
840
|
const e = queue[i];
|
|
841
841
|
if (!e.user) runTop(e);else queue[userLength++] = e;
|
|
842
842
|
}
|
|
843
|
-
if (sharedConfig.context)
|
|
843
|
+
if (sharedConfig.context) {
|
|
844
|
+
if (sharedConfig.count) {
|
|
845
|
+
sharedConfig.effects || (sharedConfig.effects = []);
|
|
846
|
+
sharedConfig.effects.push(...queue.slice(0, userLength));
|
|
847
|
+
return;
|
|
848
|
+
} else if (sharedConfig.effects) {
|
|
849
|
+
queue = [...sharedConfig.effects, ...queue];
|
|
850
|
+
userLength += sharedConfig.effects.length;
|
|
851
|
+
delete sharedConfig.effects;
|
|
852
|
+
}
|
|
853
|
+
setHydrateContext();
|
|
854
|
+
}
|
|
844
855
|
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
845
856
|
}
|
|
846
857
|
function lookUpstream(node, ignore) {
|
|
@@ -917,19 +928,23 @@ function castError(err) {
|
|
|
917
928
|
cause: err
|
|
918
929
|
});
|
|
919
930
|
}
|
|
920
|
-
function runErrors(fns,
|
|
921
|
-
|
|
931
|
+
function runErrors(err, fns, owner) {
|
|
932
|
+
try {
|
|
933
|
+
for (const f of fns) f(err);
|
|
934
|
+
} catch (e) {
|
|
935
|
+
handleError(e, owner && owner.owner || null);
|
|
936
|
+
}
|
|
922
937
|
}
|
|
923
|
-
function handleError(err) {
|
|
924
|
-
const fns = ERROR && lookup(
|
|
925
|
-
if (!fns) throw err;
|
|
938
|
+
function handleError(err, owner = Owner) {
|
|
939
|
+
const fns = ERROR && lookup(owner, ERROR);
|
|
926
940
|
const error = castError(err);
|
|
941
|
+
if (!fns) throw error;
|
|
927
942
|
if (Effects) Effects.push({
|
|
928
943
|
fn() {
|
|
929
|
-
runErrors(fns,
|
|
944
|
+
runErrors(error, fns, owner);
|
|
930
945
|
},
|
|
931
946
|
state: STALE
|
|
932
|
-
});else runErrors(fns,
|
|
947
|
+
});else runErrors(error, fns, owner);
|
|
933
948
|
}
|
|
934
949
|
function lookup(owner, key) {
|
|
935
950
|
return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;
|
|
@@ -1256,28 +1271,29 @@ function mergeProps(...sources) {
|
|
|
1256
1271
|
}
|
|
1257
1272
|
const target = {};
|
|
1258
1273
|
const sourcesMap = {};
|
|
1259
|
-
|
|
1274
|
+
const defined = new Set();
|
|
1260
1275
|
for (let i = sources.length - 1; i >= 0; i--) {
|
|
1261
1276
|
const source = sources[i];
|
|
1262
1277
|
if (!source) continue;
|
|
1263
1278
|
const sourceKeys = Object.getOwnPropertyNames(source);
|
|
1264
|
-
someNonTargetKey = someNonTargetKey || i !== 0 && !!sourceKeys.length;
|
|
1265
1279
|
for (let i = 0, length = sourceKeys.length; i < length; i++) {
|
|
1266
1280
|
const key = sourceKeys[i];
|
|
1267
|
-
if (key === "__proto__" || key === "constructor")
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1281
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
1282
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1283
|
+
if (!defined.has(key)) {
|
|
1271
1284
|
if (desc.get) {
|
|
1285
|
+
defined.add(key);
|
|
1272
1286
|
Object.defineProperty(target, key, {
|
|
1273
1287
|
enumerable: true,
|
|
1274
1288
|
configurable: true,
|
|
1275
1289
|
get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])
|
|
1276
1290
|
});
|
|
1277
|
-
} else
|
|
1291
|
+
} else {
|
|
1292
|
+
if (desc.value !== undefined) defined.add(key);
|
|
1293
|
+
target[key] = desc.value;
|
|
1294
|
+
}
|
|
1278
1295
|
} else {
|
|
1279
1296
|
const sources = sourcesMap[key];
|
|
1280
|
-
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1281
1297
|
if (sources) {
|
|
1282
1298
|
if (desc.get) {
|
|
1283
1299
|
sources.push(desc.get.bind(source));
|
|
@@ -1346,8 +1362,11 @@ function lazy(fn) {
|
|
|
1346
1362
|
const ctx = sharedConfig.context;
|
|
1347
1363
|
if (ctx) {
|
|
1348
1364
|
const [s, set] = createSignal();
|
|
1365
|
+
sharedConfig.count || (sharedConfig.count = 0);
|
|
1366
|
+
sharedConfig.count++;
|
|
1349
1367
|
(p || (p = fn())).then(mod => {
|
|
1350
1368
|
setHydrateContext(ctx);
|
|
1369
|
+
sharedConfig.count--;
|
|
1351
1370
|
set(() => mod.default);
|
|
1352
1371
|
setHydrateContext();
|
|
1353
1372
|
});
|
package/dist/solid.js
CHANGED
|
@@ -838,7 +838,18 @@ function runUserEffects(queue) {
|
|
|
838
838
|
const e = queue[i];
|
|
839
839
|
if (!e.user) runTop(e);else queue[userLength++] = e;
|
|
840
840
|
}
|
|
841
|
-
if (sharedConfig.context)
|
|
841
|
+
if (sharedConfig.context) {
|
|
842
|
+
if (sharedConfig.count) {
|
|
843
|
+
sharedConfig.effects || (sharedConfig.effects = []);
|
|
844
|
+
sharedConfig.effects.push(...queue.slice(0, userLength));
|
|
845
|
+
return;
|
|
846
|
+
} else if (sharedConfig.effects) {
|
|
847
|
+
queue = [...sharedConfig.effects, ...queue];
|
|
848
|
+
userLength += sharedConfig.effects.length;
|
|
849
|
+
delete sharedConfig.effects;
|
|
850
|
+
}
|
|
851
|
+
setHydrateContext();
|
|
852
|
+
}
|
|
842
853
|
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
843
854
|
}
|
|
844
855
|
function lookUpstream(node, ignore) {
|
|
@@ -915,19 +926,23 @@ function castError(err) {
|
|
|
915
926
|
cause: err
|
|
916
927
|
});
|
|
917
928
|
}
|
|
918
|
-
function runErrors(fns,
|
|
919
|
-
|
|
929
|
+
function runErrors(err, fns, owner) {
|
|
930
|
+
try {
|
|
931
|
+
for (const f of fns) f(err);
|
|
932
|
+
} catch (e) {
|
|
933
|
+
handleError(e, owner && owner.owner || null);
|
|
934
|
+
}
|
|
920
935
|
}
|
|
921
|
-
function handleError(err) {
|
|
922
|
-
const fns = ERROR && lookup(
|
|
923
|
-
if (!fns) throw err;
|
|
936
|
+
function handleError(err, owner = Owner) {
|
|
937
|
+
const fns = ERROR && lookup(owner, ERROR);
|
|
924
938
|
const error = castError(err);
|
|
939
|
+
if (!fns) throw error;
|
|
925
940
|
if (Effects) Effects.push({
|
|
926
941
|
fn() {
|
|
927
|
-
runErrors(fns,
|
|
942
|
+
runErrors(error, fns, owner);
|
|
928
943
|
},
|
|
929
944
|
state: STALE
|
|
930
|
-
});else runErrors(fns,
|
|
945
|
+
});else runErrors(error, fns, owner);
|
|
931
946
|
}
|
|
932
947
|
function lookup(owner, key) {
|
|
933
948
|
return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;
|
|
@@ -1254,28 +1269,29 @@ function mergeProps(...sources) {
|
|
|
1254
1269
|
}
|
|
1255
1270
|
const target = {};
|
|
1256
1271
|
const sourcesMap = {};
|
|
1257
|
-
|
|
1272
|
+
const defined = new Set();
|
|
1258
1273
|
for (let i = sources.length - 1; i >= 0; i--) {
|
|
1259
1274
|
const source = sources[i];
|
|
1260
1275
|
if (!source) continue;
|
|
1261
1276
|
const sourceKeys = Object.getOwnPropertyNames(source);
|
|
1262
|
-
someNonTargetKey = someNonTargetKey || i !== 0 && !!sourceKeys.length;
|
|
1263
1277
|
for (let i = 0, length = sourceKeys.length; i < length; i++) {
|
|
1264
1278
|
const key = sourceKeys[i];
|
|
1265
|
-
if (key === "__proto__" || key === "constructor")
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1279
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
1280
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1281
|
+
if (!defined.has(key)) {
|
|
1269
1282
|
if (desc.get) {
|
|
1283
|
+
defined.add(key);
|
|
1270
1284
|
Object.defineProperty(target, key, {
|
|
1271
1285
|
enumerable: true,
|
|
1272
1286
|
configurable: true,
|
|
1273
1287
|
get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])
|
|
1274
1288
|
});
|
|
1275
|
-
} else
|
|
1289
|
+
} else {
|
|
1290
|
+
if (desc.value !== undefined) defined.add(key);
|
|
1291
|
+
target[key] = desc.value;
|
|
1292
|
+
}
|
|
1276
1293
|
} else {
|
|
1277
1294
|
const sources = sourcesMap[key];
|
|
1278
|
-
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1279
1295
|
if (sources) {
|
|
1280
1296
|
if (desc.get) {
|
|
1281
1297
|
sources.push(desc.get.bind(source));
|
|
@@ -1344,8 +1360,11 @@ function lazy(fn) {
|
|
|
1344
1360
|
const ctx = sharedConfig.context;
|
|
1345
1361
|
if (ctx) {
|
|
1346
1362
|
const [s, set] = createSignal();
|
|
1363
|
+
sharedConfig.count || (sharedConfig.count = 0);
|
|
1364
|
+
sharedConfig.count++;
|
|
1347
1365
|
(p || (p = fn())).then(mod => {
|
|
1348
1366
|
setHydrateContext(ctx);
|
|
1367
|
+
sharedConfig.count--;
|
|
1349
1368
|
set(() => mod.default);
|
|
1350
1369
|
setHydrateContext();
|
|
1351
1370
|
});
|