solid-js 1.5.3 → 1.5.4
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/server.cjs +2 -0
- package/dist/server.js +2 -1
- package/html/dist/html.cjs +2 -1
- package/html/dist/html.js +3 -2
- package/html/types/lit.d.ts +1 -0
- package/package.json +1 -1
- package/types/reactive/observable.d.ts +2 -2
- package/types/server/index.d.ts +1 -1
- package/types/server/reactive.d.ts +1 -0
- package/web/dist/dev.cjs +4 -0
- package/web/dist/dev.js +1 -1
- package/web/dist/server.cjs +4 -0
- package/web/dist/server.js +3 -1
- package/web/dist/web.cjs +4 -0
- package/web/dist/web.js +1 -1
- package/web/types/client.d.ts +1 -0
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 $TRACK = Symbol("solid-track");
|
|
7
8
|
const $DEVCOMP = Symbol("solid-dev-component");
|
|
8
9
|
const DEV = {};
|
|
9
10
|
const ERROR = Symbol("error");
|
|
@@ -604,6 +605,7 @@ function Suspense(props) {
|
|
|
604
605
|
|
|
605
606
|
exports.$DEVCOMP = $DEVCOMP;
|
|
606
607
|
exports.$PROXY = $PROXY;
|
|
608
|
+
exports.$TRACK = $TRACK;
|
|
607
609
|
exports.DEV = DEV;
|
|
608
610
|
exports.ErrorBoundary = ErrorBoundary;
|
|
609
611
|
exports.For = For;
|
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 $TRACK = Symbol("solid-track");
|
|
3
4
|
const $DEVCOMP = Symbol("solid-dev-component");
|
|
4
5
|
const DEV = {};
|
|
5
6
|
const ERROR = Symbol("error");
|
|
@@ -598,4 +599,4 @@ function Suspense(props) {
|
|
|
598
599
|
return props.fallback;
|
|
599
600
|
}
|
|
600
601
|
|
|
601
|
-
export { $DEVCOMP, $PROXY, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createReaction, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableHydration, enableScheduling, equalFn, from, getListener, getOwner, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount, requestCallback, resetErrorBoundaries, runWithOwner, sharedConfig, splitProps, startTransition, untrack, useContext, useTransition };
|
|
602
|
+
export { $DEVCOMP, $PROXY, $TRACK, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createReaction, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableHydration, enableScheduling, equalFn, from, getListener, getOwner, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount, requestCallback, resetErrorBoundaries, runWithOwner, sharedConfig, splitProps, startTransition, untrack, useContext, useTransition };
|
package/html/dist/html.cjs
CHANGED
|
@@ -420,7 +420,7 @@ function createHTML(r, {
|
|
|
420
420
|
options.first = false;
|
|
421
421
|
processChildren(node, options);
|
|
422
422
|
if (topDecl) {
|
|
423
|
-
options.decl[0] = options.hasCustomElement ? `const ${tag} = document.importNode(tmpls[${templateId}].content.firstChild, true)` : `const ${tag} = tmpls[${templateId}].content.firstChild.cloneNode(true)`;
|
|
423
|
+
options.decl[0] = options.hasCustomElement ? `const ${tag} = r.untrack(() => document.importNode(tmpls[${templateId}].content.firstChild, true))` : `const ${tag} = tmpls[${templateId}].content.firstChild.cloneNode(true)`;
|
|
424
424
|
}
|
|
425
425
|
} else if (node.type === "text") {
|
|
426
426
|
const tag = `_$el${uuid++}`;
|
|
@@ -479,6 +479,7 @@ var index = createHTML({
|
|
|
479
479
|
effect: web.effect,
|
|
480
480
|
style: web.style,
|
|
481
481
|
insert: web.insert,
|
|
482
|
+
untrack: web.untrack,
|
|
482
483
|
spread: web.spread,
|
|
483
484
|
createComponent: web.createComponent,
|
|
484
485
|
delegateEvents: web.delegateEvents,
|
package/html/dist/html.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { effect, style, insert, spread, createComponent, delegateEvents, classList, mergeProps, dynamicProperty, setAttribute, setAttributeNS, addEventListener, Aliases, PropAliases, Properties, ChildProperties, DelegatedEvents, SVGElements, SVGNamespace } from 'solid-js/web';
|
|
1
|
+
import { effect, style, insert, untrack, spread, createComponent, delegateEvents, classList, mergeProps, dynamicProperty, setAttribute, setAttributeNS, addEventListener, Aliases, PropAliases, Properties, ChildProperties, DelegatedEvents, SVGElements, SVGNamespace } from 'solid-js/web';
|
|
2
2
|
|
|
3
3
|
const tagRE = /(?:<!--[\S\s]*?-->|<(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>)/g;
|
|
4
4
|
const attrRE = /(?:\s(?<boolean>[^/\s><=]+?)(?=[\s/>]))|(?:(?<name>\S+?)(?:\s*=\s*(?:(['"])(?<quotedValue>[\s\S]*?)\3|(?<unquotedValue>[^\s>]+))))/g;
|
|
@@ -418,7 +418,7 @@ function createHTML(r, {
|
|
|
418
418
|
options.first = false;
|
|
419
419
|
processChildren(node, options);
|
|
420
420
|
if (topDecl) {
|
|
421
|
-
options.decl[0] = options.hasCustomElement ? `const ${tag} = document.importNode(tmpls[${templateId}].content.firstChild, true)` : `const ${tag} = tmpls[${templateId}].content.firstChild.cloneNode(true)`;
|
|
421
|
+
options.decl[0] = options.hasCustomElement ? `const ${tag} = r.untrack(() => document.importNode(tmpls[${templateId}].content.firstChild, true))` : `const ${tag} = tmpls[${templateId}].content.firstChild.cloneNode(true)`;
|
|
422
422
|
}
|
|
423
423
|
} else if (node.type === "text") {
|
|
424
424
|
const tag = `_$el${uuid++}`;
|
|
@@ -477,6 +477,7 @@ var index = createHTML({
|
|
|
477
477
|
effect,
|
|
478
478
|
style,
|
|
479
479
|
insert,
|
|
480
|
+
untrack,
|
|
480
481
|
spread,
|
|
481
482
|
createComponent,
|
|
482
483
|
delegateEvents,
|
package/html/types/lit.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
2
2
|
interface Runtime {
|
|
3
3
|
effect<T>(fn: (prev?: T) => T, init?: T): any;
|
|
4
|
+
untrack<T>(fn: () => T): T;
|
|
4
5
|
insert(parent: MountableElement, accessor: any, marker?: Node | null, init?: any): any;
|
|
5
6
|
spread<T>(node: Element, accessor: (() => T) | T, isSVG?: Boolean, skipChildren?: Boolean): void;
|
|
6
7
|
createComponent(Comp: (props: any) => any, props: any): any;
|
package/package.json
CHANGED
|
@@ -25,8 +25,8 @@ export declare function observable<T>(input: Accessor<T>): {
|
|
|
25
25
|
};
|
|
26
26
|
[Symbol.observable](): any;
|
|
27
27
|
};
|
|
28
|
-
export declare function from<T>(producer: ((setter: Setter<T>) => () => void) | {
|
|
28
|
+
export declare function from<T>(producer: ((setter: Setter<T | undefined>) => () => void) | {
|
|
29
29
|
subscribe: (fn: (v: T) => void) => (() => void) | {
|
|
30
30
|
unsubscribe: () => void;
|
|
31
31
|
};
|
|
32
|
-
}): Accessor<T>;
|
|
32
|
+
}): Accessor<T | undefined>;
|
package/types/server/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createRoot, createSignal, createComputed, createRenderEffect, createEffect, createReaction, createDeferred, createSelector, createMemo, getListener, onMount, onCleanup, onError, untrack, batch, on, children, createContext, useContext, getOwner, runWithOwner, equalFn, requestCallback, mapArray, observable, from, $PROXY, $DEVCOMP, DEV, enableExternalSource } from "./reactive.js";
|
|
1
|
+
export { createRoot, createSignal, createComputed, createRenderEffect, createEffect, createReaction, createDeferred, createSelector, createMemo, getListener, onMount, onCleanup, onError, untrack, batch, on, children, createContext, useContext, getOwner, runWithOwner, equalFn, requestCallback, mapArray, observable, from, $PROXY, $DEVCOMP, $TRACK, DEV, enableExternalSource } from "./reactive.js";
|
|
2
2
|
export { mergeProps, splitProps, createComponent, For, Index, Show, Switch, Match, ErrorBoundary, Suspense, SuspenseList, createResource, resetErrorBoundaries, enableScheduling, enableHydration, startTransition, useTransition, createUniqueId, lazy, sharedConfig } from "./rendering.js";
|
|
3
3
|
export type { Component, Resource } from "./rendering.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const equalFn: <T>(a: T, b: T) => boolean;
|
|
2
2
|
export declare const $PROXY: unique symbol;
|
|
3
|
+
export declare const $TRACK: unique symbol;
|
|
3
4
|
export declare const $DEVCOMP: unique symbol;
|
|
4
5
|
export declare const DEV: {};
|
|
5
6
|
export declare type Accessor<T> = () => T;
|
package/web/dist/dev.cjs
CHANGED
|
@@ -646,6 +646,10 @@ Object.defineProperty(exports, 'mergeProps', {
|
|
|
646
646
|
enumerable: true,
|
|
647
647
|
get: function () { return solidJs.mergeProps; }
|
|
648
648
|
});
|
|
649
|
+
Object.defineProperty(exports, 'untrack', {
|
|
650
|
+
enumerable: true,
|
|
651
|
+
get: function () { return solidJs.untrack; }
|
|
652
|
+
});
|
|
649
653
|
exports.Aliases = Aliases;
|
|
650
654
|
exports.Assets = voidFn;
|
|
651
655
|
exports.ChildProperties = ChildProperties;
|
package/web/dist/dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createMemo, createRoot, createRenderEffect, sharedConfig, untrack, enableHydration, createSignal, onCleanup, splitProps, $DEVCOMP } from 'solid-js';
|
|
2
|
-
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps } from 'solid-js';
|
|
2
|
+
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps, untrack } from 'solid-js';
|
|
3
3
|
|
|
4
4
|
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
5
5
|
const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
package/web/dist/server.cjs
CHANGED
|
@@ -763,7 +763,9 @@ function ssrSpread(props, isSVG, skipChildren) {
|
|
|
763
763
|
}
|
|
764
764
|
|
|
765
765
|
const isServer = true;
|
|
766
|
+
function insert() {}
|
|
766
767
|
function spread() {}
|
|
768
|
+
function delegateEvents() {}
|
|
767
769
|
function Dynamic(props) {
|
|
768
770
|
const [p, others] = solidJs.splitProps(props, ["component"]);
|
|
769
771
|
const comp = p.component,
|
|
@@ -823,10 +825,12 @@ exports.Dynamic = Dynamic;
|
|
|
823
825
|
exports.HydrationScript = HydrationScript;
|
|
824
826
|
exports.NoHydration = NoHydration;
|
|
825
827
|
exports.Portal = Portal;
|
|
828
|
+
exports.delegateEvents = delegateEvents;
|
|
826
829
|
exports.escape = escape;
|
|
827
830
|
exports.generateHydrationScript = generateHydrationScript;
|
|
828
831
|
exports.getAssets = getAssets;
|
|
829
832
|
exports.getHydrationKey = getHydrationKey;
|
|
833
|
+
exports.insert = insert;
|
|
830
834
|
exports.isServer = isServer;
|
|
831
835
|
exports.pipeToNodeWritable = pipeToNodeWritable;
|
|
832
836
|
exports.pipeToWritable = pipeToWritable;
|
package/web/dist/server.js
CHANGED
|
@@ -760,7 +760,9 @@ function ssrSpread(props, isSVG, skipChildren) {
|
|
|
760
760
|
}
|
|
761
761
|
|
|
762
762
|
const isServer = true;
|
|
763
|
+
function insert() {}
|
|
763
764
|
function spread() {}
|
|
765
|
+
function delegateEvents() {}
|
|
764
766
|
function Dynamic(props) {
|
|
765
767
|
const [p, others] = splitProps(props, ["component"]);
|
|
766
768
|
const comp = p.component,
|
|
@@ -775,4 +777,4 @@ function Portal(props) {
|
|
|
775
777
|
return "";
|
|
776
778
|
}
|
|
777
779
|
|
|
778
|
-
export { Assets, Dynamic, HydrationScript, NoHydration, Portal, escape, generateHydrationScript, getAssets, getHydrationKey, isServer, pipeToNodeWritable, pipeToWritable, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, useAssets };
|
|
780
|
+
export { Assets, Dynamic, HydrationScript, NoHydration, Portal, delegateEvents, escape, generateHydrationScript, getAssets, getHydrationKey, insert, isServer, pipeToNodeWritable, pipeToWritable, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, useAssets };
|
package/web/dist/web.cjs
CHANGED
|
@@ -640,6 +640,10 @@ Object.defineProperty(exports, 'mergeProps', {
|
|
|
640
640
|
enumerable: true,
|
|
641
641
|
get: function () { return solidJs.mergeProps; }
|
|
642
642
|
});
|
|
643
|
+
Object.defineProperty(exports, 'untrack', {
|
|
644
|
+
enumerable: true,
|
|
645
|
+
get: function () { return solidJs.untrack; }
|
|
646
|
+
});
|
|
643
647
|
exports.Aliases = Aliases;
|
|
644
648
|
exports.Assets = voidFn;
|
|
645
649
|
exports.ChildProperties = ChildProperties;
|
package/web/dist/web.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createMemo, createRoot, createRenderEffect, sharedConfig, untrack, enableHydration, createSignal, onCleanup, splitProps } from 'solid-js';
|
|
2
|
-
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps } from 'solid-js';
|
|
2
|
+
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps, untrack } from 'solid-js';
|
|
3
3
|
|
|
4
4
|
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
5
5
|
const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
package/web/types/client.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export function render(code: () => JSX.Element, element: MountableElement): () =
|
|
|
13
13
|
export function template(html: string, count: number, isSVG?: boolean): Element;
|
|
14
14
|
export function effect<T>(fn: (prev?: T) => T, init?: T): void;
|
|
15
15
|
export function memo<T>(fn: () => T, equal: boolean): () => T;
|
|
16
|
+
export function untrack<T>(fn: () => T): T;
|
|
16
17
|
export function insert<T>(
|
|
17
18
|
parent: MountableElement,
|
|
18
19
|
accessor: (() => T) | T,
|