solid-js 1.3.0-beta.9 → 1.3.0-rc.3
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 +61 -41
- package/dist/dev.js +60 -41
- package/dist/server.cjs +7 -3
- package/dist/server.js +6 -4
- package/dist/solid.cjs +55 -40
- package/dist/solid.js +54 -40
- package/package.json +2 -2
- package/types/index.d.ts +1 -1
- package/types/reactive/signal.d.ts +12 -6
- package/types/server/index.d.ts +2 -2
- package/types/server/reactive.d.ts +1 -0
- package/types/server/rendering.d.ts +2 -0
- package/web/dist/dev.cjs +13 -37
- package/web/dist/dev.js +1 -1
- package/web/dist/server.cjs +28 -40
- package/web/dist/server.js +18 -10
- package/web/dist/web.cjs +13 -37
- package/web/dist/web.js +1 -1
package/dist/dev.cjs
CHANGED
|
@@ -131,6 +131,7 @@ function nextHydrateContext() {
|
|
|
131
131
|
|
|
132
132
|
const equalFn = (a, b) => a === b;
|
|
133
133
|
const $PROXY = Symbol("solid-proxy");
|
|
134
|
+
const $DEVCOMP = Symbol('solid-dev-component');
|
|
134
135
|
const signalOptions = {
|
|
135
136
|
equals: equalFn
|
|
136
137
|
};
|
|
@@ -236,11 +237,14 @@ function createResource(source, fetcher, options) {
|
|
|
236
237
|
fetcher = source;
|
|
237
238
|
source = true;
|
|
238
239
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
240
|
+
options ||= {};
|
|
241
|
+
if (options.globalRefetch !== false) {
|
|
242
|
+
Resources || (Resources = new Set());
|
|
243
|
+
Resources.add(load);
|
|
244
|
+
onCleanup(() => Resources.delete(load));
|
|
245
|
+
}
|
|
242
246
|
const contexts = new Set(),
|
|
243
|
-
[s, set] = createSignal(
|
|
247
|
+
[s, set] = createSignal(options.initialValue),
|
|
244
248
|
[track, trigger] = createSignal(undefined, {
|
|
245
249
|
equals: false
|
|
246
250
|
}),
|
|
@@ -256,10 +260,14 @@ function createResource(source, fetcher, options) {
|
|
|
256
260
|
id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;
|
|
257
261
|
if (sharedConfig.load) initP = sharedConfig.load(id);
|
|
258
262
|
}
|
|
259
|
-
function loadEnd(p, v, e) {
|
|
263
|
+
function loadEnd(p, v, e, key) {
|
|
260
264
|
if (pr === p) {
|
|
261
|
-
setError(err = e);
|
|
262
265
|
pr = null;
|
|
266
|
+
if (initP && p === initP && options.onHydrated) options.onHydrated(key, {
|
|
267
|
+
value: v
|
|
268
|
+
});
|
|
269
|
+
initP = null;
|
|
270
|
+
setError(err = e);
|
|
263
271
|
if (Transition && p && loadedUnderTransition) {
|
|
264
272
|
Transition.promises.delete(p);
|
|
265
273
|
loadedUnderTransition = false;
|
|
@@ -313,17 +321,16 @@ function createResource(source, fetcher, options) {
|
|
|
313
321
|
value: s(),
|
|
314
322
|
refetching
|
|
315
323
|
}));
|
|
316
|
-
initP = null;
|
|
317
324
|
if (typeof p !== "object" || !("then" in p)) {
|
|
318
325
|
loadEnd(pr, p);
|
|
319
|
-
return;
|
|
326
|
+
return p;
|
|
320
327
|
}
|
|
321
328
|
pr = p;
|
|
322
329
|
batch(() => {
|
|
323
330
|
setLoading(true);
|
|
324
331
|
trigger();
|
|
325
332
|
});
|
|
326
|
-
p.then(v => loadEnd(p, v), e => loadEnd(p, e, e));
|
|
333
|
+
return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, e, e));
|
|
327
334
|
}
|
|
328
335
|
Object.defineProperties(read, {
|
|
329
336
|
loading: {
|
|
@@ -344,7 +351,7 @@ function createResource(source, fetcher, options) {
|
|
|
344
351
|
}];
|
|
345
352
|
}
|
|
346
353
|
let Resources;
|
|
347
|
-
function
|
|
354
|
+
function refetchResources(info) {
|
|
348
355
|
Resources && Resources.forEach(fn => fn(info));
|
|
349
356
|
}
|
|
350
357
|
function createDeferred(source, options) {
|
|
@@ -459,7 +466,7 @@ function runWithOwner(o, fn) {
|
|
|
459
466
|
const prev = Owner;
|
|
460
467
|
Owner = o;
|
|
461
468
|
try {
|
|
462
|
-
return fn
|
|
469
|
+
return runUpdates(fn, true);
|
|
463
470
|
} finally {
|
|
464
471
|
Owner = prev;
|
|
465
472
|
}
|
|
@@ -467,28 +474,31 @@ function runWithOwner(o, fn) {
|
|
|
467
474
|
function enableScheduling(scheduler = requestCallback) {
|
|
468
475
|
Scheduler = scheduler;
|
|
469
476
|
}
|
|
470
|
-
function startTransition(fn
|
|
477
|
+
function startTransition(fn) {
|
|
471
478
|
if (Transition && Transition.running) {
|
|
472
479
|
fn();
|
|
473
|
-
|
|
474
|
-
return;
|
|
480
|
+
return Transition.done;
|
|
475
481
|
}
|
|
476
|
-
|
|
482
|
+
const l = Listener;
|
|
483
|
+
const o = Owner;
|
|
484
|
+
return Promise.resolve().then(() => {
|
|
485
|
+
Listener = l;
|
|
486
|
+
Owner = o;
|
|
487
|
+
let t;
|
|
477
488
|
if (Scheduler || SuspenseContext) {
|
|
478
|
-
Transition || (Transition = {
|
|
489
|
+
t = Transition || (Transition = {
|
|
479
490
|
sources: new Set(),
|
|
480
491
|
effects: [],
|
|
481
492
|
promises: new Set(),
|
|
482
493
|
disposed: new Set(),
|
|
483
494
|
queue: new Set(),
|
|
484
|
-
running: true
|
|
485
|
-
cb: []
|
|
495
|
+
running: true
|
|
486
496
|
});
|
|
487
|
-
|
|
488
|
-
|
|
497
|
+
t.done ||= new Promise(res => t.resolve = res);
|
|
498
|
+
t.running = true;
|
|
489
499
|
}
|
|
490
500
|
batch(fn);
|
|
491
|
-
|
|
501
|
+
return t ? t.done : undefined;
|
|
492
502
|
});
|
|
493
503
|
}
|
|
494
504
|
function useTransition() {
|
|
@@ -499,7 +509,12 @@ function resumeEffects(e) {
|
|
|
499
509
|
e.length = 0;
|
|
500
510
|
}
|
|
501
511
|
function devComponent(Comp, props) {
|
|
502
|
-
const c = createComputation(() => untrack(() =>
|
|
512
|
+
const c = createComputation(() => untrack(() => {
|
|
513
|
+
Object.assign(Comp, {
|
|
514
|
+
[$DEVCOMP]: true
|
|
515
|
+
});
|
|
516
|
+
return Comp(props);
|
|
517
|
+
}), undefined, true);
|
|
503
518
|
c.pending = NOTPENDING;
|
|
504
519
|
c.observers = null;
|
|
505
520
|
c.observerSlots = null;
|
|
@@ -717,7 +732,7 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
717
732
|
});
|
|
718
733
|
const ordinary = ExternalSourceFactory(c.fn, trigger);
|
|
719
734
|
onCleanup(() => ordinary.dispose());
|
|
720
|
-
const triggerInTransition = () => startTransition(trigger
|
|
735
|
+
const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());
|
|
721
736
|
const inTransition = ExternalSourceFactory(c.fn, triggerInTransition);
|
|
722
737
|
c.fn = x => {
|
|
723
738
|
track();
|
|
@@ -775,7 +790,7 @@ function completeUpdates(wait) {
|
|
|
775
790
|
Updates = null;
|
|
776
791
|
}
|
|
777
792
|
if (wait) return;
|
|
778
|
-
let
|
|
793
|
+
let res;
|
|
779
794
|
if (Transition && Transition.running) {
|
|
780
795
|
if (Transition.promises.size || Transition.queue.size) {
|
|
781
796
|
Transition.running = false;
|
|
@@ -785,7 +800,7 @@ function completeUpdates(wait) {
|
|
|
785
800
|
return;
|
|
786
801
|
}
|
|
787
802
|
const sources = Transition.sources;
|
|
788
|
-
|
|
803
|
+
res = Transition.resolve;
|
|
789
804
|
Effects.forEach(e => {
|
|
790
805
|
"tState" in e && (e.state = e.tState);
|
|
791
806
|
delete e.tState;
|
|
@@ -812,7 +827,7 @@ function completeUpdates(wait) {
|
|
|
812
827
|
Effects = null;
|
|
813
828
|
globalThis._$afterUpdate && globalThis._$afterUpdate();
|
|
814
829
|
}
|
|
815
|
-
if (
|
|
830
|
+
if (res) res();
|
|
816
831
|
}
|
|
817
832
|
function runQueue(queue) {
|
|
818
833
|
for (let i = 0; i < queue.length; i++) runTop(queue[i]);
|
|
@@ -1295,7 +1310,9 @@ function lazy(fn) {
|
|
|
1295
1310
|
});
|
|
1296
1311
|
comp = s;
|
|
1297
1312
|
} else if (!comp) {
|
|
1298
|
-
const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default)
|
|
1313
|
+
const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default), {
|
|
1314
|
+
globalRefetch: false
|
|
1315
|
+
});
|
|
1299
1316
|
comp = s;
|
|
1300
1317
|
} else {
|
|
1301
1318
|
const c = comp();
|
|
@@ -1478,19 +1495,21 @@ function Suspense(props) {
|
|
|
1478
1495
|
if (sharedConfig.context) {
|
|
1479
1496
|
const key = sharedConfig.context.id + sharedConfig.context.count;
|
|
1480
1497
|
p = sharedConfig.load(key);
|
|
1481
|
-
if (p
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1498
|
+
if (p) {
|
|
1499
|
+
if (typeof p !== "object" || !("then" in p)) error = p;else {
|
|
1500
|
+
const [s, set] = createSignal(undefined, {
|
|
1501
|
+
equals: false
|
|
1502
|
+
});
|
|
1503
|
+
flicker = s;
|
|
1504
|
+
p.then(err => {
|
|
1505
|
+
if (error = err) return set();
|
|
1506
|
+
sharedConfig.gather(key);
|
|
1507
|
+
setHydrateContext(ctx);
|
|
1508
|
+
set();
|
|
1509
|
+
setHydrateContext();
|
|
1510
|
+
p = undefined;
|
|
1511
|
+
});
|
|
1512
|
+
}
|
|
1494
1513
|
}
|
|
1495
1514
|
}
|
|
1496
1515
|
const listContext = useContext(SuspenseListContext);
|
|
@@ -1550,6 +1569,7 @@ if (globalThis) {
|
|
|
1550
1569
|
if (!globalThis.Solid$$) globalThis.Solid$$ = true;else console.warn("You appear to have multiple instances of Solid. This can lead to unexpected behavior.");
|
|
1551
1570
|
}
|
|
1552
1571
|
|
|
1572
|
+
exports.$DEVCOMP = $DEVCOMP;
|
|
1553
1573
|
exports.$PROXY = $PROXY;
|
|
1554
1574
|
exports.ErrorBoundary = ErrorBoundary;
|
|
1555
1575
|
exports.For = For;
|
|
@@ -1590,7 +1610,7 @@ exports.on = on;
|
|
|
1590
1610
|
exports.onCleanup = onCleanup;
|
|
1591
1611
|
exports.onError = onError;
|
|
1592
1612
|
exports.onMount = onMount;
|
|
1593
|
-
exports.
|
|
1613
|
+
exports.refetchResources = refetchResources;
|
|
1594
1614
|
exports.requestCallback = requestCallback;
|
|
1595
1615
|
exports.runWithOwner = runWithOwner;
|
|
1596
1616
|
exports.sharedConfig = sharedConfig;
|
package/dist/dev.js
CHANGED
|
@@ -127,6 +127,7 @@ function nextHydrateContext() {
|
|
|
127
127
|
|
|
128
128
|
const equalFn = (a, b) => a === b;
|
|
129
129
|
const $PROXY = Symbol("solid-proxy");
|
|
130
|
+
const $DEVCOMP = Symbol('solid-dev-component');
|
|
130
131
|
const signalOptions = {
|
|
131
132
|
equals: equalFn
|
|
132
133
|
};
|
|
@@ -232,11 +233,14 @@ function createResource(source, fetcher, options) {
|
|
|
232
233
|
fetcher = source;
|
|
233
234
|
source = true;
|
|
234
235
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
options ||= {};
|
|
237
|
+
if (options.globalRefetch !== false) {
|
|
238
|
+
Resources || (Resources = new Set());
|
|
239
|
+
Resources.add(load);
|
|
240
|
+
onCleanup(() => Resources.delete(load));
|
|
241
|
+
}
|
|
238
242
|
const contexts = new Set(),
|
|
239
|
-
[s, set] = createSignal(
|
|
243
|
+
[s, set] = createSignal(options.initialValue),
|
|
240
244
|
[track, trigger] = createSignal(undefined, {
|
|
241
245
|
equals: false
|
|
242
246
|
}),
|
|
@@ -252,10 +256,14 @@ function createResource(source, fetcher, options) {
|
|
|
252
256
|
id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;
|
|
253
257
|
if (sharedConfig.load) initP = sharedConfig.load(id);
|
|
254
258
|
}
|
|
255
|
-
function loadEnd(p, v, e) {
|
|
259
|
+
function loadEnd(p, v, e, key) {
|
|
256
260
|
if (pr === p) {
|
|
257
|
-
setError(err = e);
|
|
258
261
|
pr = null;
|
|
262
|
+
if (initP && p === initP && options.onHydrated) options.onHydrated(key, {
|
|
263
|
+
value: v
|
|
264
|
+
});
|
|
265
|
+
initP = null;
|
|
266
|
+
setError(err = e);
|
|
259
267
|
if (Transition && p && loadedUnderTransition) {
|
|
260
268
|
Transition.promises.delete(p);
|
|
261
269
|
loadedUnderTransition = false;
|
|
@@ -309,17 +317,16 @@ function createResource(source, fetcher, options) {
|
|
|
309
317
|
value: s(),
|
|
310
318
|
refetching
|
|
311
319
|
}));
|
|
312
|
-
initP = null;
|
|
313
320
|
if (typeof p !== "object" || !("then" in p)) {
|
|
314
321
|
loadEnd(pr, p);
|
|
315
|
-
return;
|
|
322
|
+
return p;
|
|
316
323
|
}
|
|
317
324
|
pr = p;
|
|
318
325
|
batch(() => {
|
|
319
326
|
setLoading(true);
|
|
320
327
|
trigger();
|
|
321
328
|
});
|
|
322
|
-
p.then(v => loadEnd(p, v), e => loadEnd(p, e, e));
|
|
329
|
+
return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, e, e));
|
|
323
330
|
}
|
|
324
331
|
Object.defineProperties(read, {
|
|
325
332
|
loading: {
|
|
@@ -340,7 +347,7 @@ function createResource(source, fetcher, options) {
|
|
|
340
347
|
}];
|
|
341
348
|
}
|
|
342
349
|
let Resources;
|
|
343
|
-
function
|
|
350
|
+
function refetchResources(info) {
|
|
344
351
|
Resources && Resources.forEach(fn => fn(info));
|
|
345
352
|
}
|
|
346
353
|
function createDeferred(source, options) {
|
|
@@ -455,7 +462,7 @@ function runWithOwner(o, fn) {
|
|
|
455
462
|
const prev = Owner;
|
|
456
463
|
Owner = o;
|
|
457
464
|
try {
|
|
458
|
-
return fn
|
|
465
|
+
return runUpdates(fn, true);
|
|
459
466
|
} finally {
|
|
460
467
|
Owner = prev;
|
|
461
468
|
}
|
|
@@ -463,28 +470,31 @@ function runWithOwner(o, fn) {
|
|
|
463
470
|
function enableScheduling(scheduler = requestCallback) {
|
|
464
471
|
Scheduler = scheduler;
|
|
465
472
|
}
|
|
466
|
-
function startTransition(fn
|
|
473
|
+
function startTransition(fn) {
|
|
467
474
|
if (Transition && Transition.running) {
|
|
468
475
|
fn();
|
|
469
|
-
|
|
470
|
-
return;
|
|
476
|
+
return Transition.done;
|
|
471
477
|
}
|
|
472
|
-
|
|
478
|
+
const l = Listener;
|
|
479
|
+
const o = Owner;
|
|
480
|
+
return Promise.resolve().then(() => {
|
|
481
|
+
Listener = l;
|
|
482
|
+
Owner = o;
|
|
483
|
+
let t;
|
|
473
484
|
if (Scheduler || SuspenseContext) {
|
|
474
|
-
Transition || (Transition = {
|
|
485
|
+
t = Transition || (Transition = {
|
|
475
486
|
sources: new Set(),
|
|
476
487
|
effects: [],
|
|
477
488
|
promises: new Set(),
|
|
478
489
|
disposed: new Set(),
|
|
479
490
|
queue: new Set(),
|
|
480
|
-
running: true
|
|
481
|
-
cb: []
|
|
491
|
+
running: true
|
|
482
492
|
});
|
|
483
|
-
|
|
484
|
-
|
|
493
|
+
t.done ||= new Promise(res => t.resolve = res);
|
|
494
|
+
t.running = true;
|
|
485
495
|
}
|
|
486
496
|
batch(fn);
|
|
487
|
-
|
|
497
|
+
return t ? t.done : undefined;
|
|
488
498
|
});
|
|
489
499
|
}
|
|
490
500
|
function useTransition() {
|
|
@@ -495,7 +505,12 @@ function resumeEffects(e) {
|
|
|
495
505
|
e.length = 0;
|
|
496
506
|
}
|
|
497
507
|
function devComponent(Comp, props) {
|
|
498
|
-
const c = createComputation(() => untrack(() =>
|
|
508
|
+
const c = createComputation(() => untrack(() => {
|
|
509
|
+
Object.assign(Comp, {
|
|
510
|
+
[$DEVCOMP]: true
|
|
511
|
+
});
|
|
512
|
+
return Comp(props);
|
|
513
|
+
}), undefined, true);
|
|
499
514
|
c.pending = NOTPENDING;
|
|
500
515
|
c.observers = null;
|
|
501
516
|
c.observerSlots = null;
|
|
@@ -713,7 +728,7 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
713
728
|
});
|
|
714
729
|
const ordinary = ExternalSourceFactory(c.fn, trigger);
|
|
715
730
|
onCleanup(() => ordinary.dispose());
|
|
716
|
-
const triggerInTransition = () => startTransition(trigger
|
|
731
|
+
const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());
|
|
717
732
|
const inTransition = ExternalSourceFactory(c.fn, triggerInTransition);
|
|
718
733
|
c.fn = x => {
|
|
719
734
|
track();
|
|
@@ -771,7 +786,7 @@ function completeUpdates(wait) {
|
|
|
771
786
|
Updates = null;
|
|
772
787
|
}
|
|
773
788
|
if (wait) return;
|
|
774
|
-
let
|
|
789
|
+
let res;
|
|
775
790
|
if (Transition && Transition.running) {
|
|
776
791
|
if (Transition.promises.size || Transition.queue.size) {
|
|
777
792
|
Transition.running = false;
|
|
@@ -781,7 +796,7 @@ function completeUpdates(wait) {
|
|
|
781
796
|
return;
|
|
782
797
|
}
|
|
783
798
|
const sources = Transition.sources;
|
|
784
|
-
|
|
799
|
+
res = Transition.resolve;
|
|
785
800
|
Effects.forEach(e => {
|
|
786
801
|
"tState" in e && (e.state = e.tState);
|
|
787
802
|
delete e.tState;
|
|
@@ -808,7 +823,7 @@ function completeUpdates(wait) {
|
|
|
808
823
|
Effects = null;
|
|
809
824
|
globalThis._$afterUpdate && globalThis._$afterUpdate();
|
|
810
825
|
}
|
|
811
|
-
if (
|
|
826
|
+
if (res) res();
|
|
812
827
|
}
|
|
813
828
|
function runQueue(queue) {
|
|
814
829
|
for (let i = 0; i < queue.length; i++) runTop(queue[i]);
|
|
@@ -1291,7 +1306,9 @@ function lazy(fn) {
|
|
|
1291
1306
|
});
|
|
1292
1307
|
comp = s;
|
|
1293
1308
|
} else if (!comp) {
|
|
1294
|
-
const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default)
|
|
1309
|
+
const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default), {
|
|
1310
|
+
globalRefetch: false
|
|
1311
|
+
});
|
|
1295
1312
|
comp = s;
|
|
1296
1313
|
} else {
|
|
1297
1314
|
const c = comp();
|
|
@@ -1474,19 +1491,21 @@ function Suspense(props) {
|
|
|
1474
1491
|
if (sharedConfig.context) {
|
|
1475
1492
|
const key = sharedConfig.context.id + sharedConfig.context.count;
|
|
1476
1493
|
p = sharedConfig.load(key);
|
|
1477
|
-
if (p
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1494
|
+
if (p) {
|
|
1495
|
+
if (typeof p !== "object" || !("then" in p)) error = p;else {
|
|
1496
|
+
const [s, set] = createSignal(undefined, {
|
|
1497
|
+
equals: false
|
|
1498
|
+
});
|
|
1499
|
+
flicker = s;
|
|
1500
|
+
p.then(err => {
|
|
1501
|
+
if (error = err) return set();
|
|
1502
|
+
sharedConfig.gather(key);
|
|
1503
|
+
setHydrateContext(ctx);
|
|
1504
|
+
set();
|
|
1505
|
+
setHydrateContext();
|
|
1506
|
+
p = undefined;
|
|
1507
|
+
});
|
|
1508
|
+
}
|
|
1490
1509
|
}
|
|
1491
1510
|
}
|
|
1492
1511
|
const listContext = useContext(SuspenseListContext);
|
|
@@ -1546,4 +1565,4 @@ if (globalThis) {
|
|
|
1546
1565
|
if (!globalThis.Solid$$) globalThis.Solid$$ = true;else console.warn("You appear to have multiple instances of Solid. This can lead to unexpected behavior.");
|
|
1547
1566
|
}
|
|
1548
1567
|
|
|
1549
|
-
export { $PROXY, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, cancelCallback, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableHydration, enableScheduling, equalFn, from, getListener, getOwner, indexArray, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount,
|
|
1568
|
+
export { $DEVCOMP, $PROXY, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, cancelCallback, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableHydration, enableScheduling, equalFn, from, getListener, getOwner, indexArray, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount, refetchResources, requestCallback, runWithOwner, sharedConfig, splitProps, startTransition, untrack, useContext, useTransition };
|
package/dist/server.cjs
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const equalFn = (a, b) => a === b;
|
|
6
6
|
const $PROXY = Symbol("solid-proxy");
|
|
7
|
+
const $DEVCOMP = Symbol('solid-dev-component');
|
|
7
8
|
const DEV = {};
|
|
8
9
|
const ERROR = Symbol("error");
|
|
9
10
|
const UNOWNED = {
|
|
@@ -381,7 +382,7 @@ function createResource(fn, fetcher, options = {}) {
|
|
|
381
382
|
read.loading = true;
|
|
382
383
|
if ("then" in p) {
|
|
383
384
|
if (ctx.writeResource) ctx.writeResource(id, p);
|
|
384
|
-
p.then(res => {
|
|
385
|
+
return p.then(res => {
|
|
385
386
|
read.loading = false;
|
|
386
387
|
ctx.resources[id].data = res;
|
|
387
388
|
p = null;
|
|
@@ -393,10 +394,10 @@ function createResource(fn, fetcher, options = {}) {
|
|
|
393
394
|
p = null;
|
|
394
395
|
notifySuspense(contexts);
|
|
395
396
|
});
|
|
396
|
-
return;
|
|
397
397
|
}
|
|
398
398
|
ctx.resources[id].data = p;
|
|
399
399
|
p = null;
|
|
400
|
+
return ctx.resources[id].data;
|
|
400
401
|
}
|
|
401
402
|
load();
|
|
402
403
|
return resource.ref = [read, {
|
|
@@ -442,6 +443,7 @@ function notifySuspense(contexts) {
|
|
|
442
443
|
contexts.clear();
|
|
443
444
|
}
|
|
444
445
|
function enableScheduling() {}
|
|
446
|
+
function enableHydration() {}
|
|
445
447
|
function startTransition(fn) {
|
|
446
448
|
fn();
|
|
447
449
|
}
|
|
@@ -482,7 +484,7 @@ function Suspense(props) {
|
|
|
482
484
|
}
|
|
483
485
|
const res = runSuspense();
|
|
484
486
|
if (suspenseComplete(value)) {
|
|
485
|
-
ctx.writeResource(id,
|
|
487
|
+
ctx.writeResource(id, null);
|
|
486
488
|
return res;
|
|
487
489
|
}
|
|
488
490
|
onError(err => {
|
|
@@ -508,6 +510,7 @@ function Suspense(props) {
|
|
|
508
510
|
return props.fallback;
|
|
509
511
|
}
|
|
510
512
|
|
|
513
|
+
exports.$DEVCOMP = $DEVCOMP;
|
|
511
514
|
exports.$PROXY = $PROXY;
|
|
512
515
|
exports.DEV = DEV;
|
|
513
516
|
exports.ErrorBoundary = ErrorBoundary;
|
|
@@ -533,6 +536,7 @@ exports.createSelector = createSelector;
|
|
|
533
536
|
exports.createSignal = createSignal;
|
|
534
537
|
exports.createUniqueId = createUniqueId;
|
|
535
538
|
exports.enableExternalSource = enableExternalSource;
|
|
539
|
+
exports.enableHydration = enableHydration;
|
|
536
540
|
exports.enableScheduling = enableScheduling;
|
|
537
541
|
exports.equalFn = equalFn;
|
|
538
542
|
exports.from = from;
|
package/dist/server.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const equalFn = (a, b) => a === b;
|
|
2
2
|
const $PROXY = Symbol("solid-proxy");
|
|
3
|
+
const $DEVCOMP = Symbol('solid-dev-component');
|
|
3
4
|
const DEV = {};
|
|
4
5
|
const ERROR = Symbol("error");
|
|
5
6
|
const UNOWNED = {
|
|
@@ -377,7 +378,7 @@ function createResource(fn, fetcher, options = {}) {
|
|
|
377
378
|
read.loading = true;
|
|
378
379
|
if ("then" in p) {
|
|
379
380
|
if (ctx.writeResource) ctx.writeResource(id, p);
|
|
380
|
-
p.then(res => {
|
|
381
|
+
return p.then(res => {
|
|
381
382
|
read.loading = false;
|
|
382
383
|
ctx.resources[id].data = res;
|
|
383
384
|
p = null;
|
|
@@ -389,10 +390,10 @@ function createResource(fn, fetcher, options = {}) {
|
|
|
389
390
|
p = null;
|
|
390
391
|
notifySuspense(contexts);
|
|
391
392
|
});
|
|
392
|
-
return;
|
|
393
393
|
}
|
|
394
394
|
ctx.resources[id].data = p;
|
|
395
395
|
p = null;
|
|
396
|
+
return ctx.resources[id].data;
|
|
396
397
|
}
|
|
397
398
|
load();
|
|
398
399
|
return resource.ref = [read, {
|
|
@@ -438,6 +439,7 @@ function notifySuspense(contexts) {
|
|
|
438
439
|
contexts.clear();
|
|
439
440
|
}
|
|
440
441
|
function enableScheduling() {}
|
|
442
|
+
function enableHydration() {}
|
|
441
443
|
function startTransition(fn) {
|
|
442
444
|
fn();
|
|
443
445
|
}
|
|
@@ -478,7 +480,7 @@ function Suspense(props) {
|
|
|
478
480
|
}
|
|
479
481
|
const res = runSuspense();
|
|
480
482
|
if (suspenseComplete(value)) {
|
|
481
|
-
ctx.writeResource(id,
|
|
483
|
+
ctx.writeResource(id, null);
|
|
482
484
|
return res;
|
|
483
485
|
}
|
|
484
486
|
onError(err => {
|
|
@@ -504,4 +506,4 @@ function Suspense(props) {
|
|
|
504
506
|
return props.fallback;
|
|
505
507
|
}
|
|
506
508
|
|
|
507
|
-
export { $PROXY, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableScheduling, equalFn, from, getListener, getOwner, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount, requestCallback, runWithOwner, sharedConfig, splitProps, startTransition, untrack, useContext, useTransition };
|
|
509
|
+
export { $DEVCOMP, $PROXY, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableHydration, enableScheduling, equalFn, from, getListener, getOwner, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount, requestCallback, runWithOwner, sharedConfig, splitProps, startTransition, untrack, useContext, useTransition };
|