Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

solid-js

Package Overview
Dependencies
Maintainers
1
Versions
463
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solid-js - npm Package Compare versions

Comparing version 1.6.10 to 1.6.11

21

dist/dev.js

@@ -170,3 +170,3 @@ let taskIdCounter = 1,

context: null,
owner: detachedOwner || owner
owner: detachedOwner === undefined ? owner : detachedOwner
},

@@ -301,4 +301,4 @@ updateFn = unowned ? () => fn(() => {

runUpdates(() => {
if (!err) setValue(() => v);
setState(err ? "errored" : "ready");
if (err === undefined) setValue(() => v);
setState(err !== undefined ? "errored" : "ready");
setError(err);

@@ -313,3 +313,3 @@ for (const c of contexts.keys()) c.decrement();

err = error();
if (err && !pr) throw err;
if (err !== undefined && !pr) throw err;
if (Listener && !Listener.user && c) {

@@ -427,2 +427,3 @@ createComputed(() => {

function untrack(fn) {
if (Listener === null) return fn();
const listener = Listener;

@@ -818,3 +819,3 @@ Listener = null;

} catch (err) {
if (!Updates) Effects = null;
if (!wait) Effects = null;
Updates = null;

@@ -971,2 +972,5 @@ handleError(err);

}
function runErrors(fns, err) {
for (const f of fns) f(err);
}
function handleError(err) {

@@ -976,3 +980,8 @@ err = castError(err);

if (!fns) throw err;
for (const f of fns) f(err);
if (Effects) Effects.push({
fn() {
runErrors(fns, err);
},
state: STALE
});else runErrors(fns, err);
}

@@ -979,0 +988,0 @@ function lookup(owner, key) {

@@ -24,7 +24,6 @@ const equalFn = (a, b) => a === b;

function createRoot(fn, detachedOwner) {
detachedOwner && (Owner = detachedOwner);
const owner = Owner,
root = fn.length === 0 ? UNOWNED : {
context: null,
owner
owner: detachedOwner === undefined ? owner : detachedOwner
};

@@ -31,0 +30,0 @@ Owner = root;

@@ -164,3 +164,3 @@ let taskIdCounter = 1,

context: null,
owner: detachedOwner || owner
owner: detachedOwner === undefined ? owner : detachedOwner
},

@@ -288,4 +288,4 @@ updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));

runUpdates(() => {
if (!err) setValue(() => v);
setState(err ? "errored" : "ready");
if (err === undefined) setValue(() => v);
setState(err !== undefined ? "errored" : "ready");
setError(err);

@@ -300,3 +300,3 @@ for (const c of contexts.keys()) c.decrement();

err = error();
if (err && !pr) throw err;
if (err !== undefined && !pr) throw err;
if (Listener && !Listener.user && c) {

@@ -414,2 +414,3 @@ createComputed(() => {

function untrack(fn) {
if (Listener === null) return fn();
const listener = Listener;

@@ -748,3 +749,3 @@ Listener = null;

} catch (err) {
if (!Updates) Effects = null;
if (!wait) Effects = null;
Updates = null;

@@ -900,2 +901,5 @@ handleError(err);

}
function runErrors(fns, err) {
for (const f of fns) f(err);
}
function handleError(err) {

@@ -905,3 +909,8 @@ err = castError(err);

if (!fns) throw err;
for (const f of fns) f(err);
if (Effects) Effects.push({
fn() {
runErrors(fns, err);
},
state: STALE
});else runErrors(fns, err);
}

@@ -908,0 +917,0 @@ function lookup(owner, key) {

@@ -1,2 +0,2 @@

export { default as jsx, default as jsxDEV, default as jsxs } from 'solid-js/h';
import h from 'solid-js/h';

@@ -6,3 +6,6 @@ function Fragment(props) {

}
function jsx(type, props) {
return h(type, props);
}
export { Fragment };
export { Fragment, jsx, jsx as jsxDEV, jsx as jsxs };

@@ -1,2 +0,1 @@

import h from "solid-js/h";
export type { JSX } from "./jsx";

@@ -7,2 +6,7 @@ import type { JSX } from "./jsx";

}): JSX.Element;
export { h as jsx, h as jsxs, h as jsxDEV, Fragment };
declare function jsx(type: any, props: any): () => (Node & {
[key: string]: any;
}) | (Node & {
[key: string]: any;
})[];
export { jsx, jsx as jsxs, jsx as jsxDEV, Fragment };
{
"name": "solid-js",
"description": "A declarative JavaScript library for building user interfaces.",
"version": "1.6.10",
"version": "1.6.11",
"author": "Ryan Carniato",

@@ -249,3 +249,4 @@ "license": "MIT",

},
"./html/dist/*": "./html/dist/*"
"./html/dist/*": "./html/dist/*",
"./package.json": "./package.json"
},

@@ -252,0 +253,0 @@ "keywords": [

@@ -1,2 +0,2 @@

export declare type ReconcileOptions = {
export type ReconcileOptions = {
key?: string | null;

@@ -3,0 +3,0 @@ merge?: boolean;

@@ -9,9 +9,9 @@ import type { SetStoreFunction, Store } from "./store.js";

export declare function createMutable<T>(state: T | Store<T>): T;
declare type ReconcileOptions = {
type ReconcileOptions = {
key?: string | null;
merge?: boolean;
};
export declare function reconcile<T extends U, U>(value: T, options?: ReconcileOptions): (state: U) => T;
export declare function reconcile<T extends U, U extends object>(value: T, options?: ReconcileOptions): (state: U) => T;
export declare function produce<T>(fn: (state: T) => void): (state: T) => T;
export declare const DEV: undefined;
export {};

@@ -5,8 +5,8 @@ export declare const $RAW: unique symbol, $NODE: unique symbol, $NAME: unique symbol;

}
declare type DataNode = {
type DataNode = {
(): any;
$(value?: any): void;
};
declare type DataNodes = Record<PropertyKey, DataNode>;
export declare type OnStoreNodeUpdate = (state: StoreNode, property: PropertyKey, value: StoreNode | NotWrappable, prev: StoreNode | NotWrappable) => void;
type DataNodes = Record<PropertyKey, DataNode>;
export type OnStoreNodeUpdate = (state: StoreNode, property: PropertyKey, value: StoreNode | NotWrappable, prev: StoreNode | NotWrappable) => void;
export interface StoreNode {

@@ -21,4 +21,4 @@ [$NAME]?: string;

}
export declare type NotWrappable = string | number | bigint | symbol | boolean | Function | null | undefined | SolidStore.Unwrappable[keyof SolidStore.Unwrappable];
export declare type Store<T> = T;
export type NotWrappable = string | number | bigint | symbol | boolean | Function | null | undefined | SolidStore.Unwrappable[keyof SolidStore.Unwrappable];
export type Store<T> = T;
export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;

@@ -39,3 +39,3 @@ /**

export declare function getDataNode(nodes: DataNodes, property: PropertyKey, value: any): DataNode;
export declare function proxyDescriptor(target: StoreNode, property: PropertyKey): PropertyDescriptor | undefined;
export declare function proxyDescriptor(target: StoreNode, property: PropertyKey): TypedPropertyDescriptor<any> | undefined;
export declare function trackSelf(target: StoreNode): void;

@@ -46,10 +46,10 @@ export declare function ownKeys(target: StoreNode): (string | symbol)[];

/** @deprecated */
export declare type DeepReadonly<T> = 0 extends 1 & T ? T : T extends NotWrappable ? T : {
export type DeepReadonly<T> = 0 extends 1 & T ? T : T extends NotWrappable ? T : {
readonly [K in keyof T]: DeepReadonly<T[K]>;
};
/** @deprecated */
export declare type DeepMutable<T> = 0 extends 1 & T ? T : T extends NotWrappable ? T : {
export type DeepMutable<T> = 0 extends 1 & T ? T : T extends NotWrappable ? T : {
-readonly [K in keyof T]: DeepMutable<T[K]>;
};
export declare type CustomPartial<T> = T extends readonly unknown[] ? "0" extends keyof T ? {
export type CustomPartial<T> = T extends readonly unknown[] ? "0" extends keyof T ? {
[K in Extract<keyof T, `${number}`>]?: T[K];

@@ -59,3 +59,3 @@ } : {

} : Partial<T>;
export declare type PickMutable<T> = {
export type PickMutable<T> = {
[K in keyof T as (<U>() => U extends {

@@ -67,3 +67,3 @@ [V in K]: T[V];

};
export declare type StorePathRange = {
export type StorePathRange = {
from?: number;

@@ -73,11 +73,11 @@ to?: number;

};
export declare type ArrayFilterFn<T> = (item: T, index: number) => boolean;
export declare type StoreSetter<T, U extends PropertyKey[] = []> = T | CustomPartial<T> | ((prevState: T, traversed: U) => T | CustomPartial<T>);
export declare type Part<T, K extends KeyOf<T> = KeyOf<T>> = K | ([K] extends [never] ? never : readonly K[]) | ([T] extends [readonly unknown[]] ? ArrayFilterFn<T[number]> | StorePathRange : never);
declare type W<T> = Exclude<T, NotWrappable>;
declare type KeyOf<T> = number extends keyof T ? 0 extends 1 & T ? keyof T : [T] extends [readonly unknown[]] ? number : [T] extends [never] ? never : keyof T : keyof T;
declare type MutableKeyOf<T> = KeyOf<T> & keyof PickMutable<T>;
declare type Rest<T, U extends PropertyKey[], K extends KeyOf<T> = KeyOf<T>> = K extends keyof PickMutable<T> ? [Part<T, K>, ...RestSetterOrContinue<T[K], [K, ...U]>] : K extends KeyOf<K> ? [Part<T, K>, ...RestContinue<T[K], [K, ...U]>] : never;
declare type RestContinue<T, U extends PropertyKey[]> = 0 extends 1 & T ? [...Part<any>[], StoreSetter<any, PropertyKey[]>] : Rest<T, U>;
declare type RestSetterOrContinue<T, U extends PropertyKey[]> = [StoreSetter<T, U>] | RestContinue<T, U>;
export type ArrayFilterFn<T> = (item: T, index: number) => boolean;
export type StoreSetter<T, U extends PropertyKey[] = []> = T | CustomPartial<T> | ((prevState: T, traversed: U) => T | CustomPartial<T>);
export type Part<T, K extends KeyOf<T> = KeyOf<T>> = K | ([K] extends [never] ? never : readonly K[]) | ([T] extends [readonly unknown[]] ? ArrayFilterFn<T[number]> | StorePathRange : never);
type W<T> = Exclude<T, NotWrappable>;
type KeyOf<T> = number extends keyof T ? 0 extends 1 & T ? keyof T : [T] extends [readonly unknown[]] ? number : [T] extends [never] ? never : keyof T : keyof T;
type MutableKeyOf<T> = KeyOf<T> & keyof PickMutable<T>;
type Rest<T, U extends PropertyKey[], K extends KeyOf<T> = KeyOf<T>> = [T] extends [never] ? never : K extends MutableKeyOf<T> ? [Part<T, K>, ...RestSetterOrContinue<T[K], [K, ...U]>] : K extends KeyOf<T> ? [Part<T, K>, ...RestContinue<T[K], [K, ...U]>] : never;
type RestContinue<T, U extends PropertyKey[]> = 0 extends 1 & T ? [...Part<any>[], StoreSetter<any, PropertyKey[]>] : Rest<W<T>, U>;
type RestSetterOrContinue<T, U extends PropertyKey[]> = [StoreSetter<T, U>] | RestContinue<T, U>;
export interface SetStoreFunction<T> {

@@ -93,3 +93,3 @@ <K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>, K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>, K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>, K7 extends MutableKeyOf<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>, k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>, k7: Part<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>, K7>, setter: StoreSetter<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7], [

]>): void;
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>, K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>, K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>, k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>, setter: StoreSetter<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6], [K6, K5, K4, K3, K2, K1]>): void;
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>, K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>, K6 extends MutableKeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>, k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>, setter: StoreSetter<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6], [K6, K5, K4, K3, K2, K1]>): void;
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>, K5 extends MutableKeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>, setter: StoreSetter<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5], [K5, K4, K3, K2, K1]>): void;

@@ -96,0 +96,0 @@ <K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends MutableKeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, setter: StoreSetter<W<W<W<W<T>[K1]>[K2]>[K3]>[K4], [K4, K3, K2, K1]>): void;

@@ -8,3 +8,3 @@ export { $DEVCOMP, $PROXY, $TRACK, batch, children, createComputed, createContext, createDeferred, createEffect, createMemo, createReaction, createRenderEffect, createResource, createRoot, createSelector, createSignal, enableExternalSource, enableScheduling, equalFn, getListener, getOwner, on, onCleanup, onError, onMount, runWithOwner, startTransition, untrack, useContext, useTransition } from "./reactive/signal.js";

import type { JSX } from "./jsx.js";
declare type JSXElement = JSX.Element;
type JSXElement = JSX.Element;
export type { JSXElement, JSX };

@@ -11,0 +11,0 @@ import { hashValue, registerGraph, serializeGraph, writeSignal } from "./reactive/signal.js";

@@ -13,3 +13,3 @@ import { Accessor, Setter } from "./signal.js";

}
export declare type ObservableObserver<T> = ((v: T) => void) | {
export type ObservableObserver<T> = ((v: T) => void) | {
next?: (v: T) => void;

@@ -16,0 +16,0 @@ error?: (v: any) => void;

@@ -15,3 +15,3 @@ import { requestCallback } from "./scheduler.js";

}
export declare type ComputationState = 0 | 1 | 2;
export type ComputationState = 0 | 1 | 2;
export interface SourceMapValue {

@@ -61,3 +61,3 @@ value: unknown;

}
declare type ExternalSourceFactory = <Prev, Next extends Prev = Prev>(fn: EffectFunction<Prev, Next>, trigger: () => void) => ExternalSource;
type ExternalSourceFactory = <Prev, Next extends Prev = Prev>(fn: EffectFunction<Prev, Next>, trigger: () => void) => ExternalSource;
export interface ExternalSource {

@@ -67,3 +67,3 @@ track: EffectFunction<any, any>;

}
export declare type RootFunction<T> = (dispose: () => void) => T;
export type RootFunction<T> = (dispose: () => void) => T;
/**

@@ -78,6 +78,6 @@ * Creates a new non-tracked reactive context that doesn't auto-dispose

*/
export declare function createRoot<T>(fn: RootFunction<T>, detachedOwner?: Owner): T;
export declare type Accessor<T> = () => T;
export declare type Setter<T> = (undefined extends T ? () => undefined : {}) & (<U extends T>(value: (prev: T) => U) => U) & (<U extends T>(value: Exclude<U, Function>) => U) & (<U extends T>(value: Exclude<U, Function> | ((prev: T) => U)) => U);
export declare type Signal<T> = [get: Accessor<T>, set: Setter<T>];
export declare function createRoot<T>(fn: RootFunction<T>, detachedOwner?: typeof Owner): T;
export type Accessor<T> = () => T;
export type Setter<T> = (undefined extends T ? () => undefined : {}) & (<U extends T>(value: (prev: T) => U) => U) & (<U extends T>(value: Exclude<U, Function>) => U) & (<U extends T>(value: Exclude<U, Function> | ((prev: T) => U)) => U);
export type Signal<T> = [get: Accessor<T>, set: Setter<T>];
export interface SignalOptions<T> extends MemoOptions<T> {

@@ -114,6 +114,6 @@ internal?: boolean;

}
export declare type NoInfer<T extends any> = [T][T extends any ? 0 : never];
export type NoInfer<T extends any> = [T][T extends any ? 0 : never];
export interface EffectOptions extends BaseOptions {
}
export declare type EffectFunction<Prev, Next extends Prev = Prev> = (v: Prev) => Next;
export type EffectFunction<Prev, Next extends Prev = Prev> = (v: Prev) => Next;
/**

@@ -243,15 +243,15 @@ * Creates a reactive computation that runs immediately before render, mainly used to write to other reactive primitives

}
export declare type Resource<T> = Unresolved | Pending | Ready<T> | Refreshing<T> | Errored;
export declare type InitializedResource<T> = Ready<T> | Refreshing<T> | Errored;
export declare type ResourceActions<T, R = unknown> = {
export type Resource<T> = Unresolved | Pending | Ready<T> | Refreshing<T> | Errored;
export type InitializedResource<T> = Ready<T> | Refreshing<T> | Errored;
export type ResourceActions<T, R = unknown> = {
mutate: Setter<T>;
refetch: (info?: R) => T | Promise<T> | undefined | null;
};
export declare type ResourceSource<S> = S | false | null | undefined | (() => S | false | null | undefined);
export declare type ResourceFetcher<S, T, R = unknown> = (k: S, info: ResourceFetcherInfo<T, R>) => T | Promise<T>;
export declare type ResourceFetcherInfo<T, R = unknown> = {
export type ResourceSource<S> = S | false | null | undefined | (() => S | false | null | undefined);
export type ResourceFetcher<S, T, R = unknown> = (k: S, info: ResourceFetcherInfo<T, R>) => T | Promise<T>;
export type ResourceFetcherInfo<T, R = unknown> = {
value: T | undefined;
refetching: R | boolean;
};
export declare type ResourceOptions<T, S = unknown> = {
export type ResourceOptions<T, S = unknown> = {
initialValue?: T;

@@ -266,7 +266,7 @@ name?: string;

};
export declare type InitializedResourceOptions<T, S = unknown> = ResourceOptions<T, S> & {
export type InitializedResourceOptions<T, S = unknown> = ResourceOptions<T, S> & {
initialValue: T;
};
export declare type ResourceReturn<T, R = unknown> = [Resource<T>, ResourceActions<T | undefined, R>];
export declare type InitializedResourceReturn<T, R = unknown> = [
export type ResourceReturn<T, R = unknown> = [Resource<T>, ResourceActions<T | undefined, R>];
export type InitializedResourceReturn<T, R = unknown> = [
InitializedResource<T>,

@@ -326,3 +326,3 @@ ResourceActions<T, R>

export declare function createDeferred<T>(source: Accessor<T>, options?: DeferredOptions<T>): Accessor<T>;
export declare type EqualityCheckerFunction<T, U> = (a: U, b: T) => boolean;
export type EqualityCheckerFunction<T, U> = (a: U, b: T) => boolean;
/**

@@ -370,9 +370,9 @@ * Creates a conditional signal that only notifies subscribers when entering or exiting their key matching the value

/** @deprecated */
export declare type ReturnTypes<T> = T extends readonly Accessor<unknown>[] ? {
export type ReturnTypes<T> = T extends readonly Accessor<unknown>[] ? {
[K in keyof T]: T[K] extends Accessor<infer I> ? I : never;
} : T extends Accessor<infer I> ? I : never;
export declare type AccessorArray<T> = [...Extract<{
export type AccessorArray<T> = [...Extract<{
[K in keyof T]: Accessor<T[K]>;
}, readonly unknown[]>];
export declare type OnEffectFunction<S, Prev, Next extends Prev = Prev> = (input: S, prevInput: S | undefined, prev: Prev) => Next;
export type OnEffectFunction<S, Prev, Next extends Prev = Prev> = (input: S, prevInput: S | undefined, prev: Prev) => Next;
export interface OnOptions {

@@ -440,3 +440,3 @@ defer?: boolean;

export declare function getOwner(): Owner | null;
export declare function runWithOwner<T>(o: Owner, fn: () => T): T | undefined;
export declare function runWithOwner<T>(o: typeof Owner, fn: () => T): T | undefined;
export declare function enableScheduling(scheduler?: typeof requestCallback): void;

@@ -450,3 +450,3 @@ /**

export declare function startTransition(fn: () => unknown): Promise<void>;
export declare type Transition = [Accessor<boolean>, (fn: () => void) => Promise<void>];
export type Transition = [Accessor<boolean>, (fn: () => void) => Promise<void>];
/**

@@ -475,3 +475,3 @@ * ```typescript

export declare function serializeGraph(owner?: Owner | null): GraphRecord;
export declare type ContextProviderComponent<T> = FlowComponent<{
export type ContextProviderComponent<T> = FlowComponent<{
value: T;

@@ -514,5 +514,5 @@ }>;

export declare function useContext<T>(context: Context<T>): T;
export declare type ResolvedJSXElement = Exclude<JSX.Element, JSX.ArrayElement | JSX.FunctionElement>;
export declare type ResolvedChildren = ResolvedJSXElement | ResolvedJSXElement[];
export declare type ChildrenReturn = Accessor<ResolvedChildren> & {
export type ResolvedJSXElement = Exclude<JSX.Element, JSX.ArrayElement | JSX.FunctionElement>;
export type ResolvedChildren = ResolvedJSXElement | ResolvedJSXElement[];
export type ChildrenReturn = Accessor<ResolvedChildren> & {
toArray: () => ResolvedJSXElement[];

@@ -529,3 +529,3 @@ };

export declare function children(fn: Accessor<JSX.Element>): ChildrenReturn;
export declare type SuspenseContextType = {
export type SuspenseContextType = {
increment?: () => void;

@@ -537,3 +537,3 @@ decrement?: () => void;

};
declare type SuspenseContext = Context<SuspenseContextType> & {
type SuspenseContext = Context<SuspenseContextType> & {
active?(): boolean;

@@ -540,0 +540,0 @@ increment?(): void;

@@ -7,3 +7,3 @@ import type { JSX } from "../jsx.js";

*/
export declare type Component<P = {}> = (props: P) => JSX.Element;
export type Component<P = {}> = (props: P) => JSX.Element;
/**

@@ -14,3 +14,3 @@ * Extend props to forbid the `children` prop.

*/
export declare type VoidProps<P = {}> = P & {
export type VoidProps<P = {}> = P & {
children?: never;

@@ -23,3 +23,3 @@ };

*/
export declare type VoidComponent<P = {}> = Component<VoidProps<P>>;
export type VoidComponent<P = {}> = Component<VoidProps<P>>;
/**

@@ -30,3 +30,3 @@ * Extend props to allow an optional `children` prop with the usual

*/
export declare type ParentProps<P = {}> = P & {
export type ParentProps<P = {}> = P & {
children?: JSX.Element;

@@ -39,3 +39,3 @@ };

*/
export declare type ParentComponent<P = {}> = Component<ParentProps<P>>;
export type ParentComponent<P = {}> = Component<ParentProps<P>>;
/**

@@ -47,3 +47,3 @@ * Extend props to require a `children` prop with the specified type.

*/
export declare type FlowProps<P = {}, C = JSX.Element> = P & {
export type FlowProps<P = {}, C = JSX.Element> = P & {
children: C;

@@ -57,6 +57,6 @@ };

*/
export declare type FlowComponent<P = {}, C = JSX.Element> = Component<FlowProps<P, C>>;
export type FlowComponent<P = {}, C = JSX.Element> = Component<FlowProps<P, C>>;
/** @deprecated: use `ParentProps` instead */
export declare type PropsWithChildren<P = {}> = ParentProps<P>;
export declare type ValidComponent = keyof JSX.IntrinsicElements | Component<any> | (string & {});
export type PropsWithChildren<P = {}> = ParentProps<P>;
export type ValidComponent = keyof JSX.IntrinsicElements | Component<any> | (string & {});
/**

@@ -69,3 +69,3 @@ * Takes the props of the passed component and returns its type

*/
export declare type ComponentProps<T extends ValidComponent> = T extends Component<infer P> ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : Record<string, unknown>;
export type ComponentProps<T extends ValidComponent> = T extends Component<infer P> ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : Record<string, unknown>;
/**

@@ -76,6 +76,6 @@ * Type of `props.ref`, for use in `Component` or `props` typing.

*/
export declare type Ref<T> = T | ((val: T) => void);
export type Ref<T> = T | ((val: T) => void);
export declare function createComponent<T>(Comp: Component<T>, props: T): JSX.Element;
declare type DistributeOverride<T, F> = T extends undefined ? F : T;
declare type Override<T, U> = T extends any ? U extends any ? {
type DistributeOverride<T, F> = T extends undefined ? F : T;
type Override<T, U> = T extends any ? U extends any ? {
[K in keyof T]: K extends keyof U ? DistributeOverride<U[K], T[K]> : T[K];

@@ -85,3 +85,3 @@ } & {

} : T & U : T & U;
declare type OverrideSpread<T, U> = T extends any ? {
type OverrideSpread<T, U> = T extends any ? {
[K in keyof ({

@@ -95,12 +95,12 @@ [K in keyof T]: any;

} : T & U;
declare type Simplify<T> = T extends any ? {
type Simplify<T> = T extends any ? {
[K in keyof T]: T[K];
} : T;
declare type _MergeProps<T extends unknown[], Curr = {}> = T extends [
type _MergeProps<T extends unknown[], Curr = {}> = T extends [
infer Next | (() => infer Next),
...infer Rest
] ? _MergeProps<Rest, Override<Curr, Next>> : T extends [...infer Rest, infer Next | (() => infer Next)] ? Override<_MergeProps<Rest, Curr>, Next> : T extends [] ? Curr : T extends (infer I | (() => infer I))[] ? OverrideSpread<Curr, I> : Curr;
export declare type MergeProps<T extends unknown[]> = Simplify<_MergeProps<T>>;
export type MergeProps<T extends unknown[]> = Simplify<_MergeProps<T>>;
export declare function mergeProps<T extends unknown[]>(...sources: T): MergeProps<T>;
export declare type SplitProps<T, K extends (readonly (keyof T)[])[]> = [
export type SplitProps<T, K extends (readonly (keyof T)[])[]> = [
...{

@@ -107,0 +107,0 @@ [P in keyof K]: P extends `${number}` ? Pick<T, Extract<K[P], readonly (keyof T)[]>[number]> : never;

@@ -73,3 +73,3 @@ import { Accessor } from "../reactive/signal.js";

}): Accessor<JSX.Element>;
export declare type MatchProps<T> = {
export type MatchProps<T> = {
when: T | undefined | null | false;

@@ -76,0 +76,0 @@ keyed?: boolean;

@@ -1,6 +0,6 @@

export declare type HydrationContext = {
export type HydrationContext = {
id: string;
count: number;
};
declare type SharedConfig = {
type SharedConfig = {
context?: HydrationContext;

@@ -7,0 +7,0 @@ resources?: {

@@ -6,5 +6,5 @@ export declare const equalFn: <T>(a: T, b: T) => boolean;

export declare const DEV: {};
export declare type Accessor<T> = () => T;
export declare type Setter<T> = undefined extends T ? <U extends T>(value?: (U extends Function ? never : U) | ((prev?: T) => U)) => U : <U extends T>(value: (U extends Function ? never : U) | ((prev: T) => U)) => U;
export declare type Signal<T> = [get: Accessor<T>, set: Setter<T>];
export type Accessor<T> = () => T;
export type Setter<T> = undefined extends T ? <U extends T>(value?: (U extends Function ? never : U) | ((prev?: T) => U)) => U : <U extends T>(value: (U extends Function ? never : U) | ((prev: T) => U)) => U;
export type Signal<T> = [get: Accessor<T>, set: Setter<T>];
export declare const BRANCH: unique symbol;

@@ -17,3 +17,3 @@ export declare function castError(err: any): string | Error;

}
export declare function createRoot<T>(fn: (dispose: () => void) => T, detachedOwner?: Owner): T;
export declare function createRoot<T>(fn: (dispose: () => void) => T, detachedOwner?: typeof Owner): T;
export declare function createSignal<T>(value: T, options?: {

@@ -53,7 +53,7 @@ equals?: false | ((prev: T, next: T) => boolean);

export declare function getOwner(): Owner | null;
declare type ChildrenReturn = Accessor<any> & {
type ChildrenReturn = Accessor<any> & {
toArray: () => any[];
};
export declare function children(fn: () => any): ChildrenReturn;
export declare function runWithOwner<T>(o: Owner, fn: () => T): T | undefined;
export declare function runWithOwner<T>(o: typeof Owner, fn: () => T): T | undefined;
export declare function lookup(owner: Owner | null, key: symbol | string): any;

@@ -73,3 +73,3 @@ export interface Task {

}): () => U[];
export declare type ObservableObserver<T> = ((v: T) => void) | {
export type ObservableObserver<T> = ((v: T) => void) | {
next: (v: T) => void;

@@ -76,0 +76,0 @@ error?: (v: any) => void;

import { Setter, Signal } from "./reactive.js";
import type { JSX } from "../jsx.js";
export declare type Component<P = {}> = (props: P) => JSX.Element;
export declare type VoidProps<P = {}> = P & {
export type Component<P = {}> = (props: P) => JSX.Element;
export type VoidProps<P = {}> = P & {
children?: never;
};
export declare type VoidComponent<P = {}> = Component<VoidProps<P>>;
export declare type ParentProps<P = {}> = P & {
export type VoidComponent<P = {}> = Component<VoidProps<P>>;
export type ParentProps<P = {}> = P & {
children?: JSX.Element;
};
export declare type ParentComponent<P = {}> = Component<ParentProps<P>>;
export declare type FlowProps<P = {}, C = JSX.Element> = P & {
export type ParentComponent<P = {}> = Component<ParentProps<P>>;
export type FlowProps<P = {}, C = JSX.Element> = P & {
children: C;
};
export declare type FlowComponent<P = {}, C = JSX.Element> = Component<FlowProps<P, C>>;
export declare type Ref<T> = T | ((val: T) => void);
export declare type ValidComponent = keyof JSX.IntrinsicElements | Component<any> | (string & {});
export declare type ComponentProps<T extends ValidComponent> = T extends Component<infer P> ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : Record<string, unknown>;
declare type SharedConfig = {
export type FlowComponent<P = {}, C = JSX.Element> = Component<FlowProps<P, C>>;
export type Ref<T> = T | ((val: T) => void);
export type ValidComponent = keyof JSX.IntrinsicElements | Component<any> | (string & {});
export type ComponentProps<T extends ValidComponent> = T extends Component<infer P> ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : Record<string, unknown>;
type SharedConfig = {
context?: HydrationContext;

@@ -60,3 +60,3 @@ };

}): string;
declare type MatchProps<T> = {
type MatchProps<T> = {
when: T | false;

@@ -81,3 +81,3 @@ keyed?: boolean;

}
declare type SuspenseContextType = {
type SuspenseContextType = {
resources: Map<string, {

@@ -89,14 +89,14 @@ loading: boolean;

};
export declare type ResourceActions<T> = {
export type ResourceActions<T> = {
mutate: Setter<T>;
refetch: (info?: unknown) => void;
};
export declare type ResourceReturn<T> = [Resource<T>, ResourceActions<T>];
export declare type ResourceSource<S> = S | false | null | undefined | (() => S | false | null | undefined);
export declare type ResourceFetcher<S, T> = (k: S, info: ResourceFetcherInfo<T>) => T | Promise<T>;
export declare type ResourceFetcherInfo<T> = {
export type ResourceReturn<T> = [Resource<T>, ResourceActions<T>];
export type ResourceSource<S> = S | false | null | undefined | (() => S | false | null | undefined);
export type ResourceFetcher<S, T> = (k: S, info: ResourceFetcherInfo<T>) => T | Promise<T>;
export type ResourceFetcherInfo<T> = {
value: T | undefined;
refetching?: unknown;
};
export declare type ResourceOptions<T> = undefined extends T ? {
export type ResourceOptions<T> = undefined extends T ? {
initialValue?: T;

@@ -131,3 +131,3 @@ name?: string;

export declare function useTransition(): [() => boolean, (fn: () => any) => void];
declare type HydrationContext = {
type HydrationContext = {
id: string;

@@ -134,0 +134,0 @@ count: number;

@@ -263,2 +263,3 @@ import { sharedConfig, splitProps } from 'solid-js';

const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
const REPLACE_SCRIPT = `function $df(e,t,n,o,d){if(n=document.getElementById(e),o=document.getElementById("pl-"+e)){for(;o&&8!==o.nodeType&&o.nodeValue!=="pl-"+e;)d=o.nextSibling,o.remove(),o=d;o.replaceWith(n.content)}n.remove(),_$HY.set(e,t),_$HY.fe(e)}`;

@@ -525,2 +526,3 @@ function renderToString(code, options = {}) {

let result = `<${tag}${needsId ? ssrHydrationKey() : ""} `;
const skipChildren = VOID_ELEMENTS.test(tag);
if (props == null) props = {};else if (typeof props === "function") props = props();

@@ -532,3 +534,3 @@ const keys = Object.keys(props);

if (ChildProperties.has(prop)) {
if (children === undefined) children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
if (children === undefined && !skipChildren) children = prop === "innerHTML" ? props[prop] : escape(props[prop]);
continue;

@@ -553,2 +555,7 @@ }

}
if (skipChildren) {
return {
t: result + '/>'
};
}
return {

@@ -555,0 +562,0 @@ t: result + `>${resolveSSRNode(children)}</${tag}>`

@@ -24,3 +24,3 @@ import { hydrate as hydrateCore } from "./client.js";

}): Text;
export declare type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
[K in keyof P]: P[K];

@@ -27,0 +27,0 @@ } & {

@@ -45,3 +45,3 @@ export declare function renderToString<T>(fn: () => T, options?: {

export declare function ssrSpread(props: any, isSVG: boolean, skipChildren: boolean): void;
export declare type LegacyResults = {
export type LegacyResults = {
startWriting: () => void;

@@ -48,0 +48,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc