solid-js 1.5.0-beta.7 → 1.5.2
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 +23 -26
- package/dist/dev.js +23 -26
- package/dist/solid.cjs +21 -24
- package/dist/solid.js +21 -24
- package/h/jsx-runtime/package.json +8 -0
- package/h/jsx-runtime/types/jsx.d.ts +74 -73
- package/h/package.json +8 -0
- package/html/package.json +8 -0
- package/package.json +7 -1
- package/store/package.json +50 -0
- package/types/jsx.d.ts +37 -36
- package/types/reactive/signal.d.ts +5 -2
- package/universal/package.json +24 -0
- package/web/dist/dev.cjs +3 -1
- package/web/dist/dev.js +3 -1
- package/web/dist/server.cjs +2 -2
- package/web/dist/server.js +2 -2
- package/web/dist/web.cjs +1 -1
- package/web/dist/web.js +1 -1
- package/web/package.json +50 -0
- package/web/types/client.d.ts +1 -1
package/dist/dev.cjs
CHANGED
|
@@ -147,7 +147,6 @@ const UNOWNED = {
|
|
|
147
147
|
owner: null
|
|
148
148
|
};
|
|
149
149
|
const NO_INIT = {};
|
|
150
|
-
const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
|
|
151
150
|
var Owner = null;
|
|
152
151
|
let Transition = null;
|
|
153
152
|
let Scheduler = null;
|
|
@@ -157,6 +156,7 @@ let Updates = null;
|
|
|
157
156
|
let Effects = null;
|
|
158
157
|
let ExecCount = 0;
|
|
159
158
|
let rootCount = 0;
|
|
159
|
+
const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
|
|
160
160
|
function createRoot(fn, detachedOwner) {
|
|
161
161
|
const listener = Listener,
|
|
162
162
|
owner = Owner,
|
|
@@ -255,8 +255,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
255
255
|
fetcher = pFetcher;
|
|
256
256
|
options = pOptions || {};
|
|
257
257
|
}
|
|
258
|
-
let
|
|
259
|
-
pr = null,
|
|
258
|
+
let pr = null,
|
|
260
259
|
initP = NO_INIT,
|
|
261
260
|
id = null,
|
|
262
261
|
loadedUnderTransition = false,
|
|
@@ -265,6 +264,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
265
264
|
dynamic = typeof source === "function" && createMemo(source);
|
|
266
265
|
const contexts = new Set(),
|
|
267
266
|
[value, setValue] = (options.storage || createSignal)(options.initialValue),
|
|
267
|
+
[error, setError] = createSignal(undefined),
|
|
268
268
|
[track, trigger] = createSignal(undefined, {
|
|
269
269
|
equals: false
|
|
270
270
|
}),
|
|
@@ -274,7 +274,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
274
274
|
let v;
|
|
275
275
|
if (options.ssrLoadFrom === "initial") initP = options.initialValue;else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v[0];
|
|
276
276
|
}
|
|
277
|
-
function loadEnd(p, v,
|
|
277
|
+
function loadEnd(p, v, error, key) {
|
|
278
278
|
if (pr === p) {
|
|
279
279
|
pr = null;
|
|
280
280
|
resolved = true;
|
|
@@ -291,25 +291,26 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
291
291
|
Effects.push.apply(Effects, Transition.effects);
|
|
292
292
|
Transition.effects = [];
|
|
293
293
|
}
|
|
294
|
-
completeLoad(v,
|
|
294
|
+
completeLoad(v, error);
|
|
295
295
|
}, false);
|
|
296
|
-
} else completeLoad(v,
|
|
296
|
+
} else completeLoad(v, error);
|
|
297
297
|
}
|
|
298
298
|
return v;
|
|
299
299
|
}
|
|
300
|
-
function completeLoad(v,
|
|
301
|
-
!success && (err = castError(v));
|
|
300
|
+
function completeLoad(v, err) {
|
|
302
301
|
runUpdates(() => {
|
|
303
|
-
setValue(() => v);
|
|
304
|
-
|
|
302
|
+
if (!err) setValue(() => v);
|
|
303
|
+
setError(err);
|
|
304
|
+
setState(err ? "errored" : "ready");
|
|
305
305
|
for (const c of contexts.keys()) c.decrement();
|
|
306
306
|
contexts.clear();
|
|
307
307
|
}, false);
|
|
308
308
|
}
|
|
309
309
|
function read() {
|
|
310
310
|
const c = SuspenseContext && lookup(Owner, SuspenseContext.id),
|
|
311
|
-
v = value()
|
|
312
|
-
|
|
311
|
+
v = value(),
|
|
312
|
+
err = error();
|
|
313
|
+
if (err && !pr) throw err;
|
|
313
314
|
if (Listener && !Listener.user && c) {
|
|
314
315
|
createComputed(() => {
|
|
315
316
|
track();
|
|
@@ -326,11 +327,10 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
326
327
|
function load(refetching = true) {
|
|
327
328
|
if (refetching !== false && scheduled) return;
|
|
328
329
|
scheduled = false;
|
|
329
|
-
err = undefined;
|
|
330
330
|
const lookup = dynamic ? dynamic() : source;
|
|
331
331
|
loadedUnderTransition = Transition && Transition.running;
|
|
332
332
|
if (lookup == null || lookup === false) {
|
|
333
|
-
loadEnd(pr, untrack(value)
|
|
333
|
+
loadEnd(pr, untrack(value));
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
336
|
if (Transition && pr) Transition.promises.delete(pr);
|
|
@@ -339,7 +339,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
339
339
|
refetching
|
|
340
340
|
}));
|
|
341
341
|
if (typeof p !== "object" || !("then" in p)) {
|
|
342
|
-
loadEnd(pr, p
|
|
342
|
+
loadEnd(pr, p);
|
|
343
343
|
return p;
|
|
344
344
|
}
|
|
345
345
|
pr = p;
|
|
@@ -349,27 +349,26 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
349
349
|
setState(resolved ? "refreshing" : "pending");
|
|
350
350
|
trigger();
|
|
351
351
|
}, false);
|
|
352
|
-
return p.then(v => loadEnd(p, v,
|
|
352
|
+
return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e)));
|
|
353
353
|
}
|
|
354
354
|
Object.defineProperties(read, {
|
|
355
355
|
state: {
|
|
356
356
|
get: () => state()
|
|
357
357
|
},
|
|
358
|
+
error: {
|
|
359
|
+
get: () => error()
|
|
360
|
+
},
|
|
358
361
|
loading: {
|
|
359
362
|
get() {
|
|
360
363
|
const s = state();
|
|
361
364
|
return s === "pending" || s === "refreshing";
|
|
362
365
|
}
|
|
363
366
|
},
|
|
364
|
-
error: {
|
|
365
|
-
get() {
|
|
366
|
-
return state() === "errored" ? err : undefined;
|
|
367
|
-
}
|
|
368
|
-
},
|
|
369
367
|
latest: {
|
|
370
368
|
get() {
|
|
371
369
|
if (!resolved) return read();
|
|
372
|
-
|
|
370
|
+
const err = error();
|
|
371
|
+
if (err && !pr) throw err;
|
|
373
372
|
return value();
|
|
374
373
|
}
|
|
375
374
|
}
|
|
@@ -532,7 +531,7 @@ function devComponent(Comp, props) {
|
|
|
532
531
|
}
|
|
533
532
|
function hashValue(v) {
|
|
534
533
|
const s = new Set();
|
|
535
|
-
return `s${typeof v === "string" ? hash(v) : hash(JSON.stringify(v, (k, v) => {
|
|
534
|
+
return `s${typeof v === "string" ? hash(v) : hash(untrack(() => JSON.stringify(v, (k, v) => {
|
|
536
535
|
if (typeof v === "object" && v != null) {
|
|
537
536
|
if (s.has(v)) return;
|
|
538
537
|
s.add(v);
|
|
@@ -549,7 +548,7 @@ function hashValue(v) {
|
|
|
549
548
|
return `${v.toString()}n`;
|
|
550
549
|
}
|
|
551
550
|
return v;
|
|
552
|
-
}) || "")}`;
|
|
551
|
+
}) || ""))}`;
|
|
553
552
|
}
|
|
554
553
|
function registerGraph(name, value) {
|
|
555
554
|
let tryName = name;
|
|
@@ -871,9 +870,7 @@ function runUserEffects(queue) {
|
|
|
871
870
|
if (!e.user) runTop(e);else queue[userLength++] = e;
|
|
872
871
|
}
|
|
873
872
|
if (sharedConfig.context) setHydrateContext();
|
|
874
|
-
Effects = [];
|
|
875
873
|
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
876
|
-
if (Effects.length) runUserEffects(Effects);
|
|
877
874
|
}
|
|
878
875
|
function lookUpstream(node, ignore) {
|
|
879
876
|
const runningTransition = Transition && Transition.running;
|
package/dist/dev.js
CHANGED
|
@@ -143,7 +143,6 @@ const UNOWNED = {
|
|
|
143
143
|
owner: null
|
|
144
144
|
};
|
|
145
145
|
const NO_INIT = {};
|
|
146
|
-
const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
|
|
147
146
|
var Owner = null;
|
|
148
147
|
let Transition = null;
|
|
149
148
|
let Scheduler = null;
|
|
@@ -153,6 +152,7 @@ let Updates = null;
|
|
|
153
152
|
let Effects = null;
|
|
154
153
|
let ExecCount = 0;
|
|
155
154
|
let rootCount = 0;
|
|
155
|
+
const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
|
|
156
156
|
function createRoot(fn, detachedOwner) {
|
|
157
157
|
const listener = Listener,
|
|
158
158
|
owner = Owner,
|
|
@@ -251,8 +251,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
251
251
|
fetcher = pFetcher;
|
|
252
252
|
options = pOptions || {};
|
|
253
253
|
}
|
|
254
|
-
let
|
|
255
|
-
pr = null,
|
|
254
|
+
let pr = null,
|
|
256
255
|
initP = NO_INIT,
|
|
257
256
|
id = null,
|
|
258
257
|
loadedUnderTransition = false,
|
|
@@ -261,6 +260,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
261
260
|
dynamic = typeof source === "function" && createMemo(source);
|
|
262
261
|
const contexts = new Set(),
|
|
263
262
|
[value, setValue] = (options.storage || createSignal)(options.initialValue),
|
|
263
|
+
[error, setError] = createSignal(undefined),
|
|
264
264
|
[track, trigger] = createSignal(undefined, {
|
|
265
265
|
equals: false
|
|
266
266
|
}),
|
|
@@ -270,7 +270,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
270
270
|
let v;
|
|
271
271
|
if (options.ssrLoadFrom === "initial") initP = options.initialValue;else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v[0];
|
|
272
272
|
}
|
|
273
|
-
function loadEnd(p, v,
|
|
273
|
+
function loadEnd(p, v, error, key) {
|
|
274
274
|
if (pr === p) {
|
|
275
275
|
pr = null;
|
|
276
276
|
resolved = true;
|
|
@@ -287,25 +287,26 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
287
287
|
Effects.push.apply(Effects, Transition.effects);
|
|
288
288
|
Transition.effects = [];
|
|
289
289
|
}
|
|
290
|
-
completeLoad(v,
|
|
290
|
+
completeLoad(v, error);
|
|
291
291
|
}, false);
|
|
292
|
-
} else completeLoad(v,
|
|
292
|
+
} else completeLoad(v, error);
|
|
293
293
|
}
|
|
294
294
|
return v;
|
|
295
295
|
}
|
|
296
|
-
function completeLoad(v,
|
|
297
|
-
!success && (err = castError(v));
|
|
296
|
+
function completeLoad(v, err) {
|
|
298
297
|
runUpdates(() => {
|
|
299
|
-
setValue(() => v);
|
|
300
|
-
|
|
298
|
+
if (!err) setValue(() => v);
|
|
299
|
+
setError(err);
|
|
300
|
+
setState(err ? "errored" : "ready");
|
|
301
301
|
for (const c of contexts.keys()) c.decrement();
|
|
302
302
|
contexts.clear();
|
|
303
303
|
}, false);
|
|
304
304
|
}
|
|
305
305
|
function read() {
|
|
306
306
|
const c = SuspenseContext && lookup(Owner, SuspenseContext.id),
|
|
307
|
-
v = value()
|
|
308
|
-
|
|
307
|
+
v = value(),
|
|
308
|
+
err = error();
|
|
309
|
+
if (err && !pr) throw err;
|
|
309
310
|
if (Listener && !Listener.user && c) {
|
|
310
311
|
createComputed(() => {
|
|
311
312
|
track();
|
|
@@ -322,11 +323,10 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
322
323
|
function load(refetching = true) {
|
|
323
324
|
if (refetching !== false && scheduled) return;
|
|
324
325
|
scheduled = false;
|
|
325
|
-
err = undefined;
|
|
326
326
|
const lookup = dynamic ? dynamic() : source;
|
|
327
327
|
loadedUnderTransition = Transition && Transition.running;
|
|
328
328
|
if (lookup == null || lookup === false) {
|
|
329
|
-
loadEnd(pr, untrack(value)
|
|
329
|
+
loadEnd(pr, untrack(value));
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
332
332
|
if (Transition && pr) Transition.promises.delete(pr);
|
|
@@ -335,7 +335,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
335
335
|
refetching
|
|
336
336
|
}));
|
|
337
337
|
if (typeof p !== "object" || !("then" in p)) {
|
|
338
|
-
loadEnd(pr, p
|
|
338
|
+
loadEnd(pr, p);
|
|
339
339
|
return p;
|
|
340
340
|
}
|
|
341
341
|
pr = p;
|
|
@@ -345,27 +345,26 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
345
345
|
setState(resolved ? "refreshing" : "pending");
|
|
346
346
|
trigger();
|
|
347
347
|
}, false);
|
|
348
|
-
return p.then(v => loadEnd(p, v,
|
|
348
|
+
return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e)));
|
|
349
349
|
}
|
|
350
350
|
Object.defineProperties(read, {
|
|
351
351
|
state: {
|
|
352
352
|
get: () => state()
|
|
353
353
|
},
|
|
354
|
+
error: {
|
|
355
|
+
get: () => error()
|
|
356
|
+
},
|
|
354
357
|
loading: {
|
|
355
358
|
get() {
|
|
356
359
|
const s = state();
|
|
357
360
|
return s === "pending" || s === "refreshing";
|
|
358
361
|
}
|
|
359
362
|
},
|
|
360
|
-
error: {
|
|
361
|
-
get() {
|
|
362
|
-
return state() === "errored" ? err : undefined;
|
|
363
|
-
}
|
|
364
|
-
},
|
|
365
363
|
latest: {
|
|
366
364
|
get() {
|
|
367
365
|
if (!resolved) return read();
|
|
368
|
-
|
|
366
|
+
const err = error();
|
|
367
|
+
if (err && !pr) throw err;
|
|
369
368
|
return value();
|
|
370
369
|
}
|
|
371
370
|
}
|
|
@@ -528,7 +527,7 @@ function devComponent(Comp, props) {
|
|
|
528
527
|
}
|
|
529
528
|
function hashValue(v) {
|
|
530
529
|
const s = new Set();
|
|
531
|
-
return `s${typeof v === "string" ? hash(v) : hash(JSON.stringify(v, (k, v) => {
|
|
530
|
+
return `s${typeof v === "string" ? hash(v) : hash(untrack(() => JSON.stringify(v, (k, v) => {
|
|
532
531
|
if (typeof v === "object" && v != null) {
|
|
533
532
|
if (s.has(v)) return;
|
|
534
533
|
s.add(v);
|
|
@@ -545,7 +544,7 @@ function hashValue(v) {
|
|
|
545
544
|
return `${v.toString()}n`;
|
|
546
545
|
}
|
|
547
546
|
return v;
|
|
548
|
-
}) || "")}`;
|
|
547
|
+
}) || ""))}`;
|
|
549
548
|
}
|
|
550
549
|
function registerGraph(name, value) {
|
|
551
550
|
let tryName = name;
|
|
@@ -867,9 +866,7 @@ function runUserEffects(queue) {
|
|
|
867
866
|
if (!e.user) runTop(e);else queue[userLength++] = e;
|
|
868
867
|
}
|
|
869
868
|
if (sharedConfig.context) setHydrateContext();
|
|
870
|
-
Effects = [];
|
|
871
869
|
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
872
|
-
if (Effects.length) runUserEffects(Effects);
|
|
873
870
|
}
|
|
874
871
|
function lookUpstream(node, ignore) {
|
|
875
872
|
const runningTransition = Transition && Transition.running;
|
package/dist/solid.cjs
CHANGED
|
@@ -147,7 +147,6 @@ const UNOWNED = {
|
|
|
147
147
|
owner: null
|
|
148
148
|
};
|
|
149
149
|
const NO_INIT = {};
|
|
150
|
-
const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
|
|
151
150
|
var Owner = null;
|
|
152
151
|
let Transition = null;
|
|
153
152
|
let Scheduler = null;
|
|
@@ -156,6 +155,7 @@ let Listener = null;
|
|
|
156
155
|
let Updates = null;
|
|
157
156
|
let Effects = null;
|
|
158
157
|
let ExecCount = 0;
|
|
158
|
+
const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
|
|
159
159
|
function createRoot(fn, detachedOwner) {
|
|
160
160
|
const listener = Listener,
|
|
161
161
|
owner = Owner,
|
|
@@ -247,8 +247,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
247
247
|
fetcher = pFetcher;
|
|
248
248
|
options = pOptions || {};
|
|
249
249
|
}
|
|
250
|
-
let
|
|
251
|
-
pr = null,
|
|
250
|
+
let pr = null,
|
|
252
251
|
initP = NO_INIT,
|
|
253
252
|
id = null,
|
|
254
253
|
loadedUnderTransition = false,
|
|
@@ -257,6 +256,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
257
256
|
dynamic = typeof source === "function" && createMemo(source);
|
|
258
257
|
const contexts = new Set(),
|
|
259
258
|
[value, setValue] = (options.storage || createSignal)(options.initialValue),
|
|
259
|
+
[error, setError] = createSignal(undefined),
|
|
260
260
|
[track, trigger] = createSignal(undefined, {
|
|
261
261
|
equals: false
|
|
262
262
|
}),
|
|
@@ -266,7 +266,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
266
266
|
let v;
|
|
267
267
|
if (options.ssrLoadFrom === "initial") initP = options.initialValue;else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v[0];
|
|
268
268
|
}
|
|
269
|
-
function loadEnd(p, v,
|
|
269
|
+
function loadEnd(p, v, error, key) {
|
|
270
270
|
if (pr === p) {
|
|
271
271
|
pr = null;
|
|
272
272
|
resolved = true;
|
|
@@ -283,25 +283,26 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
283
283
|
Effects.push.apply(Effects, Transition.effects);
|
|
284
284
|
Transition.effects = [];
|
|
285
285
|
}
|
|
286
|
-
completeLoad(v,
|
|
286
|
+
completeLoad(v, error);
|
|
287
287
|
}, false);
|
|
288
|
-
} else completeLoad(v,
|
|
288
|
+
} else completeLoad(v, error);
|
|
289
289
|
}
|
|
290
290
|
return v;
|
|
291
291
|
}
|
|
292
|
-
function completeLoad(v,
|
|
293
|
-
!success && (err = castError(v));
|
|
292
|
+
function completeLoad(v, err) {
|
|
294
293
|
runUpdates(() => {
|
|
295
|
-
setValue(() => v);
|
|
296
|
-
|
|
294
|
+
if (!err) setValue(() => v);
|
|
295
|
+
setError(err);
|
|
296
|
+
setState(err ? "errored" : "ready");
|
|
297
297
|
for (const c of contexts.keys()) c.decrement();
|
|
298
298
|
contexts.clear();
|
|
299
299
|
}, false);
|
|
300
300
|
}
|
|
301
301
|
function read() {
|
|
302
302
|
const c = SuspenseContext && lookup(Owner, SuspenseContext.id),
|
|
303
|
-
v = value()
|
|
304
|
-
|
|
303
|
+
v = value(),
|
|
304
|
+
err = error();
|
|
305
|
+
if (err && !pr) throw err;
|
|
305
306
|
if (Listener && !Listener.user && c) {
|
|
306
307
|
createComputed(() => {
|
|
307
308
|
track();
|
|
@@ -318,11 +319,10 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
318
319
|
function load(refetching = true) {
|
|
319
320
|
if (refetching !== false && scheduled) return;
|
|
320
321
|
scheduled = false;
|
|
321
|
-
err = undefined;
|
|
322
322
|
const lookup = dynamic ? dynamic() : source;
|
|
323
323
|
loadedUnderTransition = Transition && Transition.running;
|
|
324
324
|
if (lookup == null || lookup === false) {
|
|
325
|
-
loadEnd(pr, untrack(value)
|
|
325
|
+
loadEnd(pr, untrack(value));
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
328
328
|
if (Transition && pr) Transition.promises.delete(pr);
|
|
@@ -331,7 +331,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
331
331
|
refetching
|
|
332
332
|
}));
|
|
333
333
|
if (typeof p !== "object" || !("then" in p)) {
|
|
334
|
-
loadEnd(pr, p
|
|
334
|
+
loadEnd(pr, p);
|
|
335
335
|
return p;
|
|
336
336
|
}
|
|
337
337
|
pr = p;
|
|
@@ -341,27 +341,26 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
341
341
|
setState(resolved ? "refreshing" : "pending");
|
|
342
342
|
trigger();
|
|
343
343
|
}, false);
|
|
344
|
-
return p.then(v => loadEnd(p, v,
|
|
344
|
+
return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e)));
|
|
345
345
|
}
|
|
346
346
|
Object.defineProperties(read, {
|
|
347
347
|
state: {
|
|
348
348
|
get: () => state()
|
|
349
349
|
},
|
|
350
|
+
error: {
|
|
351
|
+
get: () => error()
|
|
352
|
+
},
|
|
350
353
|
loading: {
|
|
351
354
|
get() {
|
|
352
355
|
const s = state();
|
|
353
356
|
return s === "pending" || s === "refreshing";
|
|
354
357
|
}
|
|
355
358
|
},
|
|
356
|
-
error: {
|
|
357
|
-
get() {
|
|
358
|
-
return state() === "errored" ? err : undefined;
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
359
|
latest: {
|
|
362
360
|
get() {
|
|
363
361
|
if (!resolved) return read();
|
|
364
|
-
|
|
362
|
+
const err = error();
|
|
363
|
+
if (err && !pr) throw err;
|
|
365
364
|
return value();
|
|
366
365
|
}
|
|
367
366
|
}
|
|
@@ -810,9 +809,7 @@ function runUserEffects(queue) {
|
|
|
810
809
|
if (!e.user) runTop(e);else queue[userLength++] = e;
|
|
811
810
|
}
|
|
812
811
|
if (sharedConfig.context) setHydrateContext();
|
|
813
|
-
Effects = [];
|
|
814
812
|
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
815
|
-
if (Effects.length) runUserEffects(Effects);
|
|
816
813
|
}
|
|
817
814
|
function lookUpstream(node, ignore) {
|
|
818
815
|
const runningTransition = Transition && Transition.running;
|
package/dist/solid.js
CHANGED
|
@@ -143,7 +143,6 @@ const UNOWNED = {
|
|
|
143
143
|
owner: null
|
|
144
144
|
};
|
|
145
145
|
const NO_INIT = {};
|
|
146
|
-
const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
|
|
147
146
|
var Owner = null;
|
|
148
147
|
let Transition = null;
|
|
149
148
|
let Scheduler = null;
|
|
@@ -152,6 +151,7 @@ let Listener = null;
|
|
|
152
151
|
let Updates = null;
|
|
153
152
|
let Effects = null;
|
|
154
153
|
let ExecCount = 0;
|
|
154
|
+
const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
|
|
155
155
|
function createRoot(fn, detachedOwner) {
|
|
156
156
|
const listener = Listener,
|
|
157
157
|
owner = Owner,
|
|
@@ -243,8 +243,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
243
243
|
fetcher = pFetcher;
|
|
244
244
|
options = pOptions || {};
|
|
245
245
|
}
|
|
246
|
-
let
|
|
247
|
-
pr = null,
|
|
246
|
+
let pr = null,
|
|
248
247
|
initP = NO_INIT,
|
|
249
248
|
id = null,
|
|
250
249
|
loadedUnderTransition = false,
|
|
@@ -253,6 +252,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
253
252
|
dynamic = typeof source === "function" && createMemo(source);
|
|
254
253
|
const contexts = new Set(),
|
|
255
254
|
[value, setValue] = (options.storage || createSignal)(options.initialValue),
|
|
255
|
+
[error, setError] = createSignal(undefined),
|
|
256
256
|
[track, trigger] = createSignal(undefined, {
|
|
257
257
|
equals: false
|
|
258
258
|
}),
|
|
@@ -262,7 +262,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
262
262
|
let v;
|
|
263
263
|
if (options.ssrLoadFrom === "initial") initP = options.initialValue;else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v[0];
|
|
264
264
|
}
|
|
265
|
-
function loadEnd(p, v,
|
|
265
|
+
function loadEnd(p, v, error, key) {
|
|
266
266
|
if (pr === p) {
|
|
267
267
|
pr = null;
|
|
268
268
|
resolved = true;
|
|
@@ -279,25 +279,26 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
279
279
|
Effects.push.apply(Effects, Transition.effects);
|
|
280
280
|
Transition.effects = [];
|
|
281
281
|
}
|
|
282
|
-
completeLoad(v,
|
|
282
|
+
completeLoad(v, error);
|
|
283
283
|
}, false);
|
|
284
|
-
} else completeLoad(v,
|
|
284
|
+
} else completeLoad(v, error);
|
|
285
285
|
}
|
|
286
286
|
return v;
|
|
287
287
|
}
|
|
288
|
-
function completeLoad(v,
|
|
289
|
-
!success && (err = castError(v));
|
|
288
|
+
function completeLoad(v, err) {
|
|
290
289
|
runUpdates(() => {
|
|
291
|
-
setValue(() => v);
|
|
292
|
-
|
|
290
|
+
if (!err) setValue(() => v);
|
|
291
|
+
setError(err);
|
|
292
|
+
setState(err ? "errored" : "ready");
|
|
293
293
|
for (const c of contexts.keys()) c.decrement();
|
|
294
294
|
contexts.clear();
|
|
295
295
|
}, false);
|
|
296
296
|
}
|
|
297
297
|
function read() {
|
|
298
298
|
const c = SuspenseContext && lookup(Owner, SuspenseContext.id),
|
|
299
|
-
v = value()
|
|
300
|
-
|
|
299
|
+
v = value(),
|
|
300
|
+
err = error();
|
|
301
|
+
if (err && !pr) throw err;
|
|
301
302
|
if (Listener && !Listener.user && c) {
|
|
302
303
|
createComputed(() => {
|
|
303
304
|
track();
|
|
@@ -314,11 +315,10 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
314
315
|
function load(refetching = true) {
|
|
315
316
|
if (refetching !== false && scheduled) return;
|
|
316
317
|
scheduled = false;
|
|
317
|
-
err = undefined;
|
|
318
318
|
const lookup = dynamic ? dynamic() : source;
|
|
319
319
|
loadedUnderTransition = Transition && Transition.running;
|
|
320
320
|
if (lookup == null || lookup === false) {
|
|
321
|
-
loadEnd(pr, untrack(value)
|
|
321
|
+
loadEnd(pr, untrack(value));
|
|
322
322
|
return;
|
|
323
323
|
}
|
|
324
324
|
if (Transition && pr) Transition.promises.delete(pr);
|
|
@@ -327,7 +327,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
327
327
|
refetching
|
|
328
328
|
}));
|
|
329
329
|
if (typeof p !== "object" || !("then" in p)) {
|
|
330
|
-
loadEnd(pr, p
|
|
330
|
+
loadEnd(pr, p);
|
|
331
331
|
return p;
|
|
332
332
|
}
|
|
333
333
|
pr = p;
|
|
@@ -337,27 +337,26 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
337
337
|
setState(resolved ? "refreshing" : "pending");
|
|
338
338
|
trigger();
|
|
339
339
|
}, false);
|
|
340
|
-
return p.then(v => loadEnd(p, v,
|
|
340
|
+
return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e)));
|
|
341
341
|
}
|
|
342
342
|
Object.defineProperties(read, {
|
|
343
343
|
state: {
|
|
344
344
|
get: () => state()
|
|
345
345
|
},
|
|
346
|
+
error: {
|
|
347
|
+
get: () => error()
|
|
348
|
+
},
|
|
346
349
|
loading: {
|
|
347
350
|
get() {
|
|
348
351
|
const s = state();
|
|
349
352
|
return s === "pending" || s === "refreshing";
|
|
350
353
|
}
|
|
351
354
|
},
|
|
352
|
-
error: {
|
|
353
|
-
get() {
|
|
354
|
-
return state() === "errored" ? err : undefined;
|
|
355
|
-
}
|
|
356
|
-
},
|
|
357
355
|
latest: {
|
|
358
356
|
get() {
|
|
359
357
|
if (!resolved) return read();
|
|
360
|
-
|
|
358
|
+
const err = error();
|
|
359
|
+
if (err && !pr) throw err;
|
|
361
360
|
return value();
|
|
362
361
|
}
|
|
363
362
|
}
|
|
@@ -806,9 +805,7 @@ function runUserEffects(queue) {
|
|
|
806
805
|
if (!e.user) runTop(e);else queue[userLength++] = e;
|
|
807
806
|
}
|
|
808
807
|
if (sharedConfig.context) setHydrateContext();
|
|
809
|
-
Effects = [];
|
|
810
808
|
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
811
|
-
if (Effects.length) runUserEffects(Effects);
|
|
812
809
|
}
|
|
813
810
|
function lookUpstream(node, ignore) {
|
|
814
811
|
const runningTransition = Transition && Transition.running;
|
|
@@ -283,9 +283,10 @@ export namespace JSX {
|
|
|
283
283
|
onanimationiteration?: EventHandlerUnion<T, AnimationEvent>;
|
|
284
284
|
ontransitionend?: EventHandlerUnion<T, TransitionEvent>;
|
|
285
285
|
}
|
|
286
|
-
|
|
286
|
+
|
|
287
287
|
interface CSSProperties extends csstype.PropertiesHyphen {
|
|
288
288
|
// Override
|
|
289
|
+
[key: `—${string}`]: string | number | undefined
|
|
289
290
|
}
|
|
290
291
|
|
|
291
292
|
type HTMLAutocapitalize = "off" | "none" | "on" | "sentences" | "words" | "characters";
|
|
@@ -527,6 +528,77 @@ export namespace JSX {
|
|
|
527
528
|
"aria-valuenow"?: number | string;
|
|
528
529
|
/** Defines the human readable text alternative of aria-valuenow for a range widget. */
|
|
529
530
|
"aria-valuetext"?: string;
|
|
531
|
+
role?: FunctionMaybe<
|
|
532
|
+
| "alert"
|
|
533
|
+
| "alertdialog"
|
|
534
|
+
| "application"
|
|
535
|
+
| "article"
|
|
536
|
+
| "banner"
|
|
537
|
+
| "button"
|
|
538
|
+
| "cell"
|
|
539
|
+
| "checkbox"
|
|
540
|
+
| "columnheader"
|
|
541
|
+
| "combobox"
|
|
542
|
+
| "complementary"
|
|
543
|
+
| "contentinfo"
|
|
544
|
+
| "definition"
|
|
545
|
+
| "dialog"
|
|
546
|
+
| "directory"
|
|
547
|
+
| "document"
|
|
548
|
+
| "feed"
|
|
549
|
+
| "figure"
|
|
550
|
+
| "form"
|
|
551
|
+
| "grid"
|
|
552
|
+
| "gridcell"
|
|
553
|
+
| "group"
|
|
554
|
+
| "heading"
|
|
555
|
+
| "img"
|
|
556
|
+
| "link"
|
|
557
|
+
| "list"
|
|
558
|
+
| "listbox"
|
|
559
|
+
| "listitem"
|
|
560
|
+
| "log"
|
|
561
|
+
| "main"
|
|
562
|
+
| "marquee"
|
|
563
|
+
| "math"
|
|
564
|
+
| "menu"
|
|
565
|
+
| "menubar"
|
|
566
|
+
| "menuitem"
|
|
567
|
+
| "menuitemcheckbox"
|
|
568
|
+
| "menuitemradio"
|
|
569
|
+
| "meter"
|
|
570
|
+
| "navigation"
|
|
571
|
+
| "none"
|
|
572
|
+
| "note"
|
|
573
|
+
| "option"
|
|
574
|
+
| "presentation"
|
|
575
|
+
| "progressbar"
|
|
576
|
+
| "radio"
|
|
577
|
+
| "radiogroup"
|
|
578
|
+
| "region"
|
|
579
|
+
| "row"
|
|
580
|
+
| "rowgroup"
|
|
581
|
+
| "rowheader"
|
|
582
|
+
| "scrollbar"
|
|
583
|
+
| "search"
|
|
584
|
+
| "searchbox"
|
|
585
|
+
| "separator"
|
|
586
|
+
| "slider"
|
|
587
|
+
| "spinbutton"
|
|
588
|
+
| "status"
|
|
589
|
+
| "switch"
|
|
590
|
+
| "tab"
|
|
591
|
+
| "table"
|
|
592
|
+
| "tablist"
|
|
593
|
+
| "tabpanel"
|
|
594
|
+
| "term"
|
|
595
|
+
| "textbox"
|
|
596
|
+
| "timer"
|
|
597
|
+
| "toolbar"
|
|
598
|
+
| "tooltip"
|
|
599
|
+
| "tree"
|
|
600
|
+
| "treegrid"
|
|
601
|
+
| "treeitem">;
|
|
530
602
|
}
|
|
531
603
|
|
|
532
604
|
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
|
|
@@ -552,77 +624,6 @@ export namespace JSX {
|
|
|
552
624
|
resource?: FunctionMaybe<string>;
|
|
553
625
|
typeof?: FunctionMaybe<string>;
|
|
554
626
|
vocab?: FunctionMaybe<string>;
|
|
555
|
-
role?: FunctionMaybe<
|
|
556
|
-
| "alert"
|
|
557
|
-
| "alertdialog"
|
|
558
|
-
| "application"
|
|
559
|
-
| "article"
|
|
560
|
-
| "banner"
|
|
561
|
-
| "button"
|
|
562
|
-
| "cell"
|
|
563
|
-
| "checkbox"
|
|
564
|
-
| "columnheader"
|
|
565
|
-
| "combobox"
|
|
566
|
-
| "complementary"
|
|
567
|
-
| "contentinfo"
|
|
568
|
-
| "definition"
|
|
569
|
-
| "dialog"
|
|
570
|
-
| "directory"
|
|
571
|
-
| "document"
|
|
572
|
-
| "feed"
|
|
573
|
-
| "figure"
|
|
574
|
-
| "form"
|
|
575
|
-
| "grid"
|
|
576
|
-
| "gridcell"
|
|
577
|
-
| "group"
|
|
578
|
-
| "heading"
|
|
579
|
-
| "img"
|
|
580
|
-
| "link"
|
|
581
|
-
| "list"
|
|
582
|
-
| "listbox"
|
|
583
|
-
| "listitem"
|
|
584
|
-
| "log"
|
|
585
|
-
| "main"
|
|
586
|
-
| "marquee"
|
|
587
|
-
| "math"
|
|
588
|
-
| "menu"
|
|
589
|
-
| "menubar"
|
|
590
|
-
| "menuitem"
|
|
591
|
-
| "menuitemcheckbox"
|
|
592
|
-
| "menuitemradio"
|
|
593
|
-
| "meter"
|
|
594
|
-
| "navigation"
|
|
595
|
-
| "none"
|
|
596
|
-
| "note"
|
|
597
|
-
| "option"
|
|
598
|
-
| "presentation"
|
|
599
|
-
| "progressbar"
|
|
600
|
-
| "radio"
|
|
601
|
-
| "radiogroup"
|
|
602
|
-
| "region"
|
|
603
|
-
| "row"
|
|
604
|
-
| "rowgroup"
|
|
605
|
-
| "rowheader"
|
|
606
|
-
| "scrollbar"
|
|
607
|
-
| "search"
|
|
608
|
-
| "searchbox"
|
|
609
|
-
| "separator"
|
|
610
|
-
| "slider"
|
|
611
|
-
| "spinbutton"
|
|
612
|
-
| "status"
|
|
613
|
-
| "switch"
|
|
614
|
-
| "tab"
|
|
615
|
-
| "table"
|
|
616
|
-
| "tablist"
|
|
617
|
-
| "tabpanel"
|
|
618
|
-
| "term"
|
|
619
|
-
| "textbox"
|
|
620
|
-
| "timer"
|
|
621
|
-
| "toolbar"
|
|
622
|
-
| "tooltip"
|
|
623
|
-
| "tree"
|
|
624
|
-
| "treegrid"
|
|
625
|
-
| "treeitem">;
|
|
626
627
|
autocapitalize?: FunctionMaybe<HTMLAutocapitalize>;
|
|
627
628
|
slot?: FunctionMaybe<string>;
|
|
628
629
|
color?: FunctionMaybe<string>;
|
|
@@ -1082,7 +1083,7 @@ export namespace JSX {
|
|
|
1082
1083
|
| "defer xMidYMax slice"
|
|
1083
1084
|
| "defer xMaxYMax slice";
|
|
1084
1085
|
type SVGUnits = "userSpaceOnUse" | "objectBoundingBox";
|
|
1085
|
-
interface CoreSVGAttributes<T> extends DOMAttributes<T> {
|
|
1086
|
+
interface CoreSVGAttributes<T> extends AriaAttributes, DOMAttributes<T> {
|
|
1086
1087
|
id?: FunctionMaybe<string>;
|
|
1087
1088
|
lang?: FunctionMaybe<string>;
|
|
1088
1089
|
tabIndex?: FunctionMaybe<number | string>;
|
package/h/package.json
ADDED
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.5.
|
|
4
|
+
"version": "1.5.2",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -23,16 +23,22 @@
|
|
|
23
23
|
"dist",
|
|
24
24
|
"store/dist",
|
|
25
25
|
"store/types",
|
|
26
|
+
"store/package.json",
|
|
26
27
|
"web/dist",
|
|
27
28
|
"web/types",
|
|
29
|
+
"web/package.json",
|
|
28
30
|
"h/dist",
|
|
29
31
|
"h/types",
|
|
32
|
+
"h/package.json",
|
|
30
33
|
"h/jsx-runtime/dist",
|
|
31
34
|
"h/jsx-runtime/types",
|
|
35
|
+
"h/jsx-runtime/package.json",
|
|
32
36
|
"html/dist",
|
|
33
37
|
"html/types",
|
|
38
|
+
"html/package.json",
|
|
34
39
|
"universal/dist",
|
|
35
40
|
"universal/types",
|
|
41
|
+
"universal/package.json",
|
|
36
42
|
"types",
|
|
37
43
|
"jsx-runtime.d.ts"
|
|
38
44
|
],
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "solid-js/store",
|
|
3
|
+
"main": "./dist/server.cjs",
|
|
4
|
+
"module": "./dist/server.js",
|
|
5
|
+
"browser": {
|
|
6
|
+
"./dist/server.cjs": "./dist/store.cjs",
|
|
7
|
+
"./dist/server.js": "./dist/store.js"
|
|
8
|
+
},
|
|
9
|
+
"unpkg": "./dist/store.cjs",
|
|
10
|
+
"types": "./types/index.d.ts",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"browser": {
|
|
16
|
+
"development": {
|
|
17
|
+
"import": {
|
|
18
|
+
"types": "./types/index.d.ts",
|
|
19
|
+
"default": "./dist/dev.js"
|
|
20
|
+
},
|
|
21
|
+
"require": "./dist/dev.cjs"
|
|
22
|
+
},
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./types/index.d.ts",
|
|
25
|
+
"default": "./dist/store.js"
|
|
26
|
+
},
|
|
27
|
+
"require": "./dist/store.cjs"
|
|
28
|
+
},
|
|
29
|
+
"node": {
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./types/index.d.ts",
|
|
32
|
+
"default": "./dist/server.js"
|
|
33
|
+
},
|
|
34
|
+
"require": "./dist/server.cjs"
|
|
35
|
+
},
|
|
36
|
+
"development": {
|
|
37
|
+
"import": {
|
|
38
|
+
"types": "./types/index.d.ts",
|
|
39
|
+
"default": "./dist/dev.js"
|
|
40
|
+
},
|
|
41
|
+
"require": "./dist/dev.cjs"
|
|
42
|
+
},
|
|
43
|
+
"import": {
|
|
44
|
+
"types": "./types/index.d.ts",
|
|
45
|
+
"default": "./dist/store.js"
|
|
46
|
+
},
|
|
47
|
+
"require": "./dist/store.cjs"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
package/types/jsx.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as csstype from 'csstype
|
|
1
|
+
import * as csstype from 'csstype';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Based on JSX types for Surplus and Inferno and adapted for `dom-expressions`.
|
|
@@ -285,6 +285,7 @@ export namespace JSX {
|
|
|
285
285
|
|
|
286
286
|
interface CSSProperties extends csstype.PropertiesHyphen {
|
|
287
287
|
// Override
|
|
288
|
+
[key: `—${string}`]: string | number | undefined
|
|
288
289
|
}
|
|
289
290
|
|
|
290
291
|
type HTMLAutocapitalize = "off" | "none" | "on" | "sentences" | "words" | "characters";
|
|
@@ -526,40 +527,6 @@ export namespace JSX {
|
|
|
526
527
|
"aria-valuenow"?: number | string;
|
|
527
528
|
/** Defines the human readable text alternative of aria-valuenow for a range widget. */
|
|
528
529
|
"aria-valuetext"?: string;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
// TODO: Should we allow this?
|
|
532
|
-
// type ClassKeys = `class:${string}`;
|
|
533
|
-
// type CSSKeys = Exclude<keyof csstype.PropertiesHyphen, `-${string}`>;
|
|
534
|
-
|
|
535
|
-
// type CSSAttributes = {
|
|
536
|
-
// [key in CSSKeys as `style:${key}`]: csstype.PropertiesHyphen[key];
|
|
537
|
-
// };
|
|
538
|
-
|
|
539
|
-
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
|
|
540
|
-
// [key: ClassKeys]: boolean;
|
|
541
|
-
accessKey?: string;
|
|
542
|
-
class?: string;
|
|
543
|
-
contenteditable?: boolean | "inherit";
|
|
544
|
-
contextmenu?: string;
|
|
545
|
-
dir?: HTMLDir;
|
|
546
|
-
draggable?: boolean;
|
|
547
|
-
hidden?: boolean;
|
|
548
|
-
id?: string;
|
|
549
|
-
lang?: string;
|
|
550
|
-
spellcheck?: boolean;
|
|
551
|
-
style?: CSSProperties | string;
|
|
552
|
-
tabindex?: number | string;
|
|
553
|
-
title?: string;
|
|
554
|
-
translate?: "yes" | "no";
|
|
555
|
-
about?: string;
|
|
556
|
-
datatype?: string;
|
|
557
|
-
inlist?: any;
|
|
558
|
-
prefix?: string;
|
|
559
|
-
property?: string;
|
|
560
|
-
resource?: string;
|
|
561
|
-
typeof?: string;
|
|
562
|
-
vocab?: string;
|
|
563
530
|
role?:
|
|
564
531
|
| "alert"
|
|
565
532
|
| "alertdialog"
|
|
@@ -631,6 +598,40 @@ export namespace JSX {
|
|
|
631
598
|
| "tree"
|
|
632
599
|
| "treegrid"
|
|
633
600
|
| "treeitem";
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
// TODO: Should we allow this?
|
|
604
|
+
// type ClassKeys = `class:${string}`;
|
|
605
|
+
// type CSSKeys = Exclude<keyof csstype.PropertiesHyphen, `-${string}`>;
|
|
606
|
+
|
|
607
|
+
// type CSSAttributes = {
|
|
608
|
+
// [key in CSSKeys as `style:${key}`]: csstype.PropertiesHyphen[key];
|
|
609
|
+
// };
|
|
610
|
+
|
|
611
|
+
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
|
|
612
|
+
// [key: ClassKeys]: boolean;
|
|
613
|
+
accessKey?: string;
|
|
614
|
+
class?: string;
|
|
615
|
+
contenteditable?: boolean | "inherit";
|
|
616
|
+
contextmenu?: string;
|
|
617
|
+
dir?: HTMLDir;
|
|
618
|
+
draggable?: boolean;
|
|
619
|
+
hidden?: boolean;
|
|
620
|
+
id?: string;
|
|
621
|
+
lang?: string;
|
|
622
|
+
spellcheck?: boolean;
|
|
623
|
+
style?: CSSProperties | string;
|
|
624
|
+
tabindex?: number | string;
|
|
625
|
+
title?: string;
|
|
626
|
+
translate?: "yes" | "no";
|
|
627
|
+
about?: string;
|
|
628
|
+
datatype?: string;
|
|
629
|
+
inlist?: any;
|
|
630
|
+
prefix?: string;
|
|
631
|
+
property?: string;
|
|
632
|
+
resource?: string;
|
|
633
|
+
typeof?: string;
|
|
634
|
+
vocab?: string;
|
|
634
635
|
autocapitalize?: HTMLAutocapitalize;
|
|
635
636
|
slot?: string;
|
|
636
637
|
color?: string;
|
|
@@ -1090,7 +1091,7 @@ export namespace JSX {
|
|
|
1090
1091
|
| "defer xMidYMax slice"
|
|
1091
1092
|
| "defer xMaxYMax slice";
|
|
1092
1093
|
type SVGUnits = "userSpaceOnUse" | "objectBoundingBox";
|
|
1093
|
-
interface CoreSVGAttributes<T> extends DOMAttributes<T> {
|
|
1094
|
+
interface CoreSVGAttributes<T> extends AriaAttributes, DOMAttributes<T> {
|
|
1094
1095
|
id?: string;
|
|
1095
1096
|
lang?: string;
|
|
1096
1097
|
tabIndex?: number | string;
|
|
@@ -234,7 +234,7 @@ interface Errored {
|
|
|
234
234
|
export declare type Resource<T> = Unresolved | Pending | Ready<T> | Refreshing<T> | Errored;
|
|
235
235
|
export declare type InitializedResource<T> = Ready<T> | Refreshing<T> | Errored;
|
|
236
236
|
export declare type ResourceActions<T, R = unknown> = {
|
|
237
|
-
mutate: Setter<T
|
|
237
|
+
mutate: Setter<T>;
|
|
238
238
|
refetch: (info?: R) => T | Promise<T> | undefined | null;
|
|
239
239
|
};
|
|
240
240
|
export declare type ResourceSource<S> = S | false | null | undefined | (() => S | false | null | undefined);
|
|
@@ -256,7 +256,10 @@ export declare type ResourceOptions<T, S = unknown> = {
|
|
|
256
256
|
export declare type InitializedResourceOptions<T, S = unknown> = ResourceOptions<T, S> & {
|
|
257
257
|
initialValue: T;
|
|
258
258
|
};
|
|
259
|
-
export declare type ResourceReturn<T, R = unknown> = [
|
|
259
|
+
export declare type ResourceReturn<T, R = unknown> = [
|
|
260
|
+
Resource<T>,
|
|
261
|
+
ResourceActions<T | undefined, R>
|
|
262
|
+
];
|
|
260
263
|
export declare type InitializedResourceReturn<T, R = unknown> = [
|
|
261
264
|
InitializedResource<T>,
|
|
262
265
|
ResourceActions<T, R>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "solid-js/universal",
|
|
3
|
+
"main": "./dist/universal.cjs",
|
|
4
|
+
"module": "./dist/universal.js",
|
|
5
|
+
"types": "./types/index.d.ts",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"development": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./types/index.d.ts",
|
|
13
|
+
"default": "./dist/dev.js"
|
|
14
|
+
},
|
|
15
|
+
"require": "./dist/dev.cjs"
|
|
16
|
+
},
|
|
17
|
+
"import": {
|
|
18
|
+
"types": "./types/index.d.ts",
|
|
19
|
+
"default": "./dist/universal.js"
|
|
20
|
+
},
|
|
21
|
+
"require": "./dist/universal.cjs"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
package/web/dist/dev.cjs
CHANGED
|
@@ -250,6 +250,8 @@ function hydrate$1(code, element, options = {}) {
|
|
|
250
250
|
function getNextElement(template) {
|
|
251
251
|
let node, key;
|
|
252
252
|
if (!solidJs.sharedConfig.context || !(node = solidJs.sharedConfig.registry.get(key = getHydrationKey()))) {
|
|
253
|
+
if (solidJs.sharedConfig.context) console.warn("Unable to find DOM nodes for hydration key:", key);
|
|
254
|
+
if (!template) throw new Error("Unrecoverable Hydration Mismatch. No template for key: " + key);
|
|
253
255
|
return template.cloneNode(true);
|
|
254
256
|
}
|
|
255
257
|
if (solidJs.sharedConfig.completed) solidJs.sharedConfig.completed.add(node);
|
|
@@ -458,7 +460,7 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
458
460
|
} else if ((typeof item) === "function") {
|
|
459
461
|
if (unwrap) {
|
|
460
462
|
while (typeof item === "function") item = item();
|
|
461
|
-
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], prev) || dynamic;
|
|
463
|
+
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
|
|
462
464
|
} else {
|
|
463
465
|
normalized.push(item);
|
|
464
466
|
dynamic = true;
|
package/web/dist/dev.js
CHANGED
|
@@ -247,6 +247,8 @@ function hydrate$1(code, element, options = {}) {
|
|
|
247
247
|
function getNextElement(template) {
|
|
248
248
|
let node, key;
|
|
249
249
|
if (!sharedConfig.context || !(node = sharedConfig.registry.get(key = getHydrationKey()))) {
|
|
250
|
+
if (sharedConfig.context) console.warn("Unable to find DOM nodes for hydration key:", key);
|
|
251
|
+
if (!template) throw new Error("Unrecoverable Hydration Mismatch. No template for key: " + key);
|
|
250
252
|
return template.cloneNode(true);
|
|
251
253
|
}
|
|
252
254
|
if (sharedConfig.completed) sharedConfig.completed.add(node);
|
|
@@ -455,7 +457,7 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
455
457
|
} else if ((typeof item) === "function") {
|
|
456
458
|
if (unwrap) {
|
|
457
459
|
while (typeof item === "function") item = item();
|
|
458
|
-
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], prev) || dynamic;
|
|
460
|
+
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
|
|
459
461
|
} else {
|
|
460
462
|
normalized.push(item);
|
|
461
463
|
dynamic = true;
|
package/web/dist/server.cjs
CHANGED
|
@@ -528,8 +528,8 @@ function ssrElement(tag, props, children, needsId) {
|
|
|
528
528
|
let classResolved;
|
|
529
529
|
for (let i = 0; i < keys.length; i++) {
|
|
530
530
|
const prop = keys[i];
|
|
531
|
-
if (ChildProperties.has(prop)
|
|
532
|
-
children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
|
|
531
|
+
if (ChildProperties.has(prop)) {
|
|
532
|
+
if (children === undefined) children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
|
|
533
533
|
continue;
|
|
534
534
|
}
|
|
535
535
|
const value = props[prop];
|
package/web/dist/server.js
CHANGED
|
@@ -525,8 +525,8 @@ function ssrElement(tag, props, children, needsId) {
|
|
|
525
525
|
let classResolved;
|
|
526
526
|
for (let i = 0; i < keys.length; i++) {
|
|
527
527
|
const prop = keys[i];
|
|
528
|
-
if (ChildProperties.has(prop)
|
|
529
|
-
children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
|
|
528
|
+
if (ChildProperties.has(prop)) {
|
|
529
|
+
if (children === undefined) children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
|
|
530
530
|
continue;
|
|
531
531
|
}
|
|
532
532
|
const value = props[prop];
|
package/web/dist/web.cjs
CHANGED
|
@@ -457,7 +457,7 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
457
457
|
} else if ((typeof item) === "function") {
|
|
458
458
|
if (unwrap) {
|
|
459
459
|
while (typeof item === "function") item = item();
|
|
460
|
-
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], prev) || dynamic;
|
|
460
|
+
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
|
|
461
461
|
} else {
|
|
462
462
|
normalized.push(item);
|
|
463
463
|
dynamic = true;
|
package/web/dist/web.js
CHANGED
|
@@ -454,7 +454,7 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
454
454
|
} else if ((typeof item) === "function") {
|
|
455
455
|
if (unwrap) {
|
|
456
456
|
while (typeof item === "function") item = item();
|
|
457
|
-
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], prev) || dynamic;
|
|
457
|
+
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
|
|
458
458
|
} else {
|
|
459
459
|
normalized.push(item);
|
|
460
460
|
dynamic = true;
|
package/web/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "solid-js/web",
|
|
3
|
+
"main": "./dist/server.cjs",
|
|
4
|
+
"module": "./dist/server.js",
|
|
5
|
+
"browser": {
|
|
6
|
+
"./dist/server.cjs": "./dist/web.cjs",
|
|
7
|
+
"./dist/server.js": "./dist/web.js"
|
|
8
|
+
},
|
|
9
|
+
"unpkg": "./dist/web.cjs",
|
|
10
|
+
"types": "./types/index.d.ts",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"browser": {
|
|
16
|
+
"development": {
|
|
17
|
+
"import": {
|
|
18
|
+
"types": "./types/index.d.ts",
|
|
19
|
+
"default": "./dist/dev.js"
|
|
20
|
+
},
|
|
21
|
+
"require": "./dist/dev.cjs"
|
|
22
|
+
},
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./types/index.d.ts",
|
|
25
|
+
"default": "./dist/web.js"
|
|
26
|
+
},
|
|
27
|
+
"require": "./dist/web.cjs"
|
|
28
|
+
},
|
|
29
|
+
"node": {
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./types/index.d.ts",
|
|
32
|
+
"default": "./dist/server.js"
|
|
33
|
+
},
|
|
34
|
+
"require": "./dist/server.cjs"
|
|
35
|
+
},
|
|
36
|
+
"development": {
|
|
37
|
+
"import": {
|
|
38
|
+
"types": "./types/index.d.ts",
|
|
39
|
+
"default": "./dist/dev.js"
|
|
40
|
+
},
|
|
41
|
+
"require": "./dist/dev.cjs"
|
|
42
|
+
},
|
|
43
|
+
"import": {
|
|
44
|
+
"types": "./types/index.d.ts",
|
|
45
|
+
"default": "./dist/web.js"
|
|
46
|
+
},
|
|
47
|
+
"require": "./dist/web.cjs"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
package/web/types/client.d.ts
CHANGED
|
@@ -67,4 +67,4 @@ export function getAssets(): string;
|
|
|
67
67
|
export function Assets(props: { children?: JSX.Element }): JSX.Element;
|
|
68
68
|
export function HydrationScript(): JSX.Element;
|
|
69
69
|
export function NoHydration(props: { children?: JSX.Element }): JSX.Element;
|
|
70
|
-
export function
|
|
70
|
+
export function generateHydrationScript(): string;
|