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
1 change: 0 additions & 1 deletion CLAUDE.md

This file was deleted.

6 changes: 2 additions & 4 deletions handbook/src/lib/components/DocLayout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@
if (articleEl) addCopyButtons(articleEl)
})

let versionPrefix = $derived(getVersionPrefix(page.url.pathname) ?? '')
let versionPrefix = $derived(getVersionPrefix(page.route.id ?? '') ?? '')
let allPages = $derived(getAllPages(versionPrefix))
let currentIndex = $derived(
allPages.findIndex((item) => resolveHref(item.href) === page.url.pathname)
)
let currentIndex = $derived(allPages.findIndex((item) => item.href === page.route.id))
let prevPage = $derived(currentIndex > 0 ? allPages[currentIndex - 1] : null)
let nextPage = $derived(currentIndex < allPages.length - 1 ? allPages[currentIndex + 1] : null)

Expand Down
2 changes: 1 addition & 1 deletion handbook/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

let scrollContainer: HTMLElement | undefined = $state()

let isRootLanding = $derived(page.url.pathname === resolve('/') || page.url.pathname === resolveHref(''))
let isRootLanding = $derived(page.url.pathname === resolve('/'))
let isVersionLanding = $derived.by(() => {
const prefix = getVersionPrefix(page.url.pathname)
if (!prefix) return false
Expand Down
6 changes: 5 additions & 1 deletion handbook/src/routes/latest/batch/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
title: Batch
description: Group multiple state updates into a single notification cycle
---
<script>
import VersionLink from '$lib/components/VersionLink.svelte'
</script>



`batch()` collapses multiple state mutations into a single notification cycle. Without batch, each mutation triggers its own propagation — effects see intermediate states. With batch, all mutations apply first, then effects run once with the final state.
Expand All @@ -12,7 +16,7 @@ description: Group multiple state updates into a single notification cycle
function batch<T>(fn: () => T, hooks?: BatchHooks): T
```

Returns the value returned by `fn`. See [Hooks](/latest/hooks-overview) for the optional hooks parameter.
Returns the value returned by `fn`. See <VersionLink path="/hooks-overview">Hooks</VersionLink> for the optional hooks parameter.

## Basic usage

Expand Down
6 changes: 5 additions & 1 deletion handbook/src/routes/latest/derive/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
title: Derive
description: Compute derived values that cache results and auto-update
---
<script>
import VersionLink from '$lib/components/VersionLink.svelte'
</script>



`derive()` creates computed values that update automatically when their dependencies change. It memoizes the result and only recalculates when necessary.
Expand All @@ -20,7 +24,7 @@ type ComputedValue<T> = {
- `value` — the cached computed result (read-only)
- `reactive` — controls the internal effect lifecycle; set to `false` to dispose, `true` to recreate

See [Hooks](/latest/hooks-overview) for the optional hooks parameter.
See <VersionLink path="/hooks-overview">Hooks</VersionLink> for the optional hooks parameter.

## Basic usage

Expand Down
6 changes: 5 additions & 1 deletion handbook/src/routes/latest/effects/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
title: Effects
description: Write side effects that auto-run when their dependencies change
---
<script>
import VersionLink from '$lib/components/VersionLink.svelte'
</script>



`effect()` creates reactive functions that re-run automatically when their dependencies change. Effects bridge reactive state to side effects — logging, network requests, DOM updates, and so on.
Expand All @@ -16,7 +20,7 @@ type EffectName = string
type Unsubscribe = () => void
```

Returns a dispose function. Call it to stop the effect and clean up all subscriptions. See [Hooks](/latest/hooks-overview) for the optional hooks parameter.
Returns a dispose function. Call it to stop the effect and clean up all subscriptions. See <VersionLink path="/hooks-overview">Hooks</VersionLink> for the optional hooks parameter.

## Basic usage

Expand Down
6 changes: 5 additions & 1 deletion handbook/src/routes/latest/hooks-api/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
title: Hooks API Reference
description: Complete hook interface definitions for StateHooks, EffectHooks, DeriveHooks, and BatchHooks
---
<script>
import VersionLink from '$lib/components/VersionLink.svelte'
</script>


Complete interface definitions for all hook types. For an introduction to hooks, see the [Hooks Overview](/latest/hooks-overview).

Complete interface definitions for all hook types. For an introduction to hooks, see the <VersionLink path="/hooks-overview">Hooks Overview</VersionLink>.

## Base types

Expand Down
6 changes: 5 additions & 1 deletion handbook/src/routes/latest/hooks-catalog/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
title: Hooks Catalog
description: Hook interfaces, composeHook utility, and patterns for writing your own hooks
---
<script>
import VersionLink from '$lib/components/VersionLink.svelte'
</script>



This page documents what ships in `@nerdalytics/beacon`: the hook type interfaces and the `composeHook` utility. There are no built-in hook implementations — you write your own hook functions against these interfaces.

For a conceptual overview and the composition model, see [Hooks Overview](/latest/hooks-overview).
For a conceptual overview and the composition model, see <VersionLink path="/hooks-overview">Hooks Overview</VersionLink>.

## Hook interface reference

Expand Down
6 changes: 5 additions & 1 deletion handbook/src/routes/latest/hooks-overview/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
title: Hooks Overview
description: Zero-cost instrumentation for all four Beacon primitives
---
<script>
import VersionLink from '$lib/components/VersionLink.svelte'
</script>



All four Beacon primitives — `state`, `effect`, `derive`, `batch` — accept an optional hooks parameter as their last argument. Hooks observe internal operations without affecting behavior.
Expand Down Expand Up @@ -288,4 +292,4 @@ const hooks = process.env.NODE_ENV === 'development'
const $state = state(initial, hooks)
```

See the [Hooks Catalog](/latest/hooks-catalog) for hook interface reference, `composeHook` documentation, and practical examples.
See the <VersionLink path="/hooks-catalog">Hooks Catalog</VersionLink> for hook interface reference, `composeHook` documentation, and practical examples.
6 changes: 5 additions & 1 deletion handbook/src/routes/latest/state/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
title: State
description: Create and manage reactive objects with automatic dependency tracking
---
<script>
import VersionLink from '$lib/components/VersionLink.svelte'
</script>



`state()` creates reactive objects. It wraps plain JavaScript objects in Proxies for automatic dependency tracking and change notification.
Expand All @@ -12,7 +16,7 @@ description: Create and manage reactive objects with automatic dependency tracki
function state<T extends object>(initial: T, hooks?: StateHooks<T>): T
```

Returns a Proxy-wrapped version of the input object. Passing a non-object returns the value as-is. See [Hooks](/latest/hooks-overview) for the optional hooks parameter.
Returns a Proxy-wrapped version of the input object. Passing a non-object returns the value as-is. See <VersionLink path="/hooks-overview">Hooks</VersionLink> for the optional hooks parameter.

## Creating reactive state

Expand Down
6 changes: 5 additions & 1 deletion handbook/src/routes/v2000.0.0/batch/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
title: Batch
description: Group multiple state updates into a single notification cycle
---
<script>
import VersionLink from '$lib/components/VersionLink.svelte'
</script>



`batch()` collapses multiple state mutations into a single notification cycle. Without batch, each mutation triggers its own propagation — effects see intermediate states. With batch, all mutations apply first, then effects run once with the final state.
Expand All @@ -12,7 +16,7 @@ description: Group multiple state updates into a single notification cycle
function batch<T>(fn: () => T, hooks?: BatchHooks): T
```

Returns the value returned by `fn`. See [Hooks](/v2000.0.0/hooks-overview) for the optional hooks parameter.
Returns the value returned by `fn`. See <VersionLink path="/hooks-overview">Hooks</VersionLink> for the optional hooks parameter.

## Basic usage

Expand Down
6 changes: 5 additions & 1 deletion handbook/src/routes/v2000.0.0/derive/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
title: Derive
description: Compute derived values that cache results and auto-update
---
<script>
import VersionLink from '$lib/components/VersionLink.svelte'
</script>



`derive()` creates computed values that update automatically when their dependencies change. It memoizes the result and only recalculates when necessary.
Expand All @@ -20,7 +24,7 @@ type ComputedValue<T> = {
- `value` — the cached computed result (read-only)
- `reactive` — controls the internal effect lifecycle; set to `false` to dispose, `true` to recreate

See [Hooks](/v2000.0.0/hooks-overview) for the optional hooks parameter.
See <VersionLink path="/hooks-overview">Hooks</VersionLink> for the optional hooks parameter.

## Basic usage

Expand Down
6 changes: 5 additions & 1 deletion handbook/src/routes/v2000.0.0/effects/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
title: Effects
description: Write side effects that auto-run when their dependencies change
---
<script>
import VersionLink from '$lib/components/VersionLink.svelte'
</script>



`effect()` creates reactive functions that re-run automatically when their dependencies change. Effects bridge reactive state to side effects — logging, network requests, DOM updates, and so on.
Expand All @@ -16,7 +20,7 @@ type EffectName = string
type Unsubscribe = () => void
```

Returns a dispose function. Call it to stop the effect and clean up all subscriptions. See [Hooks](/v2000.0.0/hooks-overview) for the optional hooks parameter.
Returns a dispose function. Call it to stop the effect and clean up all subscriptions. See <VersionLink path="/hooks-overview">Hooks</VersionLink> for the optional hooks parameter.

## Basic usage

Expand Down
6 changes: 5 additions & 1 deletion handbook/src/routes/v2000.0.0/hooks-api/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
title: Hooks API Reference
description: Complete hook interface definitions for StateHooks, EffectHooks, DeriveHooks, and BatchHooks
---
<script>
import VersionLink from '$lib/components/VersionLink.svelte'
</script>


Complete interface definitions for all hook types. For an introduction to hooks, see the [Hooks Overview](/v2000.0.0/hooks-overview).

Complete interface definitions for all hook types. For an introduction to hooks, see the <VersionLink path="/hooks-overview">Hooks Overview</VersionLink>.

## Base types

Expand Down
6 changes: 5 additions & 1 deletion handbook/src/routes/v2000.0.0/hooks-catalog/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
title: Hooks Catalog
description: Hook interfaces, composeHook utility, and patterns for writing your own hooks
---
<script>
import VersionLink from '$lib/components/VersionLink.svelte'
</script>



This page documents what ships in `@nerdalytics/beacon`: the hook type interfaces and the `composeHook` utility. There are no built-in hook implementations — you write your own hook functions against these interfaces.

For a conceptual overview and the composition model, see [Hooks Overview](/v2000.0.0/hooks-overview).
For a conceptual overview and the composition model, see <VersionLink path="/hooks-overview">Hooks Overview</VersionLink>.

## Hook interface reference

Expand Down
6 changes: 5 additions & 1 deletion handbook/src/routes/v2000.0.0/hooks-overview/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
title: Hooks Overview
description: Zero-cost instrumentation for all four Beacon primitives
---
<script>
import VersionLink from '$lib/components/VersionLink.svelte'
</script>



All four Beacon primitives — `state`, `effect`, `derive`, `batch` — accept an optional hooks parameter as their last argument. Hooks observe internal operations without affecting behavior.
Expand Down Expand Up @@ -288,4 +292,4 @@ const hooks = process.env.NODE_ENV === 'development'
const $state = state(initial, hooks)
```

See the [Hooks Catalog](/v2000.0.0/hooks-catalog) for hook interface reference, `composeHook` documentation, and practical examples.
See the <VersionLink path="/hooks-catalog">Hooks Catalog</VersionLink> for hook interface reference, `composeHook` documentation, and practical examples.
6 changes: 5 additions & 1 deletion handbook/src/routes/v2000.0.0/state/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
title: State
description: Create and manage reactive objects with automatic dependency tracking
---
<script>
import VersionLink from '$lib/components/VersionLink.svelte'
</script>



`state()` creates reactive objects. It wraps plain JavaScript objects in Proxies for automatic dependency tracking and change notification.
Expand All @@ -12,7 +16,7 @@ description: Create and manage reactive objects with automatic dependency tracki
function state<T extends object>(initial: T, hooks?: StateHooks<T>): T
```

Returns a Proxy-wrapped version of the input object. Passing a non-object returns the value as-is. See [Hooks](/v2000.0.0/hooks-overview) for the optional hooks parameter.
Returns a Proxy-wrapped version of the input object. Passing a non-object returns the value as-is. See <VersionLink path="/hooks-overview">Hooks</VersionLink> for the optional hooks parameter.

## Creating reactive state

Expand Down
3 changes: 0 additions & 3 deletions handbook/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ const config = {
paths: {
base: process.argv.includes('dev') ? '' : process.env.BASE_PATH,
},
prerender: {
handleHttpError: 'warn',
},
},
preprocess: [
vitePreprocess(),
Expand Down
2 changes: 1 addition & 1 deletion mise.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tools]
node = "24.14.1"
node = "24.21.0"

[env]
NODE_COMPILER_CACHE = "$TMPDIR/.node-cache"
Expand Down
Loading