| /** | ||
| * Renderer-owned object value returned from Solid component trees. | ||
| * | ||
| * The concrete rendered value belongs to the active renderer or JSX factory | ||
| * (`@solidjs/web`, `@solidjs/h`, custom renderers, etc.), so core does not | ||
| * model DOM nodes or any other platform object here. | ||
| */ | ||
| export type RenderedElement = object & { | ||
| readonly call?: never; | ||
| readonly apply?: never; | ||
| readonly bind?: never; | ||
| }; | ||
| export type Element = RenderedElement | ArrayElement | (string & {}) | number | boolean | null | undefined; | ||
| export interface ArrayElement extends Array<Element> { | ||
| } |
| /** | ||
| * Renderer-owned object value returned from Solid component trees. | ||
| * | ||
| * The concrete rendered value belongs to the active renderer or JSX factory | ||
| * (`@solidjs/web`, `@solidjs/h`, custom renderers, etc.), so core does not | ||
| * model DOM nodes or any other platform object here. | ||
| */ | ||
| export type RenderedElement = object & { | ||
| readonly call?: never; | ||
| readonly apply?: never; | ||
| readonly bind?: never; | ||
| }; | ||
| export type Element = RenderedElement | ArrayElement | (string & {}) | number | boolean | null | undefined; | ||
| export interface ArrayElement extends Array<Element> { | ||
| } |
+181
-103
@@ -13,15 +13,42 @@ # Solid 2.0 — Cheatsheet | ||
| import { | ||
| createSignal, createMemo, createEffect, createRoot, | ||
| For, Show, Switch, Match, Loading, Errored, Repeat, Reveal, | ||
| createStore, createProjection, snapshot, reconcile, | ||
| merge, omit, | ||
| action, createOptimistic, createOptimisticStore, | ||
| isPending, latest, refresh, | ||
| untrack, flush, onSettled, | ||
| createContext, useContext, children, lazy, createUniqueId, | ||
| createSignal, | ||
| createMemo, | ||
| createEffect, | ||
| createRoot, | ||
| For, | ||
| Show, | ||
| Switch, | ||
| Match, | ||
| Loading, | ||
| Errored, | ||
| Repeat, | ||
| Reveal, | ||
| createStore, | ||
| createProjection, | ||
| snapshot, | ||
| reconcile, | ||
| merge, | ||
| omit, | ||
| action, | ||
| createOptimistic, | ||
| createOptimisticStore, | ||
| isPending, | ||
| latest, | ||
| refresh, | ||
| untrack, | ||
| flush, | ||
| onSettled, | ||
| createContext, | ||
| useContext, | ||
| children, | ||
| lazy, | ||
| createUniqueId | ||
| } from "solid-js"; | ||
| import { render, hydrate, Portal, Dynamic, dynamic } from "@solidjs/web"; | ||
| import { render, hydrate, Portal, dynamic, Dynamic } from "@solidjs/web"; | ||
| ``` | ||
| Web projects should configure TypeScript with `"jsxImportSource": "@solidjs/web"`. | ||
| `solid-js` no longer provides `solid-js/jsx-runtime`; renderer packages own JSX types. | ||
| Old subpaths are gone: | ||
@@ -37,4 +64,4 @@ `solid-js/web` → `@solidjs/web`. `solid-js/store` → `solid-js`. `solid-js/h` → `@solidjs/h`. `solid-js/html` → `@solidjs/html`. `solid-js/universal` → `@solidjs/universal`. | ||
| const [count, setCount] = createSignal(0); | ||
| count(); // read (call it!) | ||
| setCount(1); // queues; read returns last committed until flush | ||
| count(); // read (call it!) | ||
| setCount(1); // queues; read returns last committed until flush | ||
| setCount(c => c + 1); // updater form | ||
@@ -50,15 +77,15 @@ | ||
| // Options | ||
| createSignal(0, { ownedWrite: true }); // allow writes from inside owned scope | ||
| createSignal(0, { unobserved: () => cleanup() });// fires when no subscribers | ||
| createMemo(fn, { lazy: true }); // defer first compute until read; autodispose when unobserved | ||
| createSignal(0, { ownedWrite: true }); // allow writes from inside owned scope | ||
| createSignal(0, { unobserved: () => cleanup() }); // fires when no subscribers | ||
| createMemo(fn, { lazy: true }); // defer first compute until read; autodispose when unobserved | ||
| createMemo(fn, { equals: (a, b) => a.id === b.id }); | ||
| ``` | ||
| **Reads update only after flush.** `setX(v); x()` returns the *previous* value until the next microtask or `flush()`. | ||
| **Reads update only after flush.** `setX(v); x()` returns the _previous_ value until the next microtask or `flush()`. | ||
| ```ts | ||
| setCount(1); | ||
| count(); // still 0 | ||
| count(); // still 0 | ||
| flush(); | ||
| count(); // 1 | ||
| count(); // 1 | ||
| ``` | ||
@@ -73,6 +100,9 @@ | ||
| createEffect( | ||
| () => count(), // compute (tracks) | ||
| (value, prev) => { // apply (untracked) | ||
| () => count(), // compute (tracks) | ||
| (value, prev) => { | ||
| // apply (untracked) | ||
| el.title = value; | ||
| return () => { /* cleanup */ }; // optional cleanup | ||
| return () => { | ||
| /* cleanup */ | ||
| }; // optional cleanup | ||
| } | ||
@@ -82,13 +112,14 @@ ); | ||
| // With error handling | ||
| createEffect(() => fetchData(id()), { | ||
| effect: data => render(data), | ||
| error: (err, cleanup) => console.error(err) | ||
| }); | ||
| // Run on next change only (skip initial) | ||
| createEffect( | ||
| () => fetchData(id()), | ||
| { | ||
| effect: data => render(data), | ||
| error: (err, cleanup) => console.error(err) | ||
| } | ||
| () => count(), | ||
| v => log(v), | ||
| { defer: true } | ||
| ); | ||
| // Run on next change only (skip initial) | ||
| createEffect(() => count(), v => log(v), { defer: true }); | ||
| // Schedule once after the current activity settles — the canonical | ||
@@ -110,6 +141,5 @@ // "do this once and clean it up on dispose" primitive (replaces 1.x | ||
| ```ts | ||
| untrack(() => count()); // read without subscribing | ||
| flush(); // drain queued updates synchronously | ||
| isEqual(a, b); // default equality | ||
| createRoot(dispose => { /* ... */ }); // owned by parent unless detached | ||
| untrack(() => count()); // read without subscribing | ||
| flush(); // drain queued updates synchronously | ||
| isEqual(a, b); // default equality | ||
| ``` | ||
@@ -137,10 +167,14 @@ | ||
| // Reconcile new data into a sub-tree (preserve identity) | ||
| setStore(s => { reconcile(serverTodos, "id")(s.todos); }); | ||
| setStore(s => { | ||
| reconcile(serverTodos, "id")(s.todos); | ||
| }); | ||
| // Plain (non-reactive) snapshot | ||
| JSON.stringify(snapshot(store)); | ||
| // Derived stores (mirror signal/memo split) | ||
| const items = createProjection(async () => api.list(), [], { key: "id" }); // readonly | ||
| const [cache, setCache] = createStore(draft => { draft.x = compute(); }, { x: 0 }); // writable | ||
| const [cache, setCache] = createStore( | ||
| draft => { | ||
| draft.x = compute(); | ||
| }, | ||
| { x: 0 } | ||
| ); // writable | ||
| ``` | ||
@@ -180,3 +214,3 @@ | ||
| const merged = merge(defaults, props, overrides); // replaces mergeProps | ||
| const rest = omit(props, "class", "style"); // replaces splitProps | ||
| const rest = omit(props, "class", "style"); // replaces splitProps | ||
| ``` | ||
@@ -212,5 +246,7 @@ | ||
| const addTodo = action(function* (todo) { | ||
| setOptimisticTodos(s => { s.push(todo); }); // optimistic write | ||
| yield api.add(todo); // async work | ||
| refresh(todos); // re-derive | ||
| setOptimisticTodos(s => { | ||
| s.push(todo); | ||
| }); // optimistic write | ||
| yield api.add(todo); // async work | ||
| refresh(todos); // re-derive | ||
| }); | ||
@@ -270,4 +306,7 @@ | ||
| // Coordinate sibling Loadings (replaces <SuspenseList>) | ||
| <Reveal order="sequential" /* | "together" | "natural" */ collapsed> | ||
| // Coordinate sibling Loadings (replaces <SuspenseList>). | ||
| // Default order is "sequential" — siblings reveal in registration order | ||
| // as each resolves. `collapsed` (sequential only) suppresses tail-sibling | ||
| // fallbacks past the frontier. Other orders: "together" | "natural". | ||
| <Reveal collapsed> | ||
| <Loading fallback={<S/>}><A/></Loading> | ||
@@ -277,10 +316,13 @@ <Loading fallback={<S/>}><B/></Loading> | ||
| // Dynamic component | ||
| import { Dynamic, dynamic } from "@solidjs/web"; | ||
| // Dynamic component — factory form (canonical). Stable Component identity; | ||
| // composes with lazy(), routing, polymorphic patterns. | ||
| import { dynamic } from "@solidjs/web"; | ||
| <Dynamic component={isEditing() ? Editor : Viewer} value={value()} /> | ||
| // Or factory form (stable Component reference) | ||
| const Active = dynamic(() => isEditing() ? Editor : Viewer); | ||
| return <Active value={value()} />; | ||
| // JSX-wrapper convenience form. Use when the source is inline and you don't | ||
| // need to capture the component identity. | ||
| import { Dynamic } from "@solidjs/web"; | ||
| <Dynamic component={isEditing() ? Editor : Viewer} value={value()} /> | ||
| ``` | ||
@@ -297,3 +339,3 @@ | ||
| want truly app-wide state, don't use Context — a module-scope signal/store | ||
| *is* a global.** That's why the default-less form requires a Provider. | ||
| _is_ a global.** That's why the default-less form requires a Provider. | ||
@@ -307,3 +349,5 @@ ```tsx | ||
| return ( | ||
| <TodosContext value={createTodos()}> {/* the context IS the provider */} | ||
| <TodosContext value={createTodos()}> | ||
| {" "} | ||
| {/* the context IS the provider */} | ||
| <TodoList /> | ||
@@ -348,6 +392,6 @@ </TodosContext> | ||
| ```ts | ||
| Component<P> // no implicit children | ||
| VoidComponent<P> // forbids children | ||
| ParentComponent<P> // optional JSX.Element children | ||
| FlowComponent<P, C> // requires children of type C | ||
| type Basic = Component<P>; // no implicit children | ||
| type Empty = VoidComponent<P>; // forbids children | ||
| type WithChildren = ParentComponent<P>; // optional renderer-neutral Element children | ||
| type Flow = FlowComponent<P, C>; // requires children of type C | ||
| ``` | ||
@@ -388,5 +432,10 @@ | ||
| let el; | ||
| createEffect(source, value => { if (el) el.title = value; }); | ||
| createEffect(source, value => { | ||
| if (el) el.title = value; | ||
| }); | ||
| // Apply phase (unowned): DOM writes only. | ||
| return nextEl => { el = nextEl; el.title = source(); }; | ||
| return nextEl => { | ||
| el = nextEl; | ||
| el.title = source(); | ||
| }; | ||
| } | ||
@@ -418,8 +467,11 @@ ``` | ||
| ```jsx | ||
| <li class={["todo", { completed: props.todo.completed, errored: !!err() }]} /> // ✅ | ||
| <li class={["todo", { completed: props.todo.completed, errored: !!err() }]} />; // ✅ | ||
| const cls = ["todo", // ❌ | ||
| const cls = [ | ||
| "todo", // ❌ | ||
| props.todo.completed && "completed", | ||
| err() && "errored", | ||
| ].filter(Boolean).join(" "); | ||
| err() && "errored" | ||
| ] | ||
| .filter(Boolean) | ||
| .join(" "); | ||
| return <li class={cls} />; | ||
@@ -433,7 +485,3 @@ ``` | ||
| ```ts | ||
| import { | ||
| renderToString, renderToStringAsync, renderToStream, | ||
| ssr, ssrElement, ssrClassList, ssrStyle, ssrAttribute, escape, | ||
| isServer | ||
| } from "@solidjs/web"; | ||
| import { renderToString, renderToStringAsync, renderToStream, isServer, isDev } from "@solidjs/web"; | ||
| ``` | ||
@@ -471,7 +519,20 @@ | ||
| // Default store tracking is property-level (preferred). | ||
| createEffect(() => deep(store), snap => save(snap)); | ||
| createEffect( | ||
| () => deep(store), | ||
| snap => save(snap) | ||
| ); | ||
| // Plain (non-reactive) deep copy of a store. For serialization (JSON.stringify, | ||
| // localStorage, sending over the wire) and tests that need a plain-object | ||
| // assertion target. Inside reactive scopes, prefer reading individual values. | ||
| JSON.stringify(snapshot(store)); | ||
| // Render-phase synchronous effect — for DOM bindings that must run during render | ||
| // (the runtime's own attribute/property bindings). For app code, use createEffect. | ||
| createRenderEffect(() => props.title, v => { el.title = v; }); | ||
| createRenderEffect( | ||
| () => props.title, | ||
| v => { | ||
| el.title = v; | ||
| } | ||
| ); | ||
@@ -486,4 +547,15 @@ // Single-callback effect that may re-run in async situations. | ||
| // Manually create an owned reactive scope. App code uses render(); reach for | ||
| // createRoot in tests, library setup, and other non-render entry points where | ||
| // you need an owner so reactive primitives can dispose properly. | ||
| createRoot(dispose => { | ||
| const [count, setCount] = createSignal(0); | ||
| // ... | ||
| dispose(); | ||
| }); | ||
| // Detach a root from its parent (module singletons, external integrations only). | ||
| runWithOwner(null, () => { /* ... */ }); | ||
| runWithOwner(null, () => { | ||
| /* ... */ | ||
| }); | ||
@@ -493,3 +565,5 @@ // Get the current owner. Mostly used to capture and restore an owner across an | ||
| const owner = getOwner(); | ||
| runWithOwner(owner, () => { /* ... */ }); | ||
| runWithOwner(owner, () => { | ||
| /* ... */ | ||
| }); | ||
@@ -516,42 +590,47 @@ // Wait for a reactive expression to settle (imperative code / tests). | ||
| ### Imports moved | ||
| - `solid-js/web` → `@solidjs/web` | ||
| - `solid-js/store` → `solid-js` (store APIs moved into core) | ||
| - `solid-js/h` / `solid-js/html` / `solid-js/universal` → `@solidjs/h` / `@solidjs/html` / `@solidjs/universal` | ||
| - `jsxImportSource: "solid-js"` → `"@solidjs/web"` for web JSX (`@solidjs/h` for hyperscript JSX) | ||
| ### Renames | ||
| | 1.x | 2.0 | | ||
| |---|---| | ||
| | `Suspense` | `Loading` | | ||
| | `SuspenseList` | `Reveal` | | ||
| | `ErrorBoundary` | `Errored` | | ||
| | `mergeProps` | `merge` | | ||
| | `splitProps` | `omit` | | ||
| | `unwrap` | `snapshot` | | ||
| | `onMount` | `onSettled` | | ||
| | `createSelector` | `createProjection` (or `createStore(fn)`) | | ||
| | `equalFn` | `isEqual` | | ||
| | `getListener` | `getObserver` | | ||
| | `Context.Provider` | `<Context value={...}>` (context value *is* the provider) | | ||
| | `classList={{...}}` | `class={{...}}` (object/array forms) | | ||
| | 1.x | 2.0 | | ||
| | ------------------- | --------------------------------------------------------- | | ||
| | `Suspense` | `Loading` | | ||
| | `SuspenseList` | `Reveal` | | ||
| | `ErrorBoundary` | `Errored` | | ||
| | `mergeProps` | `merge` | | ||
| | `splitProps` | `omit` | | ||
| | `unwrap` | `snapshot` | | ||
| | `onMount` | `onSettled` | | ||
| | `createSelector` | `createProjection` (or `createStore(fn)`) | | ||
| | `equalFn` | `isEqual` | | ||
| | `getListener` | `getObserver` | | ||
| | `Context.Provider` | `<Context value={...}>` (context value _is_ the provider) | | ||
| | `classList={{...}}` | `class={{...}}` (object/array forms) | | ||
| ### Removed (with replacements) | ||
| | Removed | Use instead | | ||
| |---|---| | ||
| | `batch` | Default microtask batching; `flush()` to apply now | | ||
| | `createComputed` | `createMemo` / split `createEffect` / function-form `createSignal` | | ||
| | `createResource` | Async computations + `<Loading>` (`createMemo(() => fetchX(id()))`) | | ||
| | `startTransition`, `useTransition` | Built-in transitions; `isPending` / `<Loading>` / optimistic APIs | | ||
| | `on(...)` helper | Split effects (compute phase = explicit deps) | | ||
| | `onError` / `catchError` | `<Errored>` or effect `error` option | | ||
| | `produce` | Default — store setters are draft-first | | ||
| | `createMutable` / `modifyMutable` | `createStore` with draft setters | | ||
| | `from` / `observable` | Async iterables in computations / `createEffect` to push out | | ||
| | `Index` | `<For keyed={false}>` | | ||
| | `indexArray` | `mapArray` (handles non-keyed too) | | ||
| | `use:foo={x}` directives | `ref={foo(x)}` (or array `ref={[a, b(x)]}`) | | ||
| | `attr:` / `bool:` namespaces | Standard attribute behavior | | ||
| | `oncapture:` | `addEventListener(..., { capture: true })` | | ||
| | `resetErrorBoundaries` | Boundaries heal automatically | | ||
| | Removed | Use instead | | ||
| | ---------------------------------- | ------------------------------------------------------------------- | | ||
| | `batch` | Default microtask batching; `flush()` to apply now | | ||
| | `createComputed` | `createMemo` / split `createEffect` / function-form `createSignal` | | ||
| | `createResource` | Async computations + `<Loading>` (`createMemo(() => fetchX(id()))`) | | ||
| | `startTransition`, `useTransition` | Built-in transitions; `isPending` / `<Loading>` / optimistic APIs | | ||
| | `on(...)` helper | Split effects (compute phase = explicit deps) | | ||
| | `onError` / `catchError` | `<Errored>` or effect `error` option | | ||
| | `produce` | Default — store setters are draft-first | | ||
| | `createMutable` / `modifyMutable` | `createStore` with draft setters | | ||
| | `from` / `observable` | Async iterables in computations / `createEffect` to push out | | ||
| | `Index` | `<For keyed={false}>` | | ||
| | `indexArray` | `mapArray` (handles non-keyed too) | | ||
| | `use:foo={x}` directives | `ref={foo(x)}` (or array `ref={[a, b(x)]}`) | | ||
| | `attr:` / `bool:` namespaces | Standard attribute behavior | | ||
| | `oncapture:` | `addEventListener(..., { capture: true })` | | ||
| | `resetErrorBoundaries` | Boundaries heal automatically | | ||
| ### Behavior changes | ||
| - **`createEffect` takes two arguments now**: `(compute, apply)`. The single-arg form is gone — using it is an error. | ||
@@ -565,3 +644,3 @@ - **Setters don't update reads immediately** — values become visible after the microtask flushes (or via `flush()`). | ||
| - **`<Show>` / `<Match>` function children receive narrowed accessors** — also call them. | ||
| - **Stores: setters take a draft callback** — mutate the draft in place by default. Returning a new value is shallow (array index-replace, object top-level diff); reach for it for filter/remove. Keyed reconcile is a *projection-fn* feature, not a setter feature. | ||
| - **Stores: setters take a draft callback** — mutate the draft in place by default. Returning a new value is shallow (array index-replace, object top-level diff); reach for it for filter/remove. Keyed reconcile is a _projection-fn_ feature, not a setter feature. | ||
| - **`undefined` is a real value in `merge`** — it overrides rather than "skip this key". | ||
@@ -583,3 +662,2 @@ - **Async lives in computations** — return a Promise/AsyncIterable from `createMemo`/`createStore(fn)`/`createProjection`. Reads suspend; wrap in `<Loading>`. | ||
| - [`MIGRATION.md`](https://github.com/solidjs/solid/blob/main/documentation/solid-2.0/MIGRATION.md) — full beta-tester migration guide. | ||
| - [Solid 2.0 RFCs](https://github.com/solidjs/solid/tree/main/documentation/solid-2.0) — eight deep-dive design docs, one per subsystem. | ||
| - [Solid 2.0 RFCs](https://github.com/solidjs/solid/tree/main/documentation/solid-2.0) — deep-dive design docs by subsystem. |
+5
-27
| { | ||
| "name": "solid-js", | ||
| "description": "Reactive JavaScript library for building user interfaces. Compiles JSX to real DOM with fine-grained signal-based updates — no virtual DOM.", | ||
| "version": "2.0.0-beta.9", | ||
| "version": "2.0.0-beta.10", | ||
| "author": "Ryan Carniato", | ||
@@ -23,3 +23,2 @@ "license": "MIT", | ||
| "types-cjs", | ||
| "jsx-runtime.d.ts", | ||
| "package.json", | ||
@@ -100,22 +99,2 @@ "CHEATSHEET.md" | ||
| "./types/*": "./types/*", | ||
| "./jsx-runtime": { | ||
| "import": { | ||
| "types": "./types/jsx.d.ts", | ||
| "default": "./dist/solid.js" | ||
| }, | ||
| "require": { | ||
| "types": "./types-cjs/jsx.d.cts", | ||
| "default": "./dist/solid.cjs" | ||
| } | ||
| }, | ||
| "./jsx-dev-runtime": { | ||
| "import": { | ||
| "types": "./types/jsx.d.ts", | ||
| "default": "./dist/solid.js" | ||
| }, | ||
| "require": { | ||
| "types": "./types-cjs/jsx.d.cts", | ||
| "default": "./dist/solid.cjs" | ||
| } | ||
| }, | ||
| "./package.json": "./package.json" | ||
@@ -133,3 +112,3 @@ }, | ||
| "dependencies": { | ||
| "@solidjs/signals": "^2.0.0-beta.9", | ||
| "@solidjs/signals": "^2.0.0-beta.10", | ||
| "csstype": "^3.1.0", | ||
@@ -143,11 +122,10 @@ "seroval": "~1.5.0", | ||
| "build:js": "rollup -c", | ||
| "types": "npm-run-all -nl types:clean types:copy types:src types:cjs", | ||
| "types": "npm-run-all -nl types:clean types:src types:cjs", | ||
| "types:clean": "rimraf types/ types-cjs/", | ||
| "types:copy": "ncp ../../node_modules/dom-expressions/src/jsx.d.ts ./src/jsx.d.ts && ncp ../../node_modules/dom-expressions/src/jsx-properties.d.ts ./src/jsx-properties.d.ts", | ||
| "types:src": "tsc --project ./tsconfig.build.json && ncp ../../node_modules/dom-expressions/src/jsx.d.ts ./types/jsx.d.ts && ncp ../../node_modules/dom-expressions/src/jsx-properties.d.ts ./types/jsx-properties.d.ts", | ||
| "types:src": "tsc --project ./tsconfig.build.json", | ||
| "types:cjs": "node ../../scripts/sync-dual-types.mjs ./types ./types-cjs", | ||
| "test": "vitest run", | ||
| "coverage": "vitest run --coverage", | ||
| "test-types": "tsc --project tsconfig.test.json" | ||
| "test-types": "tsc --project tsconfig.test.json && tsc --project tsconfig.no-dom.json" | ||
| } | ||
| } |
+5
-7
@@ -30,7 +30,3 @@ <p> | ||
| return ( | ||
| <button onClick={() => setCount(c => c + 1)}> | ||
| {doubled()} | ||
| </button> | ||
| ); | ||
| return <button onClick={() => setCount(c => c + 1)}>{doubled()}</button>; | ||
| } | ||
@@ -58,3 +54,3 @@ | ||
| "jsx": "preserve", | ||
| "jsxImportSource": "solid-js" | ||
| "jsxImportSource": "@solidjs/web" | ||
| } | ||
@@ -64,2 +60,4 @@ } | ||
| For web projects, `jsxImportSource` points at `@solidjs/web`. In 2.0, `solid-js` owns renderer-neutral component types, while renderer packages such as `@solidjs/web` and `@solidjs/h` own their JSX namespaces and `jsx-runtime` type entries. | ||
| Existing 1.x starter templates target 1.x — 2.0 starter templates are tracked at [solidjs/templates](https://github.com/solidjs/templates). | ||
@@ -71,3 +69,3 @@ | ||
| The full migration guide is [`MIGRATION.md`](https://github.com/solidjs/solid/blob/next/documentation/solid-2.0/MIGRATION.md). Eight RFCs covering each subsystem (reactivity, control flow, stores, async, actions, DOM, dev-mode diagnostics) live alongside it under [`documentation/solid-2.0/`](https://github.com/solidjs/solid/tree/next/documentation/solid-2.0). | ||
| The full migration guide is [`MIGRATION.md`](https://github.com/solidjs/solid/blob/next/documentation/solid-2.0/MIGRATION.md). The 2.0 RFCs covering each subsystem live alongside it under [`documentation/solid-2.0/`](https://github.com/solidjs/solid/tree/next/documentation/solid-2.0). | ||
@@ -74,0 +72,0 @@ ## Learn more |
@@ -1,7 +0,7 @@ | ||
| import type { JSX } from "../jsx.cjs"; | ||
| import type { Element as SolidElement } from "../types.cjs"; | ||
| /** | ||
| * A general `Component` has no implicit `children` prop. If desired, you can | ||
| * specify one as in `Component<{name: String, children: JSX.Element}>`. | ||
| * A general `Component` has no implicit `children` prop. If desired, specify | ||
| * one explicitly, e.g. `Component<{ name: string; children: Element }>`. | ||
| */ | ||
| export type Component<P extends Record<string, any> = {}> = (props: P) => JSX.Element; | ||
| export type Component<P extends Record<string, any> = {}> = (props: P) => SolidElement; | ||
| /** | ||
@@ -22,12 +22,10 @@ * Extend props to forbid the `children` prop. | ||
| /** | ||
| * Extend props to allow an optional `children` prop with the usual | ||
| * type in JSX, `JSX.Element` (which allows elements, arrays, strings, etc.). | ||
| * Extend props to allow optional Solid children. | ||
| * Use this for components that you want to accept children. | ||
| */ | ||
| export type ParentProps<P extends Record<string, any> = {}> = P & { | ||
| children?: JSX.Element; | ||
| children?: SolidElement; | ||
| }; | ||
| /** | ||
| * `ParentComponent` allows an optional `children` prop with the usual | ||
| * type in JSX, `JSX.Element` (which allows elements, arrays, strings, etc.). | ||
| * `ParentComponent` allows an optional `children` prop. | ||
| * Use this for components that you want to accept children. | ||
@@ -40,5 +38,4 @@ */ | ||
| * typically a function that receives specific argument types. | ||
| * Note that all JSX <Elements> are of the type `JSX.Element`. | ||
| */ | ||
| export type FlowProps<P extends Record<string, any> = {}, C = JSX.Element> = P & { | ||
| export type FlowProps<P extends Record<string, any> = {}, C = SolidElement> = P & { | ||
| children: C; | ||
@@ -50,14 +47,12 @@ }; | ||
| * typically a function that receives specific argument types. | ||
| * Note that all JSX <Elements> are of the type `JSX.Element`. | ||
| */ | ||
| export type FlowComponent<P extends Record<string, any> = {}, C = JSX.Element> = Component<FlowProps<P, C>>; | ||
| export type ValidComponent = keyof JSX.IntrinsicElements | Component<any> | (string & {}); | ||
| export type FlowComponent<P extends Record<string, any> = {}, C = SolidElement> = Component<FlowProps<P, C>>; | ||
| export type ValidComponent = Component<any>; | ||
| /** | ||
| * Takes the props of the passed component and returns its type | ||
| * | ||
| * @example | ||
| * ComponentProps<typeof Portal> // { mount?: Node; useShadow?: boolean; children: JSX.Element } | ||
| * ComponentProps<'div'> // JSX.HTMLAttributes<HTMLDivElement> | ||
| * Intrinsic element prop extraction is renderer-specific and lives in renderer | ||
| * packages such as `@solidjs/web`. | ||
| */ | ||
| export 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 : never; | ||
| /** | ||
@@ -75,3 +70,3 @@ * Type of `props.ref`, for use in `Component` or `props` typing. | ||
| */ | ||
| export declare function createComponent<T extends Record<string, any>>(Comp: Component<T>, props: T): JSX.Element; | ||
| export declare function createComponent<T extends Record<string, any>>(Comp: Component<T>, props: T): SolidElement; | ||
| /** | ||
@@ -78,0 +73,0 @@ * Defines a code-split component. The returned component triggers its dynamic |
| import type { Accessor, EffectOptions } from "@solidjs/signals"; | ||
| import type { JSX } from "../jsx.cjs"; | ||
| import type { ArrayElement, Element as SolidElement } from "../types.cjs"; | ||
| import { FlowComponent } from "./component.cjs"; | ||
| export declare const IS_DEV: string | boolean; | ||
| /** | ||
| * Brand symbol marking dev-built components for `solid-devtools` / | ||
| * AI-readiness instrumentation. Internal cross-package wiring. | ||
| * | ||
| * @internal | ||
| */ | ||
| export declare const $DEVCOMP: unique symbol; | ||
@@ -111,6 +117,6 @@ export type NoInfer<T extends any> = [T][T extends any ? 0 : never]; | ||
| export declare function useContext<T>(context: Context<T>): T; | ||
| export type ResolvedJSXElement = Exclude<JSX.Element, JSX.ArrayElement>; | ||
| export type ResolvedChildren = ResolvedJSXElement | ResolvedJSXElement[]; | ||
| export type ResolvedElement = Exclude<SolidElement, ArrayElement>; | ||
| export type ResolvedChildren = ResolvedElement | ResolvedElement[]; | ||
| export type ChildrenReturn = Accessor<ResolvedChildren> & { | ||
| toArray: () => ResolvedJSXElement[]; | ||
| toArray: () => ResolvedElement[]; | ||
| }; | ||
@@ -127,3 +133,3 @@ /** | ||
| * ```tsx | ||
| * function List(props: { children: JSX.Element }) { | ||
| * function List(props: { children: Element }) { | ||
| * const items = children(() => props.children); | ||
@@ -136,3 +142,3 @@ * return <ul>{items.toArray().map(item => <li>{item}</li>)}</ul>; | ||
| */ | ||
| export declare function children(fn: Accessor<JSX.Element>): ChildrenReturn; | ||
| export declare function children(fn: Accessor<SolidElement>): ChildrenReturn; | ||
| export declare function devComponent<P, V>(Comp: (props: P) => V, props: P): V; |
| import type { Accessor, RevealOrder } from "@solidjs/signals"; | ||
| export type { RevealOrder }; | ||
| import type { JSX } from "../jsx.cjs"; | ||
| import type { Element as SolidElement } from "../types.cjs"; | ||
| type NonZeroParams<T extends (...args: any[]) => any> = Parameters<T>["length"] extends 0 ? never : T; | ||
| type ConditionalRenderCallback<T> = (item: Accessor<NonNullable<T>>) => JSX.Element; | ||
| type ConditionalRenderChildren<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = JSX.Element | NonZeroParams<F>; | ||
| type ConditionalRenderCallback<T> = (item: Accessor<NonNullable<T>>) => SolidElement; | ||
| type ConditionalRenderChildren<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = SolidElement | NonZeroParams<F>; | ||
| /** | ||
| * Creates a list of elements from a list | ||
| * Creates a list of elements from a list. | ||
| * | ||
| * it receives a map function as its child that receives list element and index accessors and returns a JSX-Element; if the list is empty, an optional fallback is returned: | ||
| * ```typescript | ||
| * Receives a map function as its child that takes list element and index | ||
| * accessors and returns a JSX element; if the list is empty, an optional | ||
| * `fallback` is rendered instead. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * <For each={items} fallback={<div>No items</div>}> | ||
@@ -19,13 +23,16 @@ * {(item, index) => <div data-index={index()}>{item()}</div>} | ||
| */ | ||
| export declare function For<T extends readonly any[], U extends JSX.Element>(props: { | ||
| export declare function For<T extends readonly any[], U extends SolidElement>(props: { | ||
| each: T | undefined | null | false; | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| keyed?: boolean | ((item: T[number]) => any); | ||
| children: (item: Accessor<T[number]>, index: Accessor<number>) => U; | ||
| }): JSX.Element; | ||
| }): SolidElement; | ||
| /** | ||
| * Creates a list elements from a count | ||
| * Creates a list of elements from a count. | ||
| * | ||
| * it receives a map function as its child that receives the index and returns a JSX-Element; if the list is empty, an optional fallback is returned: | ||
| * ```typescript | ||
| * Receives a map function as its child that takes the index and returns a JSX | ||
| * element; if the count is zero, an optional `fallback` is rendered instead. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * <Repeat count={items.length} fallback={<div>No items</div>}> | ||
@@ -38,8 +45,8 @@ * {(index) => <div data-index={index}>{items[index]}</div>} | ||
| */ | ||
| export declare function Repeat<T extends JSX.Element>(props: { | ||
| export declare function Repeat<T extends SolidElement>(props: { | ||
| count: number; | ||
| from?: number | undefined; | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| children: ((index: number) => T) | T; | ||
| }): JSX.Element; | ||
| }): SolidElement; | ||
| /** | ||
@@ -66,8 +73,12 @@ * Conditionally renders its children when `when` is truthy, otherwise renders | ||
| keyed?: boolean; | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| children: ConditionalRenderChildren<T, F>; | ||
| }): JSX.Element; | ||
| }): SolidElement; | ||
| /** | ||
| * Switches between content based on mutually exclusive conditions | ||
| * ```typescript | ||
| * Switches between content based on mutually exclusive conditions. Renders | ||
| * the first `<Match>` whose `when` is truthy; falls back to `fallback` when | ||
| * none match. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * <Switch fallback={<FourOhFour />}> | ||
@@ -82,8 +93,9 @@ * <Match when={state.route === 'home'}> | ||
| * ``` | ||
| * | ||
| * @description https://docs.solidjs.com/reference/components/switch-and-match | ||
| */ | ||
| export declare function Switch(props: { | ||
| fallback?: JSX.Element; | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| fallback?: SolidElement; | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| export type MatchProps<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = { | ||
@@ -115,15 +127,19 @@ when: T | undefined | null | false; | ||
| */ | ||
| export declare function Match<T, F extends ConditionalRenderCallback<T>>(props: MatchProps<T, F>): JSX.Element; | ||
| export declare function Match<T, F extends ConditionalRenderCallback<T>>(props: MatchProps<T, F>): SolidElement; | ||
| /** | ||
| * Catches uncaught errors inside components and renders a fallback content | ||
| * Catches uncaught errors inside its subtree and renders fallback content | ||
| * instead. The `fallback` prop can be a JSX element, or a callback that | ||
| * receives the error and a `reset()` function for retry affordances. | ||
| * | ||
| * Also supports a callback form that passes the error and a reset function: | ||
| * ```typescript | ||
| * <Errored fallback={ | ||
| * (err, reset) => <div onClick={reset}>Error: {err.toString()}</div> | ||
| * }> | ||
| * Errors thrown from the fallback itself can be caught by a parent | ||
| * `<Errored>`. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * <Errored fallback={(err, reset) => ( | ||
| * <div onClick={reset}>Error: {err.toString()}</div> | ||
| * )}> | ||
| * <MyComp /> | ||
| * </Errored> | ||
| * ``` | ||
| * Errors thrown from the fallback can be caught by a parent Errored | ||
| * | ||
@@ -133,5 +149,5 @@ * @description https://docs.solidjs.com/reference/components/error-boundary | ||
| export declare function Errored(props: { | ||
| fallback: JSX.Element | ((err: any, reset: () => void) => JSX.Element); | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| fallback: SolidElement | ((err: any, reset: () => void) => SolidElement); | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| /** | ||
@@ -175,10 +191,10 @@ * Renders a `fallback` while pending async reads inside the subtree settle. | ||
| export declare function Loading(props: { | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| on?: any; | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| export type RevealProps = { | ||
| order?: RevealOrder; | ||
| collapsed?: boolean; | ||
| children: JSX.Element; | ||
| children: SolidElement; | ||
| }; | ||
@@ -209,4 +225,7 @@ /** | ||
| * | ||
| * ```typescript | ||
| * <Reveal order="sequential"> | ||
| * @example | ||
| * ```tsx | ||
| * // Default order is "sequential"; the inner group composes as one slot | ||
| * // and runs its own "natural" order locally once the outer releases it. | ||
| * <Reveal> | ||
| * <Loading fallback={<Skeleton />}><ProfileHeader /></Loading> | ||
@@ -223,2 +242,2 @@ * <Reveal order="natural"> | ||
| */ | ||
| export declare function Reveal(props: RevealProps): JSX.Element; | ||
| export declare function Reveal(props: RevealProps): SolidElement; |
| import { createErrorBoundary as coreErrorBoundary, createRenderEffect as coreRenderEffect, createEffect as coreEffect, type Accessor, type ComputeFunction, type MemoOptions, type NoInfer, type ProjectionOptions, type Refreshable, type Signal, type SignalOptions, type Store, type StoreSetter, type Context } from "@solidjs/signals"; | ||
| import { JSX } from "../jsx.cjs"; | ||
| import type { Element as SolidElement } from "../types.cjs"; | ||
| type HydrationSsrFields = { | ||
@@ -71,2 +71,8 @@ /** | ||
| export type HydrationContext = {}; | ||
| /** | ||
| * Internal context flag set by `<NoHydration>` to disable hydration for its | ||
| * subtree. Cross-package wiring; not part of the user-facing API. | ||
| * | ||
| * @internal | ||
| */ | ||
| export declare const NoHydrateContext: Context<boolean>; | ||
@@ -83,4 +89,4 @@ type SharedConfig = { | ||
| loadModuleAssets?: (mapping: Record<string, string>) => Promise<void> | undefined; | ||
| registry?: Map<string, Element>; | ||
| completed?: WeakSet<Element> | null; | ||
| registry?: Map<string, object>; | ||
| completed?: WeakSet<object> | null; | ||
| events?: any[] | null; | ||
@@ -91,2 +97,9 @@ verifyHydration?: () => void; | ||
| }; | ||
| /** | ||
| * Shared hydration coordination object — populated by `enableHydration()` and | ||
| * consumed by the hydration-aware primitive wrappers and SSR streaming | ||
| * runtime. Cross-package wiring; not part of the user-facing API. | ||
| * | ||
| * @internal | ||
| */ | ||
| export declare const sharedConfig: SharedConfig; | ||
@@ -99,2 +112,9 @@ /** | ||
| export declare function onHydrationEnd(callback: () => void): void; | ||
| /** | ||
| * Switches the primitive wrappers above (`createMemo`, `createSignal`, | ||
| * `createStore`, etc.) into hydration-aware mode. Called by `hydrate()` | ||
| * before mounting; cross-package wiring not part of the user-facing API. | ||
| * | ||
| * @internal | ||
| */ | ||
| export declare function enableHydration(): void; | ||
@@ -199,2 +219,20 @@ /** | ||
| * renders the same content the server emitted. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * // Custom boundary built on the primitive — adds telemetry around the | ||
| * // canonical `<Errored>` shape. | ||
| * function TracedErrored(props: { | ||
| * fallback: (e: unknown) => JSX.Element; | ||
| * children: JSX.Element; | ||
| * }): JSX.Element { | ||
| * return createErrorBoundary( | ||
| * () => props.children, | ||
| * (err, reset) => { | ||
| * reportError(err); | ||
| * return props.fallback(err); | ||
| * } | ||
| * ) as unknown as JSX.Element; | ||
| * } | ||
| * ``` | ||
| */ | ||
@@ -408,2 +446,15 @@ export declare const createErrorBoundary: typeof coreErrorBoundary; | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * // Custom directive: bind an element's textContent to a reactive source | ||
| * // synchronously during render. App code should use `createEffect` for | ||
| * // post-render side effects. | ||
| * function bindText(el: HTMLElement, source: () => string) { | ||
| * createRenderEffect( | ||
| * () => source(), | ||
| * value => { el.textContent = value; } | ||
| * ); | ||
| * } | ||
| * ``` | ||
| * | ||
| * @description https://docs.solidjs.com/reference/secondary-primitives/create-render-effect | ||
@@ -470,2 +521,14 @@ */ | ||
| * `<Loading>` directly; this is exposed for renderers and library authors. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * // Custom boundary component built on the primitive. App code uses | ||
| * // `<Loading fallback={…}>` directly. | ||
| * function MyLoading(props: { fallback: JSX.Element; children: JSX.Element }): JSX.Element { | ||
| * return createLoadingBoundary( | ||
| * () => props.children, | ||
| * () => props.fallback | ||
| * ) as unknown as JSX.Element; | ||
| * } | ||
| * ``` | ||
| */ | ||
@@ -479,13 +542,37 @@ export declare function createLoadingBoundary(fn: () => any, fallback: () => any, options?: { | ||
| * After hydration, renders children fresh. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * // Mount a client-only widget that the server didn't render. The subtree | ||
| * // is left empty during hydration, then renders fresh once hydration ends. | ||
| * <NoHydration> | ||
| * <ClientOnlyMap /> | ||
| * </NoHydration> | ||
| * ``` | ||
| */ | ||
| export declare function NoHydration(props: { | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| /** | ||
| * Re-enables hydration within a NoHydration zone (passthrough on client). | ||
| * Re-enables hydration within a `<NoHydration>` zone (passthrough on the | ||
| * client). Use it to opt a subtree back into hydration when the surrounding | ||
| * region was opted out. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * // Inside a `<NoHydration>` region, re-enable hydration for one inner | ||
| * // subtree that does need to match a server-rendered fragment. | ||
| * <NoHydration> | ||
| * <ClientOnlyShell> | ||
| * <Hydration> | ||
| * <ServerHydratedWidget /> | ||
| * </Hydration> | ||
| * </ClientOnlyShell> | ||
| * </NoHydration> | ||
| * ``` | ||
| */ | ||
| export declare function Hydration(props: { | ||
| id?: string; | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| export {}; |
| export { $PROXY, $REFRESH, $TRACK, action, createOwner, createReaction, createRevealOrder, createRoot, createTrackedEffect, deep, flatten, flush, getNextChildId, getObserver, getOwner, isDisposed, isEqual, isRefreshing, isPending, isWrappable, mapArray, merge, omit, onCleanup, onSettled, latest, reconcile, refresh, repeat, resolve, NotReadyError, runWithOwner, enableExternalSource, enforceLoadingBoundary, snapshot, storePath, untrack } from "@solidjs/signals"; | ||
| export type { Accessor, ComputeFunction, EffectFunction, EffectOptions, ExternalSource, ExternalSourceConfig, ExternalSourceFactory, Merge, NoInfer, NotWrappable, Omit, Owner, Refreshable, Signal, SignalOptions, Setter, Store, SolidStore, StoreNode, StoreSetter, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter } from "@solidjs/signals"; | ||
| export { $DEVCOMP, children, createContext, useContext } from "./client/core.cjs"; | ||
| export type { ChildrenReturn, Context, ContextProviderComponent, ResolvedChildren, ResolvedJSXElement } from "./client/core.cjs"; | ||
| export type { ChildrenReturn, Context, ContextProviderComponent, ResolvedChildren, ResolvedElement } from "./client/core.cjs"; | ||
| export * from "./client/component.cjs"; | ||
| export * from "./client/flow.cjs"; | ||
| export type { ArrayElement, Element } from "./types.cjs"; | ||
| export { sharedConfig, enableHydration, createErrorBoundary, createLoadingBoundary, createMemo, createSignal, createStore, createProjection, createOptimistic, createOptimisticStore, createRenderEffect, createEffect, NoHydration, Hydration, NoHydrateContext } from "./client/hydration.cjs"; | ||
| /** @internal */ | ||
| export declare function ssrHandleError(): void; | ||
| /** @internal */ | ||
| export declare function ssrRunInScope(): void; | ||
| import type { JSX } from "./jsx.cjs"; | ||
| type JSXElement = JSX.Element; | ||
| export type { JSXElement, JSX }; | ||
| import { type Dev } from "@solidjs/signals"; | ||
@@ -14,0 +14,0 @@ export declare const DEV: Dev | undefined; |
@@ -1,8 +0,8 @@ | ||
| import type { JSX } from "../jsx.cjs"; | ||
| import type { Element as SolidElement } from "../types.cjs"; | ||
| export declare function enableHydration(): void; | ||
| /** | ||
| * A general `Component` has no implicit `children` prop. If desired, you can | ||
| * specify one as in `Component<{name: String, children: JSX.Element}>`. | ||
| * A general `Component` has no implicit `children` prop. If desired, specify | ||
| * one explicitly, e.g. `Component<{ name: string; children: Element }>`. | ||
| */ | ||
| export type Component<P extends Record<string, any> = {}> = (props: P) => JSX.Element; | ||
| export type Component<P extends Record<string, any> = {}> = (props: P) => SolidElement; | ||
| /** | ||
@@ -19,6 +19,6 @@ * Extend props to forbid the `children` prop. | ||
| /** | ||
| * Extend props to allow an optional `children` prop with the usual type in JSX. | ||
| * Extend props to allow optional Solid children. | ||
| */ | ||
| export type ParentProps<P extends Record<string, any> = {}> = P & { | ||
| children?: JSX.Element; | ||
| children?: SolidElement; | ||
| }; | ||
@@ -32,3 +32,3 @@ /** | ||
| */ | ||
| export type FlowProps<P extends Record<string, any> = {}, C = JSX.Element> = P & { | ||
| export type FlowProps<P extends Record<string, any> = {}, C = SolidElement> = P & { | ||
| children: C; | ||
@@ -39,8 +39,8 @@ }; | ||
| */ | ||
| export type FlowComponent<P extends Record<string, any> = {}, C = JSX.Element> = Component<FlowProps<P, C>>; | ||
| export type ValidComponent = keyof JSX.IntrinsicElements | Component<any> | (string & {}); | ||
| export type FlowComponent<P extends Record<string, any> = {}, C = SolidElement> = Component<FlowProps<P, C>>; | ||
| export type ValidComponent = Component<any>; | ||
| /** | ||
| * Takes the props of the passed component and returns its type | ||
| */ | ||
| export 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 : never; | ||
| /** | ||
@@ -53,3 +53,3 @@ * Type of `props.ref`, for use in `Component` or `props` typing. | ||
| */ | ||
| export declare function createComponent<T extends Record<string, any>>(Comp: Component<T>, props: T): JSX.Element; | ||
| export declare function createComponent<T extends Record<string, any>>(Comp: Component<T>, props: T): SolidElement; | ||
| /** | ||
@@ -56,0 +56,0 @@ * Lazy load a function component asynchronously. |
| import type { Accessor, EffectOptions } from "./signals.cjs"; | ||
| import type { JSX } from "../jsx.cjs"; | ||
| import type { ArrayElement, Element as SolidElement } from "../types.cjs"; | ||
| import type { FlowComponent } from "./component.cjs"; | ||
@@ -32,6 +32,6 @@ export declare const $DEVCOMP: unique symbol; | ||
| export declare function useContext<T>(context: Context<T>): T; | ||
| export type ResolvedJSXElement = Exclude<JSX.Element, JSX.ArrayElement>; | ||
| export type ResolvedChildren = ResolvedJSXElement | ResolvedJSXElement[]; | ||
| export type ResolvedElement = Exclude<SolidElement, ArrayElement>; | ||
| export type ResolvedChildren = ResolvedElement | ResolvedElement[]; | ||
| export type ChildrenReturn = Accessor<ResolvedChildren> & { | ||
| toArray: () => ResolvedJSXElement[]; | ||
| toArray: () => ResolvedElement[]; | ||
| }; | ||
@@ -43,3 +43,3 @@ /** | ||
| */ | ||
| export declare function children(fn: Accessor<JSX.Element>): ChildrenReturn; | ||
| export declare function children(fn: Accessor<SolidElement>): ChildrenReturn; | ||
| /** | ||
@@ -46,0 +46,0 @@ * Pass-through for SSR dynamic expressions. |
| import type { Accessor, RevealOrder } from "./signals.cjs"; | ||
| import type { JSX } from "../jsx.cjs"; | ||
| import type { Element as SolidElement } from "../types.cjs"; | ||
| export type { RevealOrder }; | ||
| type NonZeroParams<T extends (...args: any[]) => any> = Parameters<T>["length"] extends 0 ? never : T; | ||
| type ConditionalRenderCallback<T> = (item: Accessor<NonNullable<T>>) => JSX.Element; | ||
| type ConditionalRenderChildren<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = JSX.Element | NonZeroParams<F>; | ||
| type ConditionalRenderCallback<T> = (item: Accessor<NonNullable<T>>) => SolidElement; | ||
| type ConditionalRenderChildren<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = SolidElement | NonZeroParams<F>; | ||
| /** | ||
@@ -12,8 +12,8 @@ * Creates a list of elements from a list | ||
| */ | ||
| export declare function For<T extends readonly any[], U extends JSX.Element>(props: { | ||
| export declare function For<T extends readonly any[], U extends SolidElement>(props: { | ||
| each: T | undefined | null | false; | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| keyed?: boolean | ((item: T[number]) => any); | ||
| children: (item: Accessor<T[number]>, index: Accessor<number>) => U; | ||
| }): JSX.Element; | ||
| }): SolidElement; | ||
| /** | ||
@@ -24,8 +24,8 @@ * Creates a list elements from a count | ||
| */ | ||
| export declare function Repeat<T extends JSX.Element>(props: { | ||
| export declare function Repeat<T extends SolidElement>(props: { | ||
| count: number; | ||
| from?: number | undefined; | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| children: ((index: number) => T) | T; | ||
| }): JSX.Element; | ||
| }): SolidElement; | ||
| /** | ||
@@ -38,5 +38,5 @@ * Conditionally render its children or an optional fallback component | ||
| keyed?: boolean; | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| children: ConditionalRenderChildren<T, F>; | ||
| }): JSX.Element; | ||
| }): SolidElement; | ||
| /** | ||
@@ -47,5 +47,5 @@ * Switches between content based on mutually exclusive conditions | ||
| export declare function Switch(props: { | ||
| fallback?: JSX.Element; | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| fallback?: SolidElement; | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| export type MatchProps<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = { | ||
@@ -60,3 +60,3 @@ when: T | undefined | null | false; | ||
| */ | ||
| export declare function Match<T, F extends ConditionalRenderCallback<T>>(props: MatchProps<T, F>): JSX.Element; | ||
| export declare function Match<T, F extends ConditionalRenderCallback<T>>(props: MatchProps<T, F>): SolidElement; | ||
| /** | ||
@@ -67,5 +67,5 @@ * Catches uncaught errors inside components and renders a fallback content | ||
| export declare function Errored(props: { | ||
| fallback: JSX.Element | ((err: any, reset: () => void) => JSX.Element); | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| fallback: SolidElement | ((err: any, reset: () => void) => SolidElement); | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| /** | ||
@@ -76,10 +76,10 @@ * Tracks all resources inside a component and renders a fallback until they are all resolved | ||
| export declare function Loading(props: { | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| on?: any; | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| export type RevealProps = { | ||
| order?: RevealOrder; | ||
| collapsed?: boolean; | ||
| children: JSX.Element; | ||
| children: SolidElement; | ||
| }; | ||
@@ -122,2 +122,2 @@ /** | ||
| */ | ||
| export declare function Reveal(props: RevealProps): JSX.Element; | ||
| export declare function Reveal(props: RevealProps): SolidElement; |
| import type { Context } from "./signals.cjs"; | ||
| import type { JSX } from "../jsx.cjs"; | ||
| import type { Element as SolidElement } from "../types.cjs"; | ||
| export { sharedConfig, NoHydrateContext } from "./shared.cjs"; | ||
@@ -53,4 +53,4 @@ export type { HydrationContext, SSRTemplateObject } from "./shared.cjs"; | ||
| export declare function NoHydration(props: { | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| /** | ||
@@ -63,3 +63,3 @@ * Re-enables hydration within a `NoHydration` zone, establishing a new ID namespace. | ||
| id?: string; | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| children: SolidElement; | ||
| }): SolidElement; |
| export { $PROXY, $REFRESH, $TRACK, action, createEffect, createMemo, createOptimistic, createOptimisticStore, createErrorBoundary, createOwner, createProjection, createReaction, createRenderEffect, createRevealOrder, createRoot, createSignal, createStore, createTrackedEffect, deep, flatten, flush, getNextChildId, getObserver, getOwner, isDisposed, isEqual, isRefreshing, isPending, isWrappable, mapArray, merge, omit, onCleanup, onSettled, latest, reconcile, refresh, repeat, resolve, NotReadyError, runWithOwner, snapshot, storePath, createDeepProxy, enableExternalSource, enforceLoadingBoundary, untrack } from "./signals.cjs"; | ||
| export type { Accessor, ComputeFunction, EffectFunction, EffectOptions, ExternalSource, ExternalSourceConfig, ExternalSourceFactory, Merge, NoInfer, NotWrappable, Omit, Owner, Refreshable, Signal, SignalOptions, Setter, Store, SolidStore, StoreNode, StoreSetter, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter, PatchOp } from "./signals.cjs"; | ||
| export { $DEVCOMP, children, createContext, useContext, ssrRunInScope } from "./core.cjs"; | ||
| export type { ChildrenReturn, Context, ContextProviderComponent, ResolvedChildren, ResolvedJSXElement } from "./core.cjs"; | ||
| export type { ChildrenReturn, Context, ContextProviderComponent, ResolvedChildren, ResolvedElement } from "./core.cjs"; | ||
| export * from "./component.cjs"; | ||
| export * from "./flow.cjs"; | ||
| export type { ArrayElement, Element } from "../types.cjs"; | ||
| export { sharedConfig, createLoadingBoundary, ssrHandleError, NoHydration, Hydration, NoHydrateContext } from "./hydration.cjs"; | ||
| export type { HydrationContext } from "./hydration.cjs"; | ||
| import type { JSX } from "../jsx.cjs"; | ||
| type JSXElement = JSX.Element; | ||
| export type { JSXElement, JSX }; | ||
| export declare const DEV: undefined; |
@@ -1,7 +0,7 @@ | ||
| import type { JSX } from "../jsx.js"; | ||
| import type { Element as SolidElement } from "../types.js"; | ||
| /** | ||
| * A general `Component` has no implicit `children` prop. If desired, you can | ||
| * specify one as in `Component<{name: String, children: JSX.Element}>`. | ||
| * A general `Component` has no implicit `children` prop. If desired, specify | ||
| * one explicitly, e.g. `Component<{ name: string; children: Element }>`. | ||
| */ | ||
| export type Component<P extends Record<string, any> = {}> = (props: P) => JSX.Element; | ||
| export type Component<P extends Record<string, any> = {}> = (props: P) => SolidElement; | ||
| /** | ||
@@ -22,12 +22,10 @@ * Extend props to forbid the `children` prop. | ||
| /** | ||
| * Extend props to allow an optional `children` prop with the usual | ||
| * type in JSX, `JSX.Element` (which allows elements, arrays, strings, etc.). | ||
| * Extend props to allow optional Solid children. | ||
| * Use this for components that you want to accept children. | ||
| */ | ||
| export type ParentProps<P extends Record<string, any> = {}> = P & { | ||
| children?: JSX.Element; | ||
| children?: SolidElement; | ||
| }; | ||
| /** | ||
| * `ParentComponent` allows an optional `children` prop with the usual | ||
| * type in JSX, `JSX.Element` (which allows elements, arrays, strings, etc.). | ||
| * `ParentComponent` allows an optional `children` prop. | ||
| * Use this for components that you want to accept children. | ||
@@ -40,5 +38,4 @@ */ | ||
| * typically a function that receives specific argument types. | ||
| * Note that all JSX <Elements> are of the type `JSX.Element`. | ||
| */ | ||
| export type FlowProps<P extends Record<string, any> = {}, C = JSX.Element> = P & { | ||
| export type FlowProps<P extends Record<string, any> = {}, C = SolidElement> = P & { | ||
| children: C; | ||
@@ -50,14 +47,12 @@ }; | ||
| * typically a function that receives specific argument types. | ||
| * Note that all JSX <Elements> are of the type `JSX.Element`. | ||
| */ | ||
| export type FlowComponent<P extends Record<string, any> = {}, C = JSX.Element> = Component<FlowProps<P, C>>; | ||
| export type ValidComponent = keyof JSX.IntrinsicElements | Component<any> | (string & {}); | ||
| export type FlowComponent<P extends Record<string, any> = {}, C = SolidElement> = Component<FlowProps<P, C>>; | ||
| export type ValidComponent = Component<any>; | ||
| /** | ||
| * Takes the props of the passed component and returns its type | ||
| * | ||
| * @example | ||
| * ComponentProps<typeof Portal> // { mount?: Node; useShadow?: boolean; children: JSX.Element } | ||
| * ComponentProps<'div'> // JSX.HTMLAttributes<HTMLDivElement> | ||
| * Intrinsic element prop extraction is renderer-specific and lives in renderer | ||
| * packages such as `@solidjs/web`. | ||
| */ | ||
| export 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 : never; | ||
| /** | ||
@@ -75,3 +70,3 @@ * Type of `props.ref`, for use in `Component` or `props` typing. | ||
| */ | ||
| export declare function createComponent<T extends Record<string, any>>(Comp: Component<T>, props: T): JSX.Element; | ||
| export declare function createComponent<T extends Record<string, any>>(Comp: Component<T>, props: T): SolidElement; | ||
| /** | ||
@@ -78,0 +73,0 @@ * Defines a code-split component. The returned component triggers its dynamic |
| import type { Accessor, EffectOptions } from "@solidjs/signals"; | ||
| import type { JSX } from "../jsx.js"; | ||
| import type { ArrayElement, Element as SolidElement } from "../types.js"; | ||
| import { FlowComponent } from "./component.js"; | ||
| export declare const IS_DEV: string | boolean; | ||
| /** | ||
| * Brand symbol marking dev-built components for `solid-devtools` / | ||
| * AI-readiness instrumentation. Internal cross-package wiring. | ||
| * | ||
| * @internal | ||
| */ | ||
| export declare const $DEVCOMP: unique symbol; | ||
@@ -111,6 +117,6 @@ export type NoInfer<T extends any> = [T][T extends any ? 0 : never]; | ||
| export declare function useContext<T>(context: Context<T>): T; | ||
| export type ResolvedJSXElement = Exclude<JSX.Element, JSX.ArrayElement>; | ||
| export type ResolvedChildren = ResolvedJSXElement | ResolvedJSXElement[]; | ||
| export type ResolvedElement = Exclude<SolidElement, ArrayElement>; | ||
| export type ResolvedChildren = ResolvedElement | ResolvedElement[]; | ||
| export type ChildrenReturn = Accessor<ResolvedChildren> & { | ||
| toArray: () => ResolvedJSXElement[]; | ||
| toArray: () => ResolvedElement[]; | ||
| }; | ||
@@ -127,3 +133,3 @@ /** | ||
| * ```tsx | ||
| * function List(props: { children: JSX.Element }) { | ||
| * function List(props: { children: Element }) { | ||
| * const items = children(() => props.children); | ||
@@ -136,3 +142,3 @@ * return <ul>{items.toArray().map(item => <li>{item}</li>)}</ul>; | ||
| */ | ||
| export declare function children(fn: Accessor<JSX.Element>): ChildrenReturn; | ||
| export declare function children(fn: Accessor<SolidElement>): ChildrenReturn; | ||
| export declare function devComponent<P, V>(Comp: (props: P) => V, props: P): V; |
+59
-40
| import type { Accessor, RevealOrder } from "@solidjs/signals"; | ||
| export type { RevealOrder }; | ||
| import type { JSX } from "../jsx.js"; | ||
| import type { Element as SolidElement } from "../types.js"; | ||
| type NonZeroParams<T extends (...args: any[]) => any> = Parameters<T>["length"] extends 0 ? never : T; | ||
| type ConditionalRenderCallback<T> = (item: Accessor<NonNullable<T>>) => JSX.Element; | ||
| type ConditionalRenderChildren<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = JSX.Element | NonZeroParams<F>; | ||
| type ConditionalRenderCallback<T> = (item: Accessor<NonNullable<T>>) => SolidElement; | ||
| type ConditionalRenderChildren<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = SolidElement | NonZeroParams<F>; | ||
| /** | ||
| * Creates a list of elements from a list | ||
| * Creates a list of elements from a list. | ||
| * | ||
| * it receives a map function as its child that receives list element and index accessors and returns a JSX-Element; if the list is empty, an optional fallback is returned: | ||
| * ```typescript | ||
| * Receives a map function as its child that takes list element and index | ||
| * accessors and returns a JSX element; if the list is empty, an optional | ||
| * `fallback` is rendered instead. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * <For each={items} fallback={<div>No items</div>}> | ||
@@ -19,13 +23,16 @@ * {(item, index) => <div data-index={index()}>{item()}</div>} | ||
| */ | ||
| export declare function For<T extends readonly any[], U extends JSX.Element>(props: { | ||
| export declare function For<T extends readonly any[], U extends SolidElement>(props: { | ||
| each: T | undefined | null | false; | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| keyed?: boolean | ((item: T[number]) => any); | ||
| children: (item: Accessor<T[number]>, index: Accessor<number>) => U; | ||
| }): JSX.Element; | ||
| }): SolidElement; | ||
| /** | ||
| * Creates a list elements from a count | ||
| * Creates a list of elements from a count. | ||
| * | ||
| * it receives a map function as its child that receives the index and returns a JSX-Element; if the list is empty, an optional fallback is returned: | ||
| * ```typescript | ||
| * Receives a map function as its child that takes the index and returns a JSX | ||
| * element; if the count is zero, an optional `fallback` is rendered instead. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * <Repeat count={items.length} fallback={<div>No items</div>}> | ||
@@ -38,8 +45,8 @@ * {(index) => <div data-index={index}>{items[index]}</div>} | ||
| */ | ||
| export declare function Repeat<T extends JSX.Element>(props: { | ||
| export declare function Repeat<T extends SolidElement>(props: { | ||
| count: number; | ||
| from?: number | undefined; | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| children: ((index: number) => T) | T; | ||
| }): JSX.Element; | ||
| }): SolidElement; | ||
| /** | ||
@@ -66,8 +73,12 @@ * Conditionally renders its children when `when` is truthy, otherwise renders | ||
| keyed?: boolean; | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| children: ConditionalRenderChildren<T, F>; | ||
| }): JSX.Element; | ||
| }): SolidElement; | ||
| /** | ||
| * Switches between content based on mutually exclusive conditions | ||
| * ```typescript | ||
| * Switches between content based on mutually exclusive conditions. Renders | ||
| * the first `<Match>` whose `when` is truthy; falls back to `fallback` when | ||
| * none match. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * <Switch fallback={<FourOhFour />}> | ||
@@ -82,8 +93,9 @@ * <Match when={state.route === 'home'}> | ||
| * ``` | ||
| * | ||
| * @description https://docs.solidjs.com/reference/components/switch-and-match | ||
| */ | ||
| export declare function Switch(props: { | ||
| fallback?: JSX.Element; | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| fallback?: SolidElement; | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| export type MatchProps<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = { | ||
@@ -115,15 +127,19 @@ when: T | undefined | null | false; | ||
| */ | ||
| export declare function Match<T, F extends ConditionalRenderCallback<T>>(props: MatchProps<T, F>): JSX.Element; | ||
| export declare function Match<T, F extends ConditionalRenderCallback<T>>(props: MatchProps<T, F>): SolidElement; | ||
| /** | ||
| * Catches uncaught errors inside components and renders a fallback content | ||
| * Catches uncaught errors inside its subtree and renders fallback content | ||
| * instead. The `fallback` prop can be a JSX element, or a callback that | ||
| * receives the error and a `reset()` function for retry affordances. | ||
| * | ||
| * Also supports a callback form that passes the error and a reset function: | ||
| * ```typescript | ||
| * <Errored fallback={ | ||
| * (err, reset) => <div onClick={reset}>Error: {err.toString()}</div> | ||
| * }> | ||
| * Errors thrown from the fallback itself can be caught by a parent | ||
| * `<Errored>`. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * <Errored fallback={(err, reset) => ( | ||
| * <div onClick={reset}>Error: {err.toString()}</div> | ||
| * )}> | ||
| * <MyComp /> | ||
| * </Errored> | ||
| * ``` | ||
| * Errors thrown from the fallback can be caught by a parent Errored | ||
| * | ||
@@ -133,5 +149,5 @@ * @description https://docs.solidjs.com/reference/components/error-boundary | ||
| export declare function Errored(props: { | ||
| fallback: JSX.Element | ((err: any, reset: () => void) => JSX.Element); | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| fallback: SolidElement | ((err: any, reset: () => void) => SolidElement); | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| /** | ||
@@ -175,10 +191,10 @@ * Renders a `fallback` while pending async reads inside the subtree settle. | ||
| export declare function Loading(props: { | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| on?: any; | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| export type RevealProps = { | ||
| order?: RevealOrder; | ||
| collapsed?: boolean; | ||
| children: JSX.Element; | ||
| children: SolidElement; | ||
| }; | ||
@@ -209,4 +225,7 @@ /** | ||
| * | ||
| * ```typescript | ||
| * <Reveal order="sequential"> | ||
| * @example | ||
| * ```tsx | ||
| * // Default order is "sequential"; the inner group composes as one slot | ||
| * // and runs its own "natural" order locally once the outer releases it. | ||
| * <Reveal> | ||
| * <Loading fallback={<Skeleton />}><ProfileHeader /></Loading> | ||
@@ -223,2 +242,2 @@ * <Reveal order="natural"> | ||
| */ | ||
| export declare function Reveal(props: RevealProps): JSX.Element; | ||
| export declare function Reveal(props: RevealProps): SolidElement; |
| import { createErrorBoundary as coreErrorBoundary, createRenderEffect as coreRenderEffect, createEffect as coreEffect, type Accessor, type ComputeFunction, type MemoOptions, type NoInfer, type ProjectionOptions, type Refreshable, type Signal, type SignalOptions, type Store, type StoreSetter, type Context } from "@solidjs/signals"; | ||
| import { JSX } from "../jsx.js"; | ||
| import type { Element as SolidElement } from "../types.js"; | ||
| type HydrationSsrFields = { | ||
@@ -71,2 +71,8 @@ /** | ||
| export type HydrationContext = {}; | ||
| /** | ||
| * Internal context flag set by `<NoHydration>` to disable hydration for its | ||
| * subtree. Cross-package wiring; not part of the user-facing API. | ||
| * | ||
| * @internal | ||
| */ | ||
| export declare const NoHydrateContext: Context<boolean>; | ||
@@ -83,4 +89,4 @@ type SharedConfig = { | ||
| loadModuleAssets?: (mapping: Record<string, string>) => Promise<void> | undefined; | ||
| registry?: Map<string, Element>; | ||
| completed?: WeakSet<Element> | null; | ||
| registry?: Map<string, object>; | ||
| completed?: WeakSet<object> | null; | ||
| events?: any[] | null; | ||
@@ -91,2 +97,9 @@ verifyHydration?: () => void; | ||
| }; | ||
| /** | ||
| * Shared hydration coordination object — populated by `enableHydration()` and | ||
| * consumed by the hydration-aware primitive wrappers and SSR streaming | ||
| * runtime. Cross-package wiring; not part of the user-facing API. | ||
| * | ||
| * @internal | ||
| */ | ||
| export declare const sharedConfig: SharedConfig; | ||
@@ -99,2 +112,9 @@ /** | ||
| export declare function onHydrationEnd(callback: () => void): void; | ||
| /** | ||
| * Switches the primitive wrappers above (`createMemo`, `createSignal`, | ||
| * `createStore`, etc.) into hydration-aware mode. Called by `hydrate()` | ||
| * before mounting; cross-package wiring not part of the user-facing API. | ||
| * | ||
| * @internal | ||
| */ | ||
| export declare function enableHydration(): void; | ||
@@ -199,2 +219,20 @@ /** | ||
| * renders the same content the server emitted. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * // Custom boundary built on the primitive — adds telemetry around the | ||
| * // canonical `<Errored>` shape. | ||
| * function TracedErrored(props: { | ||
| * fallback: (e: unknown) => JSX.Element; | ||
| * children: JSX.Element; | ||
| * }): JSX.Element { | ||
| * return createErrorBoundary( | ||
| * () => props.children, | ||
| * (err, reset) => { | ||
| * reportError(err); | ||
| * return props.fallback(err); | ||
| * } | ||
| * ) as unknown as JSX.Element; | ||
| * } | ||
| * ``` | ||
| */ | ||
@@ -408,2 +446,15 @@ export declare const createErrorBoundary: typeof coreErrorBoundary; | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * // Custom directive: bind an element's textContent to a reactive source | ||
| * // synchronously during render. App code should use `createEffect` for | ||
| * // post-render side effects. | ||
| * function bindText(el: HTMLElement, source: () => string) { | ||
| * createRenderEffect( | ||
| * () => source(), | ||
| * value => { el.textContent = value; } | ||
| * ); | ||
| * } | ||
| * ``` | ||
| * | ||
| * @description https://docs.solidjs.com/reference/secondary-primitives/create-render-effect | ||
@@ -470,2 +521,14 @@ */ | ||
| * `<Loading>` directly; this is exposed for renderers and library authors. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * // Custom boundary component built on the primitive. App code uses | ||
| * // `<Loading fallback={…}>` directly. | ||
| * function MyLoading(props: { fallback: JSX.Element; children: JSX.Element }): JSX.Element { | ||
| * return createLoadingBoundary( | ||
| * () => props.children, | ||
| * () => props.fallback | ||
| * ) as unknown as JSX.Element; | ||
| * } | ||
| * ``` | ||
| */ | ||
@@ -479,13 +542,37 @@ export declare function createLoadingBoundary(fn: () => any, fallback: () => any, options?: { | ||
| * After hydration, renders children fresh. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * // Mount a client-only widget that the server didn't render. The subtree | ||
| * // is left empty during hydration, then renders fresh once hydration ends. | ||
| * <NoHydration> | ||
| * <ClientOnlyMap /> | ||
| * </NoHydration> | ||
| * ``` | ||
| */ | ||
| export declare function NoHydration(props: { | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| /** | ||
| * Re-enables hydration within a NoHydration zone (passthrough on client). | ||
| * Re-enables hydration within a `<NoHydration>` zone (passthrough on the | ||
| * client). Use it to opt a subtree back into hydration when the surrounding | ||
| * region was opted out. | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * // Inside a `<NoHydration>` region, re-enable hydration for one inner | ||
| * // subtree that does need to match a server-rendered fragment. | ||
| * <NoHydration> | ||
| * <ClientOnlyShell> | ||
| * <Hydration> | ||
| * <ServerHydratedWidget /> | ||
| * </Hydration> | ||
| * </ClientOnlyShell> | ||
| * </NoHydration> | ||
| * ``` | ||
| */ | ||
| export declare function Hydration(props: { | ||
| id?: string; | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| export {}; |
+4
-4
| export { $PROXY, $REFRESH, $TRACK, action, createOwner, createReaction, createRevealOrder, createRoot, createTrackedEffect, deep, flatten, flush, getNextChildId, getObserver, getOwner, isDisposed, isEqual, isRefreshing, isPending, isWrappable, mapArray, merge, omit, onCleanup, onSettled, latest, reconcile, refresh, repeat, resolve, NotReadyError, runWithOwner, enableExternalSource, enforceLoadingBoundary, snapshot, storePath, untrack } from "@solidjs/signals"; | ||
| export type { Accessor, ComputeFunction, EffectFunction, EffectOptions, ExternalSource, ExternalSourceConfig, ExternalSourceFactory, Merge, NoInfer, NotWrappable, Omit, Owner, Refreshable, Signal, SignalOptions, Setter, Store, SolidStore, StoreNode, StoreSetter, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter } from "@solidjs/signals"; | ||
| export { $DEVCOMP, children, createContext, useContext } from "./client/core.js"; | ||
| export type { ChildrenReturn, Context, ContextProviderComponent, ResolvedChildren, ResolvedJSXElement } from "./client/core.js"; | ||
| export type { ChildrenReturn, Context, ContextProviderComponent, ResolvedChildren, ResolvedElement } from "./client/core.js"; | ||
| export * from "./client/component.js"; | ||
| export * from "./client/flow.js"; | ||
| export type { ArrayElement, Element } from "./types.js"; | ||
| export { sharedConfig, enableHydration, createErrorBoundary, createLoadingBoundary, createMemo, createSignal, createStore, createProjection, createOptimistic, createOptimisticStore, createRenderEffect, createEffect, NoHydration, Hydration, NoHydrateContext } from "./client/hydration.js"; | ||
| /** @internal */ | ||
| export declare function ssrHandleError(): void; | ||
| /** @internal */ | ||
| export declare function ssrRunInScope(): void; | ||
| import type { JSX } from "./jsx.js"; | ||
| type JSXElement = JSX.Element; | ||
| export type { JSXElement, JSX }; | ||
| import { type Dev } from "@solidjs/signals"; | ||
@@ -14,0 +14,0 @@ export declare const DEV: Dev | undefined; |
@@ -1,8 +0,8 @@ | ||
| import type { JSX } from "../jsx.js"; | ||
| import type { Element as SolidElement } from "../types.js"; | ||
| export declare function enableHydration(): void; | ||
| /** | ||
| * A general `Component` has no implicit `children` prop. If desired, you can | ||
| * specify one as in `Component<{name: String, children: JSX.Element}>`. | ||
| * A general `Component` has no implicit `children` prop. If desired, specify | ||
| * one explicitly, e.g. `Component<{ name: string; children: Element }>`. | ||
| */ | ||
| export type Component<P extends Record<string, any> = {}> = (props: P) => JSX.Element; | ||
| export type Component<P extends Record<string, any> = {}> = (props: P) => SolidElement; | ||
| /** | ||
@@ -19,6 +19,6 @@ * Extend props to forbid the `children` prop. | ||
| /** | ||
| * Extend props to allow an optional `children` prop with the usual type in JSX. | ||
| * Extend props to allow optional Solid children. | ||
| */ | ||
| export type ParentProps<P extends Record<string, any> = {}> = P & { | ||
| children?: JSX.Element; | ||
| children?: SolidElement; | ||
| }; | ||
@@ -32,3 +32,3 @@ /** | ||
| */ | ||
| export type FlowProps<P extends Record<string, any> = {}, C = JSX.Element> = P & { | ||
| export type FlowProps<P extends Record<string, any> = {}, C = SolidElement> = P & { | ||
| children: C; | ||
@@ -39,8 +39,8 @@ }; | ||
| */ | ||
| export type FlowComponent<P extends Record<string, any> = {}, C = JSX.Element> = Component<FlowProps<P, C>>; | ||
| export type ValidComponent = keyof JSX.IntrinsicElements | Component<any> | (string & {}); | ||
| export type FlowComponent<P extends Record<string, any> = {}, C = SolidElement> = Component<FlowProps<P, C>>; | ||
| export type ValidComponent = Component<any>; | ||
| /** | ||
| * Takes the props of the passed component and returns its type | ||
| */ | ||
| export 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 : never; | ||
| /** | ||
@@ -53,3 +53,3 @@ * Type of `props.ref`, for use in `Component` or `props` typing. | ||
| */ | ||
| export declare function createComponent<T extends Record<string, any>>(Comp: Component<T>, props: T): JSX.Element; | ||
| export declare function createComponent<T extends Record<string, any>>(Comp: Component<T>, props: T): SolidElement; | ||
| /** | ||
@@ -56,0 +56,0 @@ * Lazy load a function component asynchronously. |
| import type { Accessor, EffectOptions } from "./signals.js"; | ||
| import type { JSX } from "../jsx.js"; | ||
| import type { ArrayElement, Element as SolidElement } from "../types.js"; | ||
| import type { FlowComponent } from "./component.js"; | ||
@@ -32,6 +32,6 @@ export declare const $DEVCOMP: unique symbol; | ||
| export declare function useContext<T>(context: Context<T>): T; | ||
| export type ResolvedJSXElement = Exclude<JSX.Element, JSX.ArrayElement>; | ||
| export type ResolvedChildren = ResolvedJSXElement | ResolvedJSXElement[]; | ||
| export type ResolvedElement = Exclude<SolidElement, ArrayElement>; | ||
| export type ResolvedChildren = ResolvedElement | ResolvedElement[]; | ||
| export type ChildrenReturn = Accessor<ResolvedChildren> & { | ||
| toArray: () => ResolvedJSXElement[]; | ||
| toArray: () => ResolvedElement[]; | ||
| }; | ||
@@ -43,3 +43,3 @@ /** | ||
| */ | ||
| export declare function children(fn: Accessor<JSX.Element>): ChildrenReturn; | ||
| export declare function children(fn: Accessor<SolidElement>): ChildrenReturn; | ||
| /** | ||
@@ -46,0 +46,0 @@ * Pass-through for SSR dynamic expressions. |
+23
-23
| import type { Accessor, RevealOrder } from "./signals.js"; | ||
| import type { JSX } from "../jsx.js"; | ||
| import type { Element as SolidElement } from "../types.js"; | ||
| export type { RevealOrder }; | ||
| type NonZeroParams<T extends (...args: any[]) => any> = Parameters<T>["length"] extends 0 ? never : T; | ||
| type ConditionalRenderCallback<T> = (item: Accessor<NonNullable<T>>) => JSX.Element; | ||
| type ConditionalRenderChildren<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = JSX.Element | NonZeroParams<F>; | ||
| type ConditionalRenderCallback<T> = (item: Accessor<NonNullable<T>>) => SolidElement; | ||
| type ConditionalRenderChildren<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = SolidElement | NonZeroParams<F>; | ||
| /** | ||
@@ -12,8 +12,8 @@ * Creates a list of elements from a list | ||
| */ | ||
| export declare function For<T extends readonly any[], U extends JSX.Element>(props: { | ||
| export declare function For<T extends readonly any[], U extends SolidElement>(props: { | ||
| each: T | undefined | null | false; | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| keyed?: boolean | ((item: T[number]) => any); | ||
| children: (item: Accessor<T[number]>, index: Accessor<number>) => U; | ||
| }): JSX.Element; | ||
| }): SolidElement; | ||
| /** | ||
@@ -24,8 +24,8 @@ * Creates a list elements from a count | ||
| */ | ||
| export declare function Repeat<T extends JSX.Element>(props: { | ||
| export declare function Repeat<T extends SolidElement>(props: { | ||
| count: number; | ||
| from?: number | undefined; | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| children: ((index: number) => T) | T; | ||
| }): JSX.Element; | ||
| }): SolidElement; | ||
| /** | ||
@@ -38,5 +38,5 @@ * Conditionally render its children or an optional fallback component | ||
| keyed?: boolean; | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| children: ConditionalRenderChildren<T, F>; | ||
| }): JSX.Element; | ||
| }): SolidElement; | ||
| /** | ||
@@ -47,5 +47,5 @@ * Switches between content based on mutually exclusive conditions | ||
| export declare function Switch(props: { | ||
| fallback?: JSX.Element; | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| fallback?: SolidElement; | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| export type MatchProps<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = { | ||
@@ -60,3 +60,3 @@ when: T | undefined | null | false; | ||
| */ | ||
| export declare function Match<T, F extends ConditionalRenderCallback<T>>(props: MatchProps<T, F>): JSX.Element; | ||
| export declare function Match<T, F extends ConditionalRenderCallback<T>>(props: MatchProps<T, F>): SolidElement; | ||
| /** | ||
@@ -67,5 +67,5 @@ * Catches uncaught errors inside components and renders a fallback content | ||
| export declare function Errored(props: { | ||
| fallback: JSX.Element | ((err: any, reset: () => void) => JSX.Element); | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| fallback: SolidElement | ((err: any, reset: () => void) => SolidElement); | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| /** | ||
@@ -76,10 +76,10 @@ * Tracks all resources inside a component and renders a fallback until they are all resolved | ||
| export declare function Loading(props: { | ||
| fallback?: JSX.Element; | ||
| fallback?: SolidElement; | ||
| on?: any; | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| export type RevealProps = { | ||
| order?: RevealOrder; | ||
| collapsed?: boolean; | ||
| children: JSX.Element; | ||
| children: SolidElement; | ||
| }; | ||
@@ -122,2 +122,2 @@ /** | ||
| */ | ||
| export declare function Reveal(props: RevealProps): JSX.Element; | ||
| export declare function Reveal(props: RevealProps): SolidElement; |
| import type { Context } from "./signals.js"; | ||
| import type { JSX } from "../jsx.js"; | ||
| import type { Element as SolidElement } from "../types.js"; | ||
| export { sharedConfig, NoHydrateContext } from "./shared.js"; | ||
@@ -53,4 +53,4 @@ export type { HydrationContext, SSRTemplateObject } from "./shared.js"; | ||
| export declare function NoHydration(props: { | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| children: SolidElement; | ||
| }): SolidElement; | ||
| /** | ||
@@ -63,3 +63,3 @@ * Re-enables hydration within a `NoHydration` zone, establishing a new ID namespace. | ||
| id?: string; | ||
| children: JSX.Element; | ||
| }): JSX.Element; | ||
| children: SolidElement; | ||
| }): SolidElement; |
| export { $PROXY, $REFRESH, $TRACK, action, createEffect, createMemo, createOptimistic, createOptimisticStore, createErrorBoundary, createOwner, createProjection, createReaction, createRenderEffect, createRevealOrder, createRoot, createSignal, createStore, createTrackedEffect, deep, flatten, flush, getNextChildId, getObserver, getOwner, isDisposed, isEqual, isRefreshing, isPending, isWrappable, mapArray, merge, omit, onCleanup, onSettled, latest, reconcile, refresh, repeat, resolve, NotReadyError, runWithOwner, snapshot, storePath, createDeepProxy, enableExternalSource, enforceLoadingBoundary, untrack } from "./signals.js"; | ||
| export type { Accessor, ComputeFunction, EffectFunction, EffectOptions, ExternalSource, ExternalSourceConfig, ExternalSourceFactory, Merge, NoInfer, NotWrappable, Omit, Owner, Refreshable, Signal, SignalOptions, Setter, Store, SolidStore, StoreNode, StoreSetter, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter, PatchOp } from "./signals.js"; | ||
| export { $DEVCOMP, children, createContext, useContext, ssrRunInScope } from "./core.js"; | ||
| export type { ChildrenReturn, Context, ContextProviderComponent, ResolvedChildren, ResolvedJSXElement } from "./core.js"; | ||
| export type { ChildrenReturn, Context, ContextProviderComponent, ResolvedChildren, ResolvedElement } from "./core.js"; | ||
| export * from "./component.js"; | ||
| export * from "./flow.js"; | ||
| export type { ArrayElement, Element } from "../types.js"; | ||
| export { sharedConfig, createLoadingBoundary, ssrHandleError, NoHydration, Hydration, NoHydrateContext } from "./hydration.js"; | ||
| export type { HydrationContext } from "./hydration.js"; | ||
| import type { JSX } from "../jsx.js"; | ||
| type JSXElement = JSX.Element; | ||
| export type { JSXElement, JSX }; | ||
| export declare const DEV: undefined; |
| export * from "./types/jsx"; |
| /** | ||
| * Shared type-level helpers used to derive `prop:*` attribute typings from | ||
| * DOM element interfaces (e.g. `HTMLInputElement`, `HTMLButtonElement`). | ||
| * | ||
| * The wrapping of each value (`FunctionMaybe<T>` in `jsx-h.d.ts` vs. the | ||
| * raw value in `jsx.d.ts`) is applied by each consumer when composing its | ||
| * own `Properties<T>` mapped type. That way this file stays identical in | ||
| * both reactive and non-reactive contexts and only needs to exist once. | ||
| * | ||
| * originally from | ||
| * @url https://github.com/potahtml/pota | ||
| */ | ||
| /** Base-class properties shared by all elements — skipped from `prop:*`. */ | ||
| export type SkipPropsFrom = HTMLUnknownElement & HTMLElement & Element & Node; | ||
| /** | ||
| * Value types allowed on a `prop:*`. Primitives plus the writable | ||
| * non-primitive DOM-object props worth exposing: | ||
| * | ||
| * - `HTMLMediaElement.srcObject` | ||
| * - `HTMLButtonElement.popoverTargetElement` / `commandForElement` (and the same via | ||
| * `PopoverTargetAttributes` mixin on `HTMLInputElement`) | ||
| */ | ||
| export type PropValue = | ||
| | string | ||
| | number | ||
| | boolean | ||
| | null | ||
| | MediaStream | ||
| | MediaSource | ||
| | Blob | ||
| | File | ||
| | Element; | ||
| /** | ||
| * Ergonomics widening for emitted `prop:*` value types: | ||
| * | ||
| * - general `string` → `string | number` (HTML coerces numbers) | ||
| * - string literal unions (`'on' | 'off'`) stay exact, so users still get autocomplete / | ||
| * narrowing | ||
| * - other types pass through unchanged | ||
| */ | ||
| type WidenString<V> = string extends V ? string | number : V; | ||
| export type WidenPropValue<V> = [V] extends [string] ? WidenString<V> : V; | ||
| /** | ||
| * Structurally identical → `Y`; distinct → `N`. Used by `IsReadonlyKey` to detect | ||
| * readonly keys by comparing `Pick<T, K>` with `Readonly<Pick<T, K>>`. | ||
| */ | ||
| export type IfEquals<A, B, Y = unknown, N = never> = | ||
| (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? Y : N; | ||
| /** | ||
| * True when `K` is readonly on `T`. Singleton-constant properties (e.g. | ||
| * `tagName: "INPUT"`, `nodeType: 1`) are always `readonly` in `lib.dom.d.ts`, so this | ||
| * single check covers both readonly and singleton-literal cases. | ||
| */ | ||
| export type IsReadonlyKey<T, K extends keyof T> = IfEquals< | ||
| Pick<T, K>, | ||
| Readonly<Pick<T, K>>, | ||
| true, | ||
| false | ||
| >; | ||
| /** | ||
| * Resolves to the `prop:K` string literal when `K` is a writable, element-specific | ||
| * property suitable for a `prop:*` attribute; otherwise resolves to `never` so the | ||
| * key is filtered out of the resulting mapped type. | ||
| * | ||
| * Filters out: | ||
| * | ||
| * - base-class keys (via `SkipPropsFrom`) | ||
| * - aria-* keys (already typed via `AriaAttributes`) | ||
| * - readonly keys | ||
| * - keys whose value types fall outside `PropValue` | ||
| * - the generic `string` index signature (e.g. `HTMLFormElement[name: string]: any`), | ||
| * which would otherwise shadow every key with an `any`-typed `prop:*` | ||
| */ | ||
| export type PropKey<T, K extends keyof T> = K extends keyof SkipPropsFrom | ||
| ? never | ||
| : K extends string | ||
| ? string extends K | ||
| ? never | ||
| : K extends `aria${string}` | ||
| ? never | ||
| : T[K] extends PropValue | ||
| ? IsReadonlyKey<T, K> extends true | ||
| ? never | ||
| : `prop:${K}` | ||
| : never | ||
| : never; |
Sorry, the diff of this file is too big to display
| /** | ||
| * Shared type-level helpers used to derive `prop:*` attribute typings from | ||
| * DOM element interfaces (e.g. `HTMLInputElement`, `HTMLButtonElement`). | ||
| * | ||
| * The wrapping of each value (`FunctionMaybe<T>` in `jsx-h.d.ts` vs. the | ||
| * raw value in `jsx.d.ts`) is applied by each consumer when composing its | ||
| * own `Properties<T>` mapped type. That way this file stays identical in | ||
| * both reactive and non-reactive contexts and only needs to exist once. | ||
| * | ||
| * originally from | ||
| * @url https://github.com/potahtml/pota | ||
| */ | ||
| /** Base-class properties shared by all elements — skipped from `prop:*`. */ | ||
| export type SkipPropsFrom = HTMLUnknownElement & HTMLElement & Element & Node; | ||
| /** | ||
| * Value types allowed on a `prop:*`. Primitives plus the writable | ||
| * non-primitive DOM-object props worth exposing: | ||
| * | ||
| * - `HTMLMediaElement.srcObject` | ||
| * - `HTMLButtonElement.popoverTargetElement` / `commandForElement` (and the same via | ||
| * `PopoverTargetAttributes` mixin on `HTMLInputElement`) | ||
| */ | ||
| export type PropValue = | ||
| | string | ||
| | number | ||
| | boolean | ||
| | null | ||
| | MediaStream | ||
| | MediaSource | ||
| | Blob | ||
| | File | ||
| | Element; | ||
| /** | ||
| * Ergonomics widening for emitted `prop:*` value types: | ||
| * | ||
| * - general `string` → `string | number` (HTML coerces numbers) | ||
| * - string literal unions (`'on' | 'off'`) stay exact, so users still get autocomplete / | ||
| * narrowing | ||
| * - other types pass through unchanged | ||
| */ | ||
| type WidenString<V> = string extends V ? string | number : V; | ||
| export type WidenPropValue<V> = [V] extends [string] ? WidenString<V> : V; | ||
| /** | ||
| * Structurally identical → `Y`; distinct → `N`. Used by `IsReadonlyKey` to detect | ||
| * readonly keys by comparing `Pick<T, K>` with `Readonly<Pick<T, K>>`. | ||
| */ | ||
| export type IfEquals<A, B, Y = unknown, N = never> = | ||
| (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? Y : N; | ||
| /** | ||
| * True when `K` is readonly on `T`. Singleton-constant properties (e.g. | ||
| * `tagName: "INPUT"`, `nodeType: 1`) are always `readonly` in `lib.dom.d.ts`, so this | ||
| * single check covers both readonly and singleton-literal cases. | ||
| */ | ||
| export type IsReadonlyKey<T, K extends keyof T> = IfEquals< | ||
| Pick<T, K>, | ||
| Readonly<Pick<T, K>>, | ||
| true, | ||
| false | ||
| >; | ||
| /** | ||
| * Resolves to the `prop:K` string literal when `K` is a writable, element-specific | ||
| * property suitable for a `prop:*` attribute; otherwise resolves to `never` so the | ||
| * key is filtered out of the resulting mapped type. | ||
| * | ||
| * Filters out: | ||
| * | ||
| * - base-class keys (via `SkipPropsFrom`) | ||
| * - aria-* keys (already typed via `AriaAttributes`) | ||
| * - readonly keys | ||
| * - keys whose value types fall outside `PropValue` | ||
| * - the generic `string` index signature (e.g. `HTMLFormElement[name: string]: any`), | ||
| * which would otherwise shadow every key with an `any`-typed `prop:*` | ||
| */ | ||
| export type PropKey<T, K extends keyof T> = K extends keyof SkipPropsFrom | ||
| ? never | ||
| : K extends string | ||
| ? string extends K | ||
| ? never | ||
| : K extends `aria${string}` | ||
| ? never | ||
| : T[K] extends PropValue | ||
| ? IsReadonlyKey<T, K> extends true | ||
| ? never | ||
| : `prop:${K}` | ||
| : never | ||
| : never; |
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
15
-65.12%20
-9.09%366254
-48.69%37
-7.5%7869
-34.37%78
-2.5%