Skip to content

docs: update hooks page - #16417

Merged
Rich-Harris merged 3 commits into
mainfrom
update-hooks-docs
Jul 19, 2026
Merged

docs: update hooks page#16417
Rich-Harris merged 3 commits into
mainfrom
update-hooks-docs

Conversation

@Rich-Harris

Copy link
Copy Markdown
Member

follow-up to #16396, which unfortunately broke the docs as a result of how they're being built during the 2-3 transition. We need to apply the same changes to main, and then merge sveltejs/svelte.dev#2102

@pkg-svelte-dev

pkg-svelte-dev Bot commented Jul 19, 2026

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 9900ae1:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/9900ae127ccc2878c612ee1666c7fa05f740c5ab

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/16417

@changeset-bot

changeset-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9900ae1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread documentation/docs/30-advanced/20-hooks.md Outdated
… alias instead of SvelteKit's canonical `$lib/...` alias

This commit fixes the issue reported at documentation/docs/30-advanced/20-hooks.md:286

## Bug

In `documentation/docs/30-advanced/20-hooks.md`, two code-example imports were changed to use `#lib`:

*   Line 286: `import * as db from '#lib/server/database';`
*   Line 359: `import { Vector } from '#lib/math';`

`$lib` is the canonical SvelteKit path alias (documented in `documentation/docs/98-reference/26-$lib.md`) and is used in 70+ other places across the docs. `#lib` is not a valid SvelteKit alias and appeared nowhere else in the repository — confirmed via grep, which returned only these two lines.

## Trigger / Impact

Any reader copying these snippets would get a broken import, since `#lib` does not resolve in a standard SvelteKit project. The change was unrelated to the PR's intended purpose (updating anchor links). The `// @errors: 2307` directive suppresses module-not-found errors in the docs build, so the typo was not caught by type-checking.

## Fix

Restored both imports to `$lib/server/database` and `$lib/math`. Confirmed no remaining `#lib/` occurrences in the repo.


Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: Rich-Harris <hello@rich-harris.dev>
@svelte-docs-bot

Copy link
Copy Markdown

@Rich-Harris

Copy link
Copy Markdown
Member Author

gonna self-merge this to cut a release, which we need so that the docs can build. gah this is a mess

@Rich-Harris
Rich-Harris merged commit c1665b9 into main Jul 19, 2026
25 of 27 checks passed
@Rich-Harris
Rich-Harris deleted the update-hooks-docs branch July 19, 2026 00:22
@github-actions github-actions Bot mentioned this pull request Jul 19, 2026
Rich-Harris pushed a commit that referenced this pull request Jul 19, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @sveltejs/kit@2.70.1

### Patch Changes

- docs: update links to hooks documentation
([#16417](#16417))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Rich-Harris added a commit that referenced this pull request Jul 19, 2026
so confused about how these changes got missed from #16417
@Nic-Polumeyv

Copy link
Copy Markdown
Contributor

Thanks for porting this. Really sorry. I ended my night right before all this. Noted for future docs PRs that change anchors.

@Rich-Harris

Copy link
Copy Markdown
Member Author

not your fault! if anyone should have anticipated this it's me

@Nic-Polumeyv Nic-Polumeyv mentioned this pull request Jul 20, 2026
6 tasks
renovate Bot added a commit to cigaleapp/cigale that referenced this pull request Jul 27, 2026
##### [v2.70.1](https://github.com/sveltejs/kit/blob/HEAD/packages/kit/CHANGELOG.md#2701)

##### Patch Changes

- docs: update links to hooks documentation ([#16417](sveltejs/kit#16417))
##### [v2.70.0](https://github.com/sveltejs/kit/blob/HEAD/packages/kit/CHANGELOG.md#2700)

##### Minor Changes

- feat: move `defineEnvVars` to `@sveltejs/kit/env` ([#16378](sveltejs/kit#16378))

##### Patch Changes

- fix: enable CSRF protection in builds with a non-production `NODE_ENV` value ([#16313](sveltejs/kit#16313))
##### [v2.69.3](https://github.com/sveltejs/kit/blob/HEAD/packages/kit/CHANGELOG.md#2693)

##### Patch Changes

- fix: detect destructured `load` and `actions` exports during type generation ([#16329](sveltejs/kit#16329))

- fix: ensure CSS URL references are absolute when `paths.relative` is `false` ([#16315](sveltejs/kit#16315))

- fix: align MAX\_COOKIE\_SIZE with RFC 6265bis ([#16322](sveltejs/kit#16322))
renovate Bot added a commit to cigaleapp/cigale that referenced this pull request Jul 27, 2026
##### [v2.70.1](https://github.com/sveltejs/kit/blob/HEAD/packages/kit/CHANGELOG.md#2701)

##### Patch Changes

- docs: update links to hooks documentation ([#16417](sveltejs/kit#16417))
##### [v2.70.0](https://github.com/sveltejs/kit/blob/HEAD/packages/kit/CHANGELOG.md#2700)

##### Minor Changes

- feat: move `defineEnvVars` to `@sveltejs/kit/env` ([#16378](sveltejs/kit#16378))

##### Patch Changes

- fix: enable CSRF protection in builds with a non-production `NODE_ENV` value ([#16313](sveltejs/kit#16313))
##### [v2.69.3](https://github.com/sveltejs/kit/blob/HEAD/packages/kit/CHANGELOG.md#2693)

##### Patch Changes

- fix: detect destructured `load` and `actions` exports during type generation ([#16329](sveltejs/kit#16329))

- fix: ensure CSS URL references are absolute when `paths.relative` is `false` ([#16315](sveltejs/kit#16315))

- fix: align MAX\_COOKIE\_SIZE with RFC 6265bis ([#16322](sveltejs/kit#16322))
gwennlbh pushed a commit to cigaleapp/cigale that referenced this pull request Jul 27, 2026
##### [v2.70.1](https://github.com/sveltejs/kit/blob/HEAD/packages/kit/CHANGELOG.md#2701)

##### Patch Changes

- docs: update links to hooks documentation ([#16417](sveltejs/kit#16417))
##### [v2.70.0](https://github.com/sveltejs/kit/blob/HEAD/packages/kit/CHANGELOG.md#2700)

##### Minor Changes

- feat: move `defineEnvVars` to `@sveltejs/kit/env` ([#16378](sveltejs/kit#16378))

##### Patch Changes

- fix: enable CSRF protection in builds with a non-production `NODE_ENV` value ([#16313](sveltejs/kit#16313))
##### [v2.69.3](https://github.com/sveltejs/kit/blob/HEAD/packages/kit/CHANGELOG.md#2693)

##### Patch Changes

- fix: detect destructured `load` and `actions` exports during type generation ([#16329](sveltejs/kit#16329))

- fix: ensure CSS URL references are absolute when `paths.relative` is `false` ([#16315](sveltejs/kit#16315))

- fix: align MAX\_COOKIE\_SIZE with RFC 6265bis ([#16322](sveltejs/kit#16322))

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants