solid-js 1.3.0-beta.6 → 1.3.0-beta.7
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 +13 -4
- package/dist/dev.js +13 -4
- package/dist/solid.cjs +13 -4
- package/dist/solid.js +13 -4
- package/package.json +2 -2
- package/web/dist/dev.cjs +1 -0
- package/web/dist/dev.js +1 -0
- package/web/dist/web.cjs +1 -0
- package/web/dist/web.js +1 -0
package/dist/dev.cjs
CHANGED
|
@@ -247,10 +247,13 @@ function createResource(source, fetcher, options) {
|
|
|
247
247
|
pr = null,
|
|
248
248
|
initP = null,
|
|
249
249
|
id = null,
|
|
250
|
+
ctx,
|
|
250
251
|
loadedUnderTransition = false,
|
|
251
252
|
dynamic = typeof source === "function";
|
|
252
253
|
if (sharedConfig.context) {
|
|
253
254
|
id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;
|
|
255
|
+
ctx = { ...sharedConfig.context
|
|
256
|
+
};
|
|
254
257
|
if (sharedConfig.load) initP = sharedConfig.load(id);
|
|
255
258
|
}
|
|
256
259
|
function loadEnd(p, v, e) {
|
|
@@ -268,7 +271,14 @@ function createResource(source, fetcher, options) {
|
|
|
268
271
|
}
|
|
269
272
|
completeLoad(v);
|
|
270
273
|
}, false);
|
|
271
|
-
} else
|
|
274
|
+
} else {
|
|
275
|
+
if (p === initP) setHydrateContext(ctx);
|
|
276
|
+
completeLoad(v);
|
|
277
|
+
if (p === initP) {
|
|
278
|
+
initP = null;
|
|
279
|
+
setHydrateContext();
|
|
280
|
+
}
|
|
281
|
+
}
|
|
272
282
|
}
|
|
273
283
|
return v;
|
|
274
284
|
}
|
|
@@ -306,8 +316,7 @@ function createResource(source, fetcher, options) {
|
|
|
306
316
|
return;
|
|
307
317
|
}
|
|
308
318
|
if (Transition && pr) Transition.promises.delete(pr);
|
|
309
|
-
const p = initP || untrack(() => fetcher(lookup, s));
|
|
310
|
-
initP = null;
|
|
319
|
+
const p = sharedConfig.context && initP || untrack(() => fetcher(lookup, s));
|
|
311
320
|
if (typeof p !== "object" || !("then" in p)) {
|
|
312
321
|
loadEnd(pr, p);
|
|
313
322
|
return;
|
|
@@ -1281,7 +1290,7 @@ function lazy(fn) {
|
|
|
1281
1290
|
(p || (p = fn())).then(mod => {
|
|
1282
1291
|
setHydrateContext(ctx);
|
|
1283
1292
|
set(() => mod.default);
|
|
1284
|
-
setHydrateContext(
|
|
1293
|
+
setHydrateContext();
|
|
1285
1294
|
});
|
|
1286
1295
|
comp = s;
|
|
1287
1296
|
} else if (!comp) {
|
package/dist/dev.js
CHANGED
|
@@ -243,10 +243,13 @@ function createResource(source, fetcher, options) {
|
|
|
243
243
|
pr = null,
|
|
244
244
|
initP = null,
|
|
245
245
|
id = null,
|
|
246
|
+
ctx,
|
|
246
247
|
loadedUnderTransition = false,
|
|
247
248
|
dynamic = typeof source === "function";
|
|
248
249
|
if (sharedConfig.context) {
|
|
249
250
|
id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;
|
|
251
|
+
ctx = { ...sharedConfig.context
|
|
252
|
+
};
|
|
250
253
|
if (sharedConfig.load) initP = sharedConfig.load(id);
|
|
251
254
|
}
|
|
252
255
|
function loadEnd(p, v, e) {
|
|
@@ -264,7 +267,14 @@ function createResource(source, fetcher, options) {
|
|
|
264
267
|
}
|
|
265
268
|
completeLoad(v);
|
|
266
269
|
}, false);
|
|
267
|
-
} else
|
|
270
|
+
} else {
|
|
271
|
+
if (p === initP) setHydrateContext(ctx);
|
|
272
|
+
completeLoad(v);
|
|
273
|
+
if (p === initP) {
|
|
274
|
+
initP = null;
|
|
275
|
+
setHydrateContext();
|
|
276
|
+
}
|
|
277
|
+
}
|
|
268
278
|
}
|
|
269
279
|
return v;
|
|
270
280
|
}
|
|
@@ -302,8 +312,7 @@ function createResource(source, fetcher, options) {
|
|
|
302
312
|
return;
|
|
303
313
|
}
|
|
304
314
|
if (Transition && pr) Transition.promises.delete(pr);
|
|
305
|
-
const p = initP || untrack(() => fetcher(lookup, s));
|
|
306
|
-
initP = null;
|
|
315
|
+
const p = sharedConfig.context && initP || untrack(() => fetcher(lookup, s));
|
|
307
316
|
if (typeof p !== "object" || !("then" in p)) {
|
|
308
317
|
loadEnd(pr, p);
|
|
309
318
|
return;
|
|
@@ -1277,7 +1286,7 @@ function lazy(fn) {
|
|
|
1277
1286
|
(p || (p = fn())).then(mod => {
|
|
1278
1287
|
setHydrateContext(ctx);
|
|
1279
1288
|
set(() => mod.default);
|
|
1280
|
-
setHydrateContext(
|
|
1289
|
+
setHydrateContext();
|
|
1281
1290
|
});
|
|
1282
1291
|
comp = s;
|
|
1283
1292
|
} else if (!comp) {
|
package/dist/solid.cjs
CHANGED
|
@@ -244,10 +244,13 @@ function createResource(source, fetcher, options) {
|
|
|
244
244
|
pr = null,
|
|
245
245
|
initP = null,
|
|
246
246
|
id = null,
|
|
247
|
+
ctx,
|
|
247
248
|
loadedUnderTransition = false,
|
|
248
249
|
dynamic = typeof source === "function";
|
|
249
250
|
if (sharedConfig.context) {
|
|
250
251
|
id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;
|
|
252
|
+
ctx = { ...sharedConfig.context
|
|
253
|
+
};
|
|
251
254
|
if (sharedConfig.load) initP = sharedConfig.load(id);
|
|
252
255
|
}
|
|
253
256
|
function loadEnd(p, v, e) {
|
|
@@ -265,7 +268,14 @@ function createResource(source, fetcher, options) {
|
|
|
265
268
|
}
|
|
266
269
|
completeLoad(v);
|
|
267
270
|
}, false);
|
|
268
|
-
} else
|
|
271
|
+
} else {
|
|
272
|
+
if (p === initP) setHydrateContext(ctx);
|
|
273
|
+
completeLoad(v);
|
|
274
|
+
if (p === initP) {
|
|
275
|
+
initP = null;
|
|
276
|
+
setHydrateContext();
|
|
277
|
+
}
|
|
278
|
+
}
|
|
269
279
|
}
|
|
270
280
|
return v;
|
|
271
281
|
}
|
|
@@ -303,8 +313,7 @@ function createResource(source, fetcher, options) {
|
|
|
303
313
|
return;
|
|
304
314
|
}
|
|
305
315
|
if (Transition && pr) Transition.promises.delete(pr);
|
|
306
|
-
const p = initP || untrack(() => fetcher(lookup, s));
|
|
307
|
-
initP = null;
|
|
316
|
+
const p = sharedConfig.context && initP || untrack(() => fetcher(lookup, s));
|
|
308
317
|
if (typeof p !== "object" || !("then" in p)) {
|
|
309
318
|
loadEnd(pr, p);
|
|
310
319
|
return;
|
|
@@ -1205,7 +1214,7 @@ function lazy(fn) {
|
|
|
1205
1214
|
(p || (p = fn())).then(mod => {
|
|
1206
1215
|
setHydrateContext(ctx);
|
|
1207
1216
|
set(() => mod.default);
|
|
1208
|
-
setHydrateContext(
|
|
1217
|
+
setHydrateContext();
|
|
1209
1218
|
});
|
|
1210
1219
|
comp = s;
|
|
1211
1220
|
} else if (!comp) {
|
package/dist/solid.js
CHANGED
|
@@ -240,10 +240,13 @@ function createResource(source, fetcher, options) {
|
|
|
240
240
|
pr = null,
|
|
241
241
|
initP = null,
|
|
242
242
|
id = null,
|
|
243
|
+
ctx,
|
|
243
244
|
loadedUnderTransition = false,
|
|
244
245
|
dynamic = typeof source === "function";
|
|
245
246
|
if (sharedConfig.context) {
|
|
246
247
|
id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;
|
|
248
|
+
ctx = { ...sharedConfig.context
|
|
249
|
+
};
|
|
247
250
|
if (sharedConfig.load) initP = sharedConfig.load(id);
|
|
248
251
|
}
|
|
249
252
|
function loadEnd(p, v, e) {
|
|
@@ -261,7 +264,14 @@ function createResource(source, fetcher, options) {
|
|
|
261
264
|
}
|
|
262
265
|
completeLoad(v);
|
|
263
266
|
}, false);
|
|
264
|
-
} else
|
|
267
|
+
} else {
|
|
268
|
+
if (p === initP) setHydrateContext(ctx);
|
|
269
|
+
completeLoad(v);
|
|
270
|
+
if (p === initP) {
|
|
271
|
+
initP = null;
|
|
272
|
+
setHydrateContext();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
265
275
|
}
|
|
266
276
|
return v;
|
|
267
277
|
}
|
|
@@ -299,8 +309,7 @@ function createResource(source, fetcher, options) {
|
|
|
299
309
|
return;
|
|
300
310
|
}
|
|
301
311
|
if (Transition && pr) Transition.promises.delete(pr);
|
|
302
|
-
const p = initP || untrack(() => fetcher(lookup, s));
|
|
303
|
-
initP = null;
|
|
312
|
+
const p = sharedConfig.context && initP || untrack(() => fetcher(lookup, s));
|
|
304
313
|
if (typeof p !== "object" || !("then" in p)) {
|
|
305
314
|
loadEnd(pr, p);
|
|
306
315
|
return;
|
|
@@ -1201,7 +1210,7 @@ function lazy(fn) {
|
|
|
1201
1210
|
(p || (p = fn())).then(mod => {
|
|
1202
1211
|
setHydrateContext(ctx);
|
|
1203
1212
|
set(() => mod.default);
|
|
1204
|
-
setHydrateContext(
|
|
1213
|
+
setHydrateContext();
|
|
1205
1214
|
});
|
|
1206
1215
|
comp = s;
|
|
1207
1216
|
} else if (!comp) {
|
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.0-beta.
|
|
4
|
+
"version": "1.3.0-beta.7",
|
|
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": "de3e45c226d44d9e1a67813be07e87459e41852c"
|
|
148
148
|
}
|
package/web/dist/dev.cjs
CHANGED
|
@@ -403,6 +403,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
403
403
|
}
|
|
404
404
|
current = array;
|
|
405
405
|
} else if (value instanceof Node) {
|
|
406
|
+
if (solidJs.sharedConfig.context) return current = value.parentNode ? value : current;
|
|
406
407
|
if (Array.isArray(current)) {
|
|
407
408
|
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
408
409
|
cleanChildren(parent, current, null, value);
|
package/web/dist/dev.js
CHANGED
|
@@ -400,6 +400,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
400
400
|
}
|
|
401
401
|
current = array;
|
|
402
402
|
} else if (value instanceof Node) {
|
|
403
|
+
if (sharedConfig.context) return current = value.parentNode ? value : current;
|
|
403
404
|
if (Array.isArray(current)) {
|
|
404
405
|
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
405
406
|
cleanChildren(parent, current, null, value);
|
package/web/dist/web.cjs
CHANGED
|
@@ -402,6 +402,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
402
402
|
}
|
|
403
403
|
current = array;
|
|
404
404
|
} else if (value instanceof Node) {
|
|
405
|
+
if (solidJs.sharedConfig.context) return current = value.parentNode ? value : current;
|
|
405
406
|
if (Array.isArray(current)) {
|
|
406
407
|
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
407
408
|
cleanChildren(parent, current, null, value);
|
package/web/dist/web.js
CHANGED
|
@@ -399,6 +399,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
399
399
|
}
|
|
400
400
|
current = array;
|
|
401
401
|
} else if (value instanceof Node) {
|
|
402
|
+
if (sharedConfig.context) return current = value.parentNode ? value : current;
|
|
402
403
|
if (Array.isArray(current)) {
|
|
403
404
|
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
404
405
|
cleanChildren(parent, current, null, value);
|