Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions scripts/extract-solid-ref.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ const CANONICAL_ROUTES = {
Switch: ["components-jsx/switch-and-match.mdx", "Components (JSX)"],

clientOnly: ["rendering-ssr/client-only.mdx", "Rendering & SSR"],
getHydrationWriter: [
"rendering-ssr/get-hydration-writer.mdx",
"Rendering & SSR",
],
httpHeader: ["rendering-ssr/http-header.mdx", "Rendering & SSR"],
httpStatus: ["rendering-ssr/http-status.mdx", "Rendering & SSR"],
hydrate: ["rendering-ssr/hydrate.mdx", "Rendering & SSR"],
Expand All @@ -155,6 +159,10 @@ const CANONICAL_ROUTES = {
render: ["rendering-ssr/render.mdx", "Rendering & SSR"],
renderToStream: ["rendering-ssr/render-to-stream.mdx", "Rendering & SSR"],
renderToString: ["rendering-ssr/render-to-string.mdx", "Rendering & SSR"],
takeHydrationValue: [
"rendering-ssr/take-hydration-value.mdx",
"Rendering & SSR",
],

GET: ["server-functions/get.mdx", "Server functions"],
live: ["server-functions/live.mdx", "Server functions"],
Expand Down Expand Up @@ -283,6 +291,14 @@ const ADVANCED_ROUTES = {
"advanced/manual-hydration/hydration.mdx",
"Advanced / Manual Hydration",
],
isHydratable: [
"advanced/manual-hydration/is-hydratable.mdx",
"Advanced / Manual Hydration",
],
isHydrating: [
"advanced/manual-hydration/is-hydrating.mdx",
"Advanced / Manual Hydration",
],
NoHydration: [
"advanced/manual-hydration/no-hydration.mdx",
"Advanced / Manual Hydration",
Expand Down Expand Up @@ -457,11 +473,14 @@ const FOLD_INTO = {
RecordEvent: "OBSERVE",
RecordLive: "OBSERVE",
RecordListener: "OBSERVE",
RecordSubscribeOptions: "OBSERVE",
BoundaryEvent: "OBSERVE",
BoundaryListener: "OBSERVE",
BoundaryLive: "OBSERVE",
CallEvent: "OBSERVE",
CallListener: "OBSERVE",
CallRequestEvent: "OBSERVE",
CallRequestListener: "OBSERVE",
CallLive: "OBSERVE",
FrameEvent: "OBSERVE",
FrameProducedEvent: "OBSERVE",
Expand All @@ -477,6 +496,7 @@ const FOLD_INTO = {
RenderEvent: "OBSERVE",
RenderListener: "OBSERVE",
RenderLive: "OBSERVE",
RenderRoute: "OBSERVE",
// solid-js/attribution: the engine, its options and its records. The
// records are delivered on OBSERVE.records; their shapes live here.
Attribution: "attribution",
Expand Down Expand Up @@ -575,6 +595,8 @@ const FOLD_INTO = {
RequestEvent: "getRequestEvent",
RequestEventLocals: "getRequestEvent",
ResponseStub: "getRequestEvent",
HydrationWriter: "getHydrationWriter",
HydrationValue: "takeHydrationValue",
ServerFunction: "withMeta",
ServerFunctionMetadata: "withMeta",
LiveSource: "live",
Expand Down Expand Up @@ -602,6 +624,13 @@ const FOLD_INTO = {
};

const HIDDEN_EXPORTS = new Set([
// Compiler slot protocol; not part of the application-facing reference.
"SLOT_VALUE",
"SLOT_MARKER",
"SLOT_FACE_STREAM",
"SLOT_FACE_DATA",
"SLOT_FACE_MARKUP",
"isSlotValue",
"$DEVCOMP",
"$PROXY",
"$REFRESH",
Expand Down Expand Up @@ -1026,6 +1055,7 @@ const VALUE_IMPORTS = new Set(["storePath"]);
// Exports with a client stub and a server implementation: the page reads
// from the implementation.
const PREFERRED_SOURCE_PATHS = {
getHydrationWriter: "packages/web/src/server.ts",
getRequestEvent: "packages/web/src/server.ts",
getTraceContext: "packages/web/src/server.ts",
configureServerErrors: "packages/web/src/server.ts",
Expand Down Expand Up @@ -2560,6 +2590,10 @@ const COLLAPSED_RELATED_TYPES = new Set([
]);

const REFERENCE_FIXUPS = [
[
/onSettled\(\(\) => setWidth\(el\.offsetWidth\)\);/g,
"onSettled(() => { setWidth(el.offsetWidth); });",
],
[
/createSignal<T>\(fn, initialValue\?, options\?:/g,
"createSignal<T>(fn, options?:",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: "isHydratable"
category: "Advanced / Manual Hydration"
use_cases: "advanced manual hydration api, ishydratable usage"
tags:
- "is"
- "hydratable"
- "advanced"
- "manual"
- "hydration"
- "reference"
- "api"
- "v2"
version: "2.0"
description: "Whether the calling owner sits where hydration applies — not under `<NoHydration>`, or back under a nested `<Hydration>` — so a value keyed to this position reaches a hydrating client."
source_repo: "solidjs/solid"
source_ref: "next"
source_path: "packages/solid/src/client/hydration.ts"
---

{/* Generated by scripts/extract-solid-ref.mjs. Edit the source JSDoc or disposition map, then regenerate. */}

Whether the calling owner sits where hydration applies — not under
`<NoHydration>`, or back under a nested `<Hydration>` — so a value keyed
to this position reaches a hydrating client. On the server it also
requires the owner to belong to a render in progress. `false` with no
owner (a promise continuation, an IO callback): read it where the owner
is known. On the client, `<Hydration>` is a passthrough, so inside a
`<NoHydration>` zone (which renders only outside hydration) this stays
`false` even under a nested `<Hydration>`.

Solid decides this itself for its own values. A library writing keyed
values with `getHydrationWriter()` reads it to make the same decision.

## Import

```ts
import { isHydratable } from "solid-js";
```

## Type signature

```ts
function isHydratable(): boolean;
```

## Learn more

- [Controlling hydration](/concepts/rendering-and-ssr#controlling-hydration)
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: "isHydrating"
category: "Advanced / Manual Hydration"
use_cases: "advanced manual hydration api, ishydrating usage"
tags:
- "is"
- "hydrating"
- "advanced"
- "manual"
- "hydration"
- "reference"
- "api"
- "v2"
version: "2.0"
description: "Whether the code running now is claiming server-rendered DOM: the root pass of `hydrate()`, or code under a streamed `<Loading>` boundary while that boundary resumes."
source_repo: "solidjs/solid"
source_ref: "next"
source_path: "packages/solid/src/client/hydration.ts"
---

{/* Generated by scripts/extract-solid-ref.mjs. Edit the source JSDoc or disposition map, then regenerate. */}

Whether the code running now is claiming server-rendered DOM: the root
pass of `hydrate()`, or code under a streamed `<Loading>` boundary while
that boundary resumes. `false` on the server, in client-only renders,
after hydration, and in a render a resume window triggers outside the
resuming boundary (that render builds fresh DOM).

Not reactive: read it where a component or primitive is created. While it
is `true`, render what the server rendered, and switch to the client-only
value from `onSettled`.

## Import

```ts
import { isHydrating } from "solid-js";
```

## Type signature

```ts
function isHydrating(): boolean;
```

## Examples

```ts
const [width, setWidth] = createSignal(isHydrating() ? 0 : el.offsetWidth);
onSettled(() => {
setWidth(el.offsetWidth);
});
```

## Learn more

- [Controlling hydration](/concepts/rendering-and-ssr#controlling-hydration)
Loading
Loading