solid-js 1.5.0-beta.1 → 1.5.0-beta.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/dev.cjs +161 -145
- package/dist/dev.js +161 -145
- package/dist/server.cjs +76 -42
- package/dist/server.js +76 -42
- package/dist/solid.cjs +161 -145
- package/dist/solid.js +161 -145
- package/h/jsx-runtime/types/jsx.d.ts +3 -1
- package/package.json +81 -21
- package/store/types/index.d.ts +4 -4
- package/store/types/mutable.d.ts +1 -1
- package/store/types/server.d.ts +1 -1
- package/store/types/store.d.ts +2 -2
- package/types/index.d.ts +8 -8
- package/types/jsx.d.ts +4 -2
- package/types/reactive/array.d.ts +1 -1
- package/types/reactive/observable.d.ts +1 -1
- package/types/reactive/signal.d.ts +51 -36
- package/types/render/Suspense.d.ts +1 -1
- package/types/render/component.d.ts +1 -1
- package/types/render/flow.d.ts +20 -3
- package/types/render/index.d.ts +4 -4
- package/types/server/index.d.ts +3 -3
- package/types/server/reactive.d.ts +6 -3
- package/types/server/rendering.d.ts +16 -7
- package/universal/dist/dev.cjs +4 -1
- package/universal/dist/dev.js +5 -2
- package/universal/dist/universal.cjs +4 -1
- package/universal/dist/universal.js +5 -2
- package/universal/types/index.d.ts +1 -1
- package/web/dist/dev.cjs +13 -7
- package/web/dist/dev.js +8 -6
- package/web/dist/server.cjs +324 -246
- package/web/dist/server.js +322 -247
- package/web/dist/web.cjs +13 -7
- package/web/dist/web.js +8 -6
- package/web/types/client.d.ts +4 -1
- package/web/types/core.d.ts +2 -2
- package/web/types/index.d.ts +3 -3
- package/web/types/jsx.d.ts +1 -1
- package/web/types/server-mock.d.ts +4 -1
- package/web/types/server.d.ts +2 -0
package/web/dist/web.cjs
CHANGED
|
@@ -206,6 +206,9 @@ function dynamicProperty(props, key) {
|
|
|
206
206
|
function innerHTML(parent, content) {
|
|
207
207
|
!solidJs.sharedConfig.context && (parent.innerHTML = content);
|
|
208
208
|
}
|
|
209
|
+
function use(fn, element, arg) {
|
|
210
|
+
return solidJs.untrack(() => fn(element, arg));
|
|
211
|
+
}
|
|
209
212
|
function insert(parent, accessor, marker, initial) {
|
|
210
213
|
if (marker !== undefined && !initial) initial = [];
|
|
211
214
|
if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker);
|
|
@@ -413,6 +416,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
413
416
|
return () => current;
|
|
414
417
|
}
|
|
415
418
|
if (solidJs.sharedConfig.context) {
|
|
419
|
+
if (!array.length) return current;
|
|
416
420
|
for (let i = 0; i < array.length; i++) {
|
|
417
421
|
if (array[i].parentNode) return current = array;
|
|
418
422
|
}
|
|
@@ -497,12 +501,10 @@ function getHydrationKey() {
|
|
|
497
501
|
const hydrate = solidJs.sharedConfig.context;
|
|
498
502
|
return `${hydrate.id}${hydrate.count++}`;
|
|
499
503
|
}
|
|
500
|
-
function Assets() {
|
|
501
|
-
return;
|
|
502
|
-
}
|
|
503
504
|
function NoHydration(props) {
|
|
504
505
|
return solidJs.sharedConfig.context ? undefined : props.children;
|
|
505
506
|
}
|
|
507
|
+
function voidFn() {}
|
|
506
508
|
|
|
507
509
|
function throwInBrowser(func) {
|
|
508
510
|
const err = new Error(`${func.name} is not supported in the browser, returning undefined`);
|
|
@@ -525,7 +527,7 @@ function ssrAttribute(key, value) {}
|
|
|
525
527
|
function ssrHydrationKey() {}
|
|
526
528
|
function resolveSSRNode(node) {}
|
|
527
529
|
function escape(html) {}
|
|
528
|
-
function
|
|
530
|
+
function ssrSpread(props, isSVG, skipChildren) {}
|
|
529
531
|
|
|
530
532
|
const isServer = false;
|
|
531
533
|
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
@@ -639,12 +641,12 @@ Object.defineProperty(exports, 'mergeProps', {
|
|
|
639
641
|
get: function () { return solidJs.mergeProps; }
|
|
640
642
|
});
|
|
641
643
|
exports.Aliases = Aliases;
|
|
642
|
-
exports.Assets =
|
|
644
|
+
exports.Assets = voidFn;
|
|
643
645
|
exports.ChildProperties = ChildProperties;
|
|
644
646
|
exports.DOMElements = DOMElements;
|
|
645
647
|
exports.DelegatedEvents = DelegatedEvents;
|
|
646
648
|
exports.Dynamic = Dynamic;
|
|
647
|
-
exports.HydrationScript =
|
|
649
|
+
exports.HydrationScript = voidFn;
|
|
648
650
|
exports.NoHydration = NoHydration;
|
|
649
651
|
exports.Portal = Portal;
|
|
650
652
|
exports.PropAliases = PropAliases;
|
|
@@ -659,7 +661,8 @@ exports.clearDelegatedEvents = clearDelegatedEvents;
|
|
|
659
661
|
exports.delegateEvents = delegateEvents;
|
|
660
662
|
exports.dynamicProperty = dynamicProperty;
|
|
661
663
|
exports.escape = escape;
|
|
662
|
-
exports.generateHydrationScript =
|
|
664
|
+
exports.generateHydrationScript = voidFn;
|
|
665
|
+
exports.getAssets = voidFn;
|
|
663
666
|
exports.getHydrationKey = getHydrationKey;
|
|
664
667
|
exports.getNextElement = getNextElement;
|
|
665
668
|
exports.getNextMarker = getNextMarker;
|
|
@@ -683,6 +686,9 @@ exports.ssrAttribute = ssrAttribute;
|
|
|
683
686
|
exports.ssrClassList = ssrClassList;
|
|
684
687
|
exports.ssrElement = ssrElement;
|
|
685
688
|
exports.ssrHydrationKey = ssrHydrationKey;
|
|
689
|
+
exports.ssrSpread = ssrSpread;
|
|
686
690
|
exports.ssrStyle = ssrStyle;
|
|
687
691
|
exports.style = style;
|
|
688
692
|
exports.template = template;
|
|
693
|
+
exports.use = use;
|
|
694
|
+
exports.useAssets = voidFn;
|
package/web/dist/web.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createMemo, createRoot, createRenderEffect, sharedConfig, enableHydration, createSignal, onCleanup, splitProps
|
|
1
|
+
import { createMemo, createRoot, createRenderEffect, sharedConfig, untrack, enableHydration, createSignal, onCleanup, splitProps } from 'solid-js';
|
|
2
2
|
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps } 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"];
|
|
@@ -203,6 +203,9 @@ function dynamicProperty(props, key) {
|
|
|
203
203
|
function innerHTML(parent, content) {
|
|
204
204
|
!sharedConfig.context && (parent.innerHTML = content);
|
|
205
205
|
}
|
|
206
|
+
function use(fn, element, arg) {
|
|
207
|
+
return untrack(() => fn(element, arg));
|
|
208
|
+
}
|
|
206
209
|
function insert(parent, accessor, marker, initial) {
|
|
207
210
|
if (marker !== undefined && !initial) initial = [];
|
|
208
211
|
if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker);
|
|
@@ -410,6 +413,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
410
413
|
return () => current;
|
|
411
414
|
}
|
|
412
415
|
if (sharedConfig.context) {
|
|
416
|
+
if (!array.length) return current;
|
|
413
417
|
for (let i = 0; i < array.length; i++) {
|
|
414
418
|
if (array[i].parentNode) return current = array;
|
|
415
419
|
}
|
|
@@ -494,12 +498,10 @@ function getHydrationKey() {
|
|
|
494
498
|
const hydrate = sharedConfig.context;
|
|
495
499
|
return `${hydrate.id}${hydrate.count++}`;
|
|
496
500
|
}
|
|
497
|
-
function Assets() {
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
500
501
|
function NoHydration(props) {
|
|
501
502
|
return sharedConfig.context ? undefined : props.children;
|
|
502
503
|
}
|
|
504
|
+
function voidFn() {}
|
|
503
505
|
|
|
504
506
|
function throwInBrowser(func) {
|
|
505
507
|
const err = new Error(`${func.name} is not supported in the browser, returning undefined`);
|
|
@@ -522,7 +524,7 @@ function ssrAttribute(key, value) {}
|
|
|
522
524
|
function ssrHydrationKey() {}
|
|
523
525
|
function resolveSSRNode(node) {}
|
|
524
526
|
function escape(html) {}
|
|
525
|
-
function
|
|
527
|
+
function ssrSpread(props, isSVG, skipChildren) {}
|
|
526
528
|
|
|
527
529
|
const isServer = false;
|
|
528
530
|
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
@@ -587,4 +589,4 @@ function Dynamic(props) {
|
|
|
587
589
|
});
|
|
588
590
|
}
|
|
589
591
|
|
|
590
|
-
export { Aliases, Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic,
|
|
592
|
+
export { Aliases, voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, voidFn as HydrationScript, NoHydration, Portal, PropAliases, Properties, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch, hydrate, innerHTML, insert, isServer, memo, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, style, template, use, voidFn as useAssets };
|
package/web/types/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSX } from "./jsx";
|
|
1
|
+
import { JSX } from "./jsx.js";
|
|
2
2
|
export const Aliases: Record<string, string>;
|
|
3
3
|
export const PropAliases: Record<string, string>;
|
|
4
4
|
export const Properties: Set<string>;
|
|
@@ -62,6 +62,9 @@ export function getHydrationKey(): string;
|
|
|
62
62
|
export function getNextElement(template?: HTMLTemplateElement): Element;
|
|
63
63
|
export function getNextMatch(start: Node, elementName: string): Element;
|
|
64
64
|
export function getNextMarker(start: Node): [Node, Array<Node>];
|
|
65
|
+
export function useAsset(fn: () => string): void;
|
|
66
|
+
export function getAssets(): string;
|
|
65
67
|
export function Assets(props: { children?: JSX.Element }): JSX.Element;
|
|
66
68
|
export function HydrationScript(): JSX.Element;
|
|
67
69
|
export function NoHydration(props: { children?: JSX.Element }): JSX.Element;
|
|
70
|
+
export function getHydrationScript(): string;
|
package/web/types/core.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { createRoot, createRenderEffect, createComponent, getOwner, sharedConfig } from "solid-js";
|
|
1
|
+
import { createRoot, createRenderEffect, createComponent, getOwner, sharedConfig, untrack } from "solid-js";
|
|
2
2
|
declare function memo<T>(fn: () => T, equals: boolean): import("solid-js").Accessor<T>;
|
|
3
|
-
export { getOwner, createComponent, createRoot as root, createRenderEffect as effect, memo, sharedConfig };
|
|
3
|
+
export { getOwner, createComponent, createRoot as root, createRenderEffect as effect, memo, sharedConfig, untrack };
|
package/web/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { hydrate as hydrateCore } from "./client";
|
|
1
|
+
import { hydrate as hydrateCore } from "./client.js";
|
|
2
2
|
import { JSX, Accessor, ComponentProps, ValidComponent } from "solid-js";
|
|
3
|
-
export * from "./client";
|
|
3
|
+
export * from "./client.js";
|
|
4
4
|
export { For, Show, Suspense, SuspenseList, Switch, Match, Index, ErrorBoundary, mergeProps } from "solid-js";
|
|
5
|
-
export * from "./server-mock";
|
|
5
|
+
export * from "./server-mock.js";
|
|
6
6
|
export declare const isServer = false;
|
|
7
7
|
export declare const hydrate: typeof hydrateCore;
|
|
8
8
|
/**
|
package/web/types/jsx.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { JSX } from "
|
|
1
|
+
export type { JSX } from "../../types/jsx.js";
|
|
@@ -38,7 +38,10 @@ export declare function ssrAttribute(key: string, value: boolean): string;
|
|
|
38
38
|
export declare function ssrHydrationKey(): string;
|
|
39
39
|
export declare function resolveSSRNode(node: any): string;
|
|
40
40
|
export declare function escape(html: string): string;
|
|
41
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated Replaced by ssrElement
|
|
43
|
+
*/
|
|
44
|
+
export declare function ssrSpread(props: any, isSVG: boolean, skipChildren: boolean): void;
|
|
42
45
|
export declare type LegacyResults = {
|
|
43
46
|
startWriting: () => void;
|
|
44
47
|
};
|
package/web/types/server.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export function ssrAttribute(key: string, value: any, isBoolean: boolean): strin
|
|
|
37
37
|
export function ssrHydrationKey(): string;
|
|
38
38
|
export function resolveSSRNode(node: any): string;
|
|
39
39
|
export function escape(html: string): string;
|
|
40
|
+
export function useAsset(fn: () => string): void;
|
|
41
|
+
export function getAssets(): string;
|
|
40
42
|
export function getHydrationKey(): string;
|
|
41
43
|
export function effect<T>(fn: (prev?: T) => T, init?: T): void;
|
|
42
44
|
export function memo<T>(fn: () => T, equal: boolean): () => T;
|