solid-js 1.3.7 → 1.3.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 +6 -6
- package/dist/dev.js +6 -6
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/dist/solid.cjs +6 -6
- package/dist/solid.js +6 -6
- package/package.json +2 -2
- package/types/reactive/signal.d.ts +3 -1
- package/web/dist/dev.cjs +1 -1
- package/web/dist/dev.js +1 -1
- package/web/dist/web.cjs +1 -1
- package/web/dist/web.js +1 -1
package/dist/dev.cjs
CHANGED
|
@@ -124,7 +124,7 @@ function setHydrateContext(context) {
|
|
|
124
124
|
}
|
|
125
125
|
function nextHydrateContext() {
|
|
126
126
|
return { ...sharedConfig.context,
|
|
127
|
-
id: `${sharedConfig.context.id}${sharedConfig.context.count++}
|
|
127
|
+
id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,
|
|
128
128
|
count: 0
|
|
129
129
|
};
|
|
130
130
|
}
|
|
@@ -158,14 +158,13 @@ let Effects = null;
|
|
|
158
158
|
let ExecCount = 0;
|
|
159
159
|
let rootCount = 0;
|
|
160
160
|
function createRoot(fn, detachedOwner) {
|
|
161
|
-
detachedOwner && (Owner = detachedOwner);
|
|
162
161
|
const listener = Listener,
|
|
163
162
|
owner = Owner,
|
|
164
163
|
root = fn.length === 0 && !"_SOLID_DEV_" ? UNOWNED : {
|
|
165
164
|
owned: null,
|
|
166
165
|
cleanups: null,
|
|
167
166
|
context: null,
|
|
168
|
-
owner
|
|
167
|
+
owner: detachedOwner || owner
|
|
169
168
|
};
|
|
170
169
|
if (owner) root.name = `${owner.name}-r${rootCount++}`;
|
|
171
170
|
Owner = root;
|
|
@@ -405,7 +404,8 @@ function createSelector(source, fn = equalFn, options) {
|
|
|
405
404
|
let l;
|
|
406
405
|
if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));
|
|
407
406
|
onCleanup(() => {
|
|
408
|
-
l.
|
|
407
|
+
l.delete(listener);
|
|
408
|
+
!l.size && subs.delete(key);
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
411
|
return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
|
|
@@ -1015,7 +1015,7 @@ function observable(input) {
|
|
|
1015
1015
|
if (!(observer instanceof Object) || observer == null) {
|
|
1016
1016
|
throw new TypeError("Expected the observer to be an object.");
|
|
1017
1017
|
}
|
|
1018
|
-
const handler = "next" in observer ? observer.next : observer;
|
|
1018
|
+
const handler = "next" in observer ? observer.next.bind(observer) : observer;
|
|
1019
1019
|
let complete = false;
|
|
1020
1020
|
createComputed(() => {
|
|
1021
1021
|
if (complete) return;
|
|
@@ -1353,7 +1353,7 @@ function lazy(fn) {
|
|
|
1353
1353
|
let counter = 0;
|
|
1354
1354
|
function createUniqueId() {
|
|
1355
1355
|
const ctx = sharedConfig.context;
|
|
1356
|
-
return ctx ? `${ctx.id}${ctx.count++}` : `cl
|
|
1356
|
+
return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
|
|
1357
1357
|
}
|
|
1358
1358
|
|
|
1359
1359
|
function For(props) {
|
package/dist/dev.js
CHANGED
|
@@ -120,7 +120,7 @@ function setHydrateContext(context) {
|
|
|
120
120
|
}
|
|
121
121
|
function nextHydrateContext() {
|
|
122
122
|
return { ...sharedConfig.context,
|
|
123
|
-
id: `${sharedConfig.context.id}${sharedConfig.context.count++}
|
|
123
|
+
id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,
|
|
124
124
|
count: 0
|
|
125
125
|
};
|
|
126
126
|
}
|
|
@@ -154,14 +154,13 @@ let Effects = null;
|
|
|
154
154
|
let ExecCount = 0;
|
|
155
155
|
let rootCount = 0;
|
|
156
156
|
function createRoot(fn, detachedOwner) {
|
|
157
|
-
detachedOwner && (Owner = detachedOwner);
|
|
158
157
|
const listener = Listener,
|
|
159
158
|
owner = Owner,
|
|
160
159
|
root = fn.length === 0 && !"_SOLID_DEV_" ? UNOWNED : {
|
|
161
160
|
owned: null,
|
|
162
161
|
cleanups: null,
|
|
163
162
|
context: null,
|
|
164
|
-
owner
|
|
163
|
+
owner: detachedOwner || owner
|
|
165
164
|
};
|
|
166
165
|
if (owner) root.name = `${owner.name}-r${rootCount++}`;
|
|
167
166
|
Owner = root;
|
|
@@ -401,7 +400,8 @@ function createSelector(source, fn = equalFn, options) {
|
|
|
401
400
|
let l;
|
|
402
401
|
if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));
|
|
403
402
|
onCleanup(() => {
|
|
404
|
-
l.
|
|
403
|
+
l.delete(listener);
|
|
404
|
+
!l.size && subs.delete(key);
|
|
405
405
|
});
|
|
406
406
|
}
|
|
407
407
|
return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
|
|
@@ -1011,7 +1011,7 @@ function observable(input) {
|
|
|
1011
1011
|
if (!(observer instanceof Object) || observer == null) {
|
|
1012
1012
|
throw new TypeError("Expected the observer to be an object.");
|
|
1013
1013
|
}
|
|
1014
|
-
const handler = "next" in observer ? observer.next : observer;
|
|
1014
|
+
const handler = "next" in observer ? observer.next.bind(observer) : observer;
|
|
1015
1015
|
let complete = false;
|
|
1016
1016
|
createComputed(() => {
|
|
1017
1017
|
if (complete) return;
|
|
@@ -1349,7 +1349,7 @@ function lazy(fn) {
|
|
|
1349
1349
|
let counter = 0;
|
|
1350
1350
|
function createUniqueId() {
|
|
1351
1351
|
const ctx = sharedConfig.context;
|
|
1352
|
-
return ctx ? `${ctx.id}${ctx.count++}` : `cl
|
|
1352
|
+
return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
|
|
1353
1353
|
}
|
|
1354
1354
|
|
|
1355
1355
|
function For(props) {
|
package/dist/server.cjs
CHANGED
|
@@ -231,7 +231,7 @@ function setHydrateContext(context) {
|
|
|
231
231
|
}
|
|
232
232
|
function nextHydrateContext() {
|
|
233
233
|
return sharedConfig.context ? { ...sharedConfig.context,
|
|
234
|
-
id: `${sharedConfig.context.id}${sharedConfig.context.count++}
|
|
234
|
+
id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,
|
|
235
235
|
count: 0
|
|
236
236
|
} : undefined;
|
|
237
237
|
}
|
package/dist/server.js
CHANGED
|
@@ -227,7 +227,7 @@ function setHydrateContext(context) {
|
|
|
227
227
|
}
|
|
228
228
|
function nextHydrateContext() {
|
|
229
229
|
return sharedConfig.context ? { ...sharedConfig.context,
|
|
230
|
-
id: `${sharedConfig.context.id}${sharedConfig.context.count++}
|
|
230
|
+
id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,
|
|
231
231
|
count: 0
|
|
232
232
|
} : undefined;
|
|
233
233
|
}
|
package/dist/solid.cjs
CHANGED
|
@@ -124,7 +124,7 @@ function setHydrateContext(context) {
|
|
|
124
124
|
}
|
|
125
125
|
function nextHydrateContext() {
|
|
126
126
|
return { ...sharedConfig.context,
|
|
127
|
-
id: `${sharedConfig.context.id}${sharedConfig.context.count++}
|
|
127
|
+
id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,
|
|
128
128
|
count: 0
|
|
129
129
|
};
|
|
130
130
|
}
|
|
@@ -157,14 +157,13 @@ let Updates = null;
|
|
|
157
157
|
let Effects = null;
|
|
158
158
|
let ExecCount = 0;
|
|
159
159
|
function createRoot(fn, detachedOwner) {
|
|
160
|
-
detachedOwner && (Owner = detachedOwner);
|
|
161
160
|
const listener = Listener,
|
|
162
161
|
owner = Owner,
|
|
163
162
|
root = fn.length === 0 && !false ? UNOWNED : {
|
|
164
163
|
owned: null,
|
|
165
164
|
cleanups: null,
|
|
166
165
|
context: null,
|
|
167
|
-
owner
|
|
166
|
+
owner: detachedOwner || owner
|
|
168
167
|
};
|
|
169
168
|
Owner = root;
|
|
170
169
|
Listener = null;
|
|
@@ -402,7 +401,8 @@ function createSelector(source, fn = equalFn, options) {
|
|
|
402
401
|
let l;
|
|
403
402
|
if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));
|
|
404
403
|
onCleanup(() => {
|
|
405
|
-
l.
|
|
404
|
+
l.delete(listener);
|
|
405
|
+
!l.size && subs.delete(key);
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
|
|
@@ -934,7 +934,7 @@ function observable(input) {
|
|
|
934
934
|
if (!(observer instanceof Object) || observer == null) {
|
|
935
935
|
throw new TypeError("Expected the observer to be an object.");
|
|
936
936
|
}
|
|
937
|
-
const handler = "next" in observer ? observer.next : observer;
|
|
937
|
+
const handler = "next" in observer ? observer.next.bind(observer) : observer;
|
|
938
938
|
let complete = false;
|
|
939
939
|
createComputed(() => {
|
|
940
940
|
if (complete) return;
|
|
@@ -1269,7 +1269,7 @@ function lazy(fn) {
|
|
|
1269
1269
|
let counter = 0;
|
|
1270
1270
|
function createUniqueId() {
|
|
1271
1271
|
const ctx = sharedConfig.context;
|
|
1272
|
-
return ctx ? `${ctx.id}${ctx.count++}` : `cl
|
|
1272
|
+
return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
|
|
1273
1273
|
}
|
|
1274
1274
|
|
|
1275
1275
|
function For(props) {
|
package/dist/solid.js
CHANGED
|
@@ -120,7 +120,7 @@ function setHydrateContext(context) {
|
|
|
120
120
|
}
|
|
121
121
|
function nextHydrateContext() {
|
|
122
122
|
return { ...sharedConfig.context,
|
|
123
|
-
id: `${sharedConfig.context.id}${sharedConfig.context.count++}
|
|
123
|
+
id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,
|
|
124
124
|
count: 0
|
|
125
125
|
};
|
|
126
126
|
}
|
|
@@ -153,14 +153,13 @@ let Updates = null;
|
|
|
153
153
|
let Effects = null;
|
|
154
154
|
let ExecCount = 0;
|
|
155
155
|
function createRoot(fn, detachedOwner) {
|
|
156
|
-
detachedOwner && (Owner = detachedOwner);
|
|
157
156
|
const listener = Listener,
|
|
158
157
|
owner = Owner,
|
|
159
158
|
root = fn.length === 0 && !false ? UNOWNED : {
|
|
160
159
|
owned: null,
|
|
161
160
|
cleanups: null,
|
|
162
161
|
context: null,
|
|
163
|
-
owner
|
|
162
|
+
owner: detachedOwner || owner
|
|
164
163
|
};
|
|
165
164
|
Owner = root;
|
|
166
165
|
Listener = null;
|
|
@@ -398,7 +397,8 @@ function createSelector(source, fn = equalFn, options) {
|
|
|
398
397
|
let l;
|
|
399
398
|
if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));
|
|
400
399
|
onCleanup(() => {
|
|
401
|
-
l.
|
|
400
|
+
l.delete(listener);
|
|
401
|
+
!l.size && subs.delete(key);
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
404
|
return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
|
|
@@ -930,7 +930,7 @@ function observable(input) {
|
|
|
930
930
|
if (!(observer instanceof Object) || observer == null) {
|
|
931
931
|
throw new TypeError("Expected the observer to be an object.");
|
|
932
932
|
}
|
|
933
|
-
const handler = "next" in observer ? observer.next : observer;
|
|
933
|
+
const handler = "next" in observer ? observer.next.bind(observer) : observer;
|
|
934
934
|
let complete = false;
|
|
935
935
|
createComputed(() => {
|
|
936
936
|
if (complete) return;
|
|
@@ -1265,7 +1265,7 @@ function lazy(fn) {
|
|
|
1265
1265
|
let counter = 0;
|
|
1266
1266
|
function createUniqueId() {
|
|
1267
1267
|
const ctx = sharedConfig.context;
|
|
1268
|
-
return ctx ? `${ctx.id}${ctx.count++}` : `cl
|
|
1268
|
+
return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
|
|
1269
1269
|
}
|
|
1270
1270
|
|
|
1271
1271
|
function For(props) {
|
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.
|
|
4
|
+
"version": "1.3.8",
|
|
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": "6e7f0a80cd949e6dd5c0baaf45432ed2b0693119"
|
|
148
148
|
}
|
|
@@ -437,6 +437,8 @@ export declare function createContext<T>(defaultValue: T): Context<T>;
|
|
|
437
437
|
* @description https://www.solidjs.com/docs/latest/api#usecontext
|
|
438
438
|
*/
|
|
439
439
|
export declare function useContext<T>(context: Context<T>): T;
|
|
440
|
+
export declare type ResolvedJSXElement = Exclude<JSX.Element, JSX.ArrayElement | JSX.FunctionElement>;
|
|
441
|
+
export declare type ResolvedChildren = ResolvedJSXElement | ResolvedJSXElement[];
|
|
440
442
|
/**
|
|
441
443
|
* Resolves child elements to help interact with children
|
|
442
444
|
*
|
|
@@ -445,7 +447,7 @@ export declare function useContext<T>(context: Context<T>): T;
|
|
|
445
447
|
*
|
|
446
448
|
* @description https://www.solidjs.com/docs/latest/api#children
|
|
447
449
|
*/
|
|
448
|
-
export declare function children(fn: Accessor<JSX.Element>): Accessor<
|
|
450
|
+
export declare function children(fn: Accessor<JSX.Element>): Accessor<ResolvedChildren>;
|
|
449
451
|
export declare type SuspenseContextType = {
|
|
450
452
|
increment?: () => void;
|
|
451
453
|
decrement?: () => void;
|
package/web/dist/dev.cjs
CHANGED
|
@@ -404,7 +404,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
404
404
|
}
|
|
405
405
|
current = array;
|
|
406
406
|
} else if (value instanceof Node) {
|
|
407
|
-
if (solidJs.sharedConfig.context) return current = value.parentNode ? multi ? [value] : value : current;
|
|
407
|
+
if (solidJs.sharedConfig.context && current && current.length) return current = value.parentNode ? multi ? [value] : value : current;
|
|
408
408
|
if (Array.isArray(current)) {
|
|
409
409
|
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
410
410
|
cleanChildren(parent, current, null, value);
|
package/web/dist/dev.js
CHANGED
|
@@ -401,7 +401,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
401
401
|
}
|
|
402
402
|
current = array;
|
|
403
403
|
} else if (value instanceof Node) {
|
|
404
|
-
if (sharedConfig.context) return current = value.parentNode ? multi ? [value] : value : current;
|
|
404
|
+
if (sharedConfig.context && current && current.length) return current = value.parentNode ? multi ? [value] : value : current;
|
|
405
405
|
if (Array.isArray(current)) {
|
|
406
406
|
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
407
407
|
cleanChildren(parent, current, null, value);
|
package/web/dist/web.cjs
CHANGED
|
@@ -403,7 +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 ? multi ? [value] : value : current;
|
|
406
|
+
if (solidJs.sharedConfig.context && current && current.length) return current = value.parentNode ? multi ? [value] : value : current;
|
|
407
407
|
if (Array.isArray(current)) {
|
|
408
408
|
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
409
409
|
cleanChildren(parent, current, null, value);
|
package/web/dist/web.js
CHANGED
|
@@ -400,7 +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 ? multi ? [value] : value : current;
|
|
403
|
+
if (sharedConfig.context && current && current.length) return current = value.parentNode ? multi ? [value] : value : current;
|
|
404
404
|
if (Array.isArray(current)) {
|
|
405
405
|
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
406
406
|
cleanChildren(parent, current, null, value);
|