# @sveltejs/kit ## 2.70.3 ### Patch Changes - fix: avoid eagerly reading `$app/state` dependencies during module initialization ([`b61018d`](https://github.com/sveltejs/kit/commit/b61018d0526e827d1ef8cf8e21ef62b92230ae3d)) ## 2.70.2 ### Patch Changes - fix: prevent quadratic backtracking in `Accept` header content negotiation ([`82712fc`](https://github.com/sveltejs/kit/commit/82712fc02c24b1dcf5b25d7a52129cd8455f04f5)) ## 2.70.1 ### Patch Changes - docs: update links to hooks documentation ([#16417](https://github.com/sveltejs/kit/pull/16417)) ## 2.70.0 ### Minor Changes - feat: move `defineEnvVars` to `@sveltejs/kit/env` ([#16378](https://github.com/sveltejs/kit/pull/16378)) ### Patch Changes - fix: enable CSRF protection in builds with a non-production `NODE_ENV` value ([#16313](https://github.com/sveltejs/kit/pull/16313)) ## 2.69.3 ### Patch Changes - fix: detect destructured `load` and `actions` exports during type generation ([#16329](https://github.com/sveltejs/kit/pull/16329)) - fix: ensure CSS URL references are absolute when `paths.relative` is `false` ([#16315](https://github.com/sveltejs/kit/pull/16315)) - fix: align MAX_COOKIE_SIZE with RFC 6265bis ([#16322](https://github.com/sveltejs/kit/pull/16322)) ## 2.69.2 ### Patch Changes - fix: set `define` values on `globalThis` when running Vitest ([#16246](https://github.com/sveltejs/kit/pull/16246)) ## 2.69.1 ### Patch Changes - fix: prevent prototype pollution when deleting file inputs ([#16218](https://github.com/sveltejs/kit/pull/16218)) - fix: prevent unhandled promise rejection ([#16219](https://github.com/sveltejs/kit/pull/16219)) ## 2.69.0 ### Minor Changes - feat: expose `submitted` property of remote forms ([#14811](https://github.com/sveltejs/kit/pull/14811)) ### Patch Changes - fix: clear issues and touched states on form reset ([#16163](https://github.com/sveltejs/kit/pull/16163)) - fix: return `undefined` from `fields.branch.issues()` when only `fields.branch.leaf` has issues ([#16187](https://github.com/sveltejs/kit/pull/16187)) ## 2.68.0 ### Minor Changes - feat: expose `RemoteFormEnhanceInstance` and `RemoteFormEnhanceCallback` types ([#15816](https://github.com/sveltejs/kit/pull/15816)) - feat: set value of `submit` fields when form is submitted ([#15979](https://github.com/sveltejs/kit/pull/15979)) ### Patch Changes - fix: skip `native_navigation` when `__data.json` returns 404 on a static fallback page ([#16135](https://github.com/sveltejs/kit/pull/16135)) - fix: ignore third-party monkeypatches in `pushState`/`replaceState` warning detection ([#15267](https://github.com/sveltejs/kit/pull/15267)) - fix: snapshot form fields on read ([#16150](https://github.com/sveltejs/kit/pull/16150)) - fix: strip field prefix before erroring on duplicates ([#16151](https://github.com/sveltejs/kit/pull/16151)) - fix: call reset function via prototype ([#16138](https://github.com/sveltejs/kit/pull/16138)) - chore: fix navigation `type` hover info ([#16147](https://github.com/sveltejs/kit/pull/16147)) ## 2.67.0 ### Minor Changes - feat: add `prerender.handleInvalidUrl` option for invalid URLs discovered while crawling ([#16088](https://github.com/sveltejs/kit/pull/16088)) ### Patch Changes - fix: support `exactOptionalPropertyTypes` for optional form schema fields ([#15866](https://github.com/sveltejs/kit/pull/15866)) - fix: avoid unnecessarily overriding a user's Vite 8 `codeSplitting` setting ([#16118](https://github.com/sveltejs/kit/pull/16118)) ## 2.66.0 ### Minor Changes - feat: precompress prerendered `.md` and `.mdx` files ([#15893](https://github.com/sveltejs/kit/pull/15893)) - feat: warn the user when they forget to make boolean inputs optional in their form schemas ([#15804](https://github.com/sveltejs/kit/pull/15804)) ### Patch Changes - fix: blur active element before component update during navigation so that blur/focusout handlers fire while old component data is still valid ([#15452](https://github.com/sveltejs/kit/pull/15452)) - fix: ensure `base` is available from `$service-worker` during development ([#15882](https://github.com/sveltejs/kit/pull/15882)) - fix: use correct relative asset paths when rendering an error page for a missing `__data.json` request ([#15884](https://github.com/sveltejs/kit/pull/15884)) - fix: preserve active `for await` consumers across `query.live` reconnects ([#16022](https://github.com/sveltejs/kit/pull/16022)) - fix: settle `query.live` reconnect promise on all exit paths, preventing `invalidateAll()` from deadlocking when a live query is offline or interrupted ([#16022](https://github.com/sveltejs/kit/pull/16022)) - fix: preserve last value when a `query.live` stream completes without yielding on reconnect ([#16022](https://github.com/sveltejs/kit/pull/16022)) - fix: remove `types: ['node']` from generated tsconfig to avoid errors when `@types/node` is not installed ([#15709](https://github.com/sveltejs/kit/pull/15709)) - fix: prefer pages over endpoints when prerendering ([#16076](https://github.com/sveltejs/kit/pull/16076)) - fix: restore snapshots after afterNavigate callbacks ([#16066](https://github.com/sveltejs/kit/pull/16066)) - fix: support `ws:`/`wss:` and `trusted-types-eval` for CSP sources ([#15938](https://github.com/sveltejs/kit/pull/15938)) - fix: omit empty `file` inputs from remote form data ([#15898](https://github.com/sveltejs/kit/pull/15898)) - fix: fail early if a route with `+page` and `+server` is marked as prerenderable ([#16075](https://github.com/sveltejs/kit/pull/16075)) - fix: wait a tick before resetting forms ([#15805](https://github.com/sveltejs/kit/pull/15805)) - fix: `preflight` schemas apply correctly when chained before `for` ([#15863](https://github.com/sveltejs/kit/pull/15863)) - fix: blank page in SPA mode when root layout `load()` throws ([#15798](https://github.com/sveltejs/kit/pull/15798)) - fix: pass all unknown options from the `sveltekit` Vite plugin through to `vite-plugin-svelte` ([#16010](https://github.com/sveltejs/kit/pull/16010)) ## 2.65.2 ### Patch Changes - fix: throw an error when prerendering a root +server.js that returns a non-HTML response ([#15994](https://github.com/sveltejs/kit/pull/15994)) - fix: decode base64-serialized fetch bodies before caching them for client-side replay ([#16034](https://github.com/sveltejs/kit/pull/16034)) - fix: correctly access explicit dynamic public environment variables from prerendered pages and service workers ([#16024](https://github.com/sveltejs/kit/pull/16024)) - fix: allow `preloadCode` to be called during initial page load ([#16028](https://github.com/sveltejs/kit/pull/16028)) - fix: send `cache-control: private, no-store` on remote function responses so personalized query results can never be cached by shared caches ([#16020](https://github.com/sveltejs/kit/pull/16020)) - fix: preserve the HTTP status and error body when a remote function request fails in transport (e.g. a 401/403 from a `handle` hook), instead of reporting a generic 500 ([#16021](https://github.com/sveltejs/kit/pull/16021)) - fix: avoid loading universal nodes during build analysis when the app uses a hash router ([#16042](https://github.com/sveltejs/kit/pull/16042)) - fix: correctly serve client entry during development when using the pnpm global virtual store ([#16045](https://github.com/sveltejs/kit/pull/16045)) - fix: normalize path separators when comparing config ([#16037](https://github.com/sveltejs/kit/pull/16037)) - fix: ensure `building` resolves correctly to allow avoiding build-time explicit environment variable validation ([#16058](https://github.com/sveltejs/kit/pull/16058)) - fix: prevent unhandled promise rejections when remote function failures are consumed via `current`/`error` instead of `await` ([#16018](https://github.com/sveltejs/kit/pull/16018)) ## 2.65.1 ### Patch Changes - fix: avoid importing the Vite development client code into builds with a non-standard `NODE_ENV` ([#16023](https://github.com/sveltejs/kit/pull/16023)) - fix: don't emit the unused bundle and stylesheet files when using `bundleStrategy: 'inline'` ([#16025](https://github.com/sveltejs/kit/pull/16025)) - fix: reset queries before navigating when `invalidateAll` is set ([#16014](https://github.com/sveltejs/kit/pull/16014)) - fix: regression in loading assets for absolute path apps ([#16026](https://github.com/sveltejs/kit/pull/16026)) ## 2.65.0 ### Minor Changes - feat: allow queries to refresh other queries ([#16012](https://github.com/sveltejs/kit/pull/16012)) ### Patch Changes - fix: dedupe remote data ([#15991](https://github.com/sveltejs/kit/pull/15991)) - fix: skip client build if all routes have CSR disabled ([#15936](https://github.com/sveltejs/kit/pull/15936)) ## 2.64.0 ### Minor Changes - feat: allow commands to receive `File` objects ([#15978](https://github.com/sveltejs/kit/pull/15978)) ### Patch Changes - fix: avoid server components from being bundled if SSR is turned off for a route ([#15982](https://github.com/sveltejs/kit/pull/15982)) ## 2.63.1 ### Patch Changes - fix: use SSE for `query.live` ([#15957](https://github.com/sveltejs/kit/pull/15957)) - fix: use forward slashes in the generated `env.d.ts` import path on Windows ([#15977](https://github.com/sveltejs/kit/pull/15977)) - fix: allow `$app/environment` with a warning when `explicitEnvironmentVariables` is enabled ([#15980](https://github.com/sveltejs/kit/pull/15980)) - fix: avoid importing Vite while validating explicit environment variables ([#15953](https://github.com/sveltejs/kit/pull/15953)) - docs: adjust the release version of explicit env vars ([#15968](https://github.com/sveltejs/kit/pull/15968)) - fix: ensure `version` is defined when importing from `$app/env` with explicit environment variables ([#15971](https://github.com/sveltejs/kit/pull/15971)) ## 2.63.0 ### Minor Changes - feat: explicit env vars ([#15934](https://github.com/sveltejs/kit/pull/15934)) ### Patch Changes - fix: remove check for svelte.config.js before running `sync` ([#15946](https://github.com/sveltejs/kit/pull/15946)) - fix: generate a placeholder tsconfig.json to squelch sync-time warnings ([#15948](https://github.com/sveltejs/kit/pull/15948)) - fix: allow use of `$app/env/public` in service workers ([#15950](https://github.com/sveltejs/kit/pull/15950)) ## 2.62.0 ### Minor Changes - feat: support passing Svelte(Kit) config via Vite plugin ([#15944](https://github.com/sveltejs/kit/pull/15944)) ### Patch Changes - fix: preserve multiple `Set-Cookie` headers on 304 responses ([#15902](https://github.com/sveltejs/kit/pull/15902)) - fix: preload for anchor elements that were just previously preloaded ([#15915](https://github.com/sveltejs/kit/pull/15915)) - fix: catch load function streaming errors on the client ([#15929](https://github.com/sveltejs/kit/pull/15929)) - fix: avoid generating the `_app/env.js` module if public dynamic environment variables are not used by the app ([#15940](https://github.com/sveltejs/kit/pull/15940)) ## 2.61.1 ### Patch Changes - fix: regression where routes starting and ending with a route group are not matched correctly ([#15903](https://github.com/sveltejs/kit/pull/15903)) ## 2.61.0 ### Minor Changes - breaking: the `.run()` method has been removed from remote queries on both the client and the server. Use `await query()` directly instead — it now works everywhere ([#15779](https://github.com/sveltejs/kit/pull/15779)) - feat: remote queries can now be awaited in any context (event handlers, module scope, async callbacks), not just inside reactive contexts. The cache is shared across reactive and non-reactive subscribers, so awaiting a query in an event handler will dedupe with components that have already subscribed to the same query. ([#15779](https://github.com/sveltejs/kit/pull/15779)) - feat: live query instances are now themselves async-iterable ([#15878](https://github.com/sveltejs/kit/pull/15878)) - feat: add programmatic `submit` method to `form` remote function instances ([#15657](https://github.com/sveltejs/kit/pull/15657)) - feat: pass `form` remote function instance into `enhance` callback ([#15657](https://github.com/sveltejs/kit/pull/15657)) ### Patch Changes - fix: resolve the app payload without using `process.env.NODE_ENV` ([#15852](https://github.com/sveltejs/kit/pull/15852)) - fix: support `exactOptionalPropertyTypes` for optional route params ([#15825](https://github.com/sveltejs/kit/pull/15825)) - fix: correctly send `true` value to the server for 'submit' and 'hidden' form fields ([#15858](https://github.com/sveltejs/kit/pull/15858)) - fix: avoid build warnings about undefined universal hooks ([#15895](https://github.com/sveltejs/kit/pull/15895)) - fix: prefer default error page when failing to decode the URL pathname ([#15744](https://github.com/sveltejs/kit/pull/15744)) - fix: disable link prefetching on slow internet connections ([#15885](https://github.com/sveltejs/kit/pull/15885)) - fix: allow routes ending with optional parameters next to more specific routes ([#15861](https://github.com/sveltejs/kit/pull/15861)) - fix: remove reliance on Content-Length header in deserialize_binary_form, which caused failures when proxies (e.g. Vercel, Azure) strip the header and use chunked transfer encoding ([#15796](https://github.com/sveltejs/kit/pull/15796)) ## 2.60.1 ### Patch Changes - chore: bump `svelte` and `devalue` ([#15836](https://github.com/sveltejs/kit/pull/15836)) - fix: prevent `query.batch` cross-talk ([`dadaefc`](https://github.com/sveltejs/kit/commit/dadaefc2e647a0a62f49f3ee8bc7aa46f5e27056)) ## 2.60.0 ### Minor Changes - feat: allow 'submit' and 'hidden' form fields to accept numbers and booleans ([#15802](https://github.com/sveltejs/kit/pull/15802)) - feat: warn on unread `form` remote function validation issues ([#15653](https://github.com/sveltejs/kit/pull/15653)) ### Patch Changes - fix: abort navigation after async rendering if obsolete ([#15811](https://github.com/sveltejs/kit/pull/15811)) - fix: skip refreshing queries on full-page reload form submissions ([#15803](https://github.com/sveltejs/kit/pull/15803)) ## 2.59.1 ### Patch Changes - fix: resolve paths to route files with the letter drive on Windows ([#15793](https://github.com/sveltejs/kit/pull/15793)) ## 2.59.0 ### Minor Changes - feat: support `query.batch` in `requested(...)` ([#15751](https://github.com/sveltejs/kit/pull/15751)) - breaking: on the server, make the promise returned from `refresh` represent adding the refresh to the map, not the time it takes to run the remote function ([#15705](https://github.com/sveltejs/kit/pull/15705)) - feat: experimental `query.live` function ([#15705](https://github.com/sveltejs/kit/pull/15705)) ### Patch Changes - fix: unwrap `Promise` in `RemoteCommand` output type ([#15771](https://github.com/sveltejs/kit/pull/15771)) - fix: empty call to `.updates()` on a command/form invocation means "don't update anything" ([#15705](https://github.com/sveltejs/kit/pull/15705)) - fix: `form.fields.foo.as('checkbox', default_value)` now works ([#15752](https://github.com/sveltejs/kit/pull/15752)) - fix: remote forms with default values defined by `field.as('text', defaultValue)` now correctly reset to the provided default values once submitted ([#15753](https://github.com/sveltejs/kit/pull/15753)) - fix: make sure queries always get started correctly ([#15705](https://github.com/sveltejs/kit/pull/15705)) - fix: allow plain functions as overrides in `updates` ([#15705](https://github.com/sveltejs/kit/pull/15705)) ## 2.58.0 ### Minor Changes - breaking: require `limit` in `requested` (as originally intended) ([#15739](https://github.com/sveltejs/kit/pull/15739)) - feat: `RemoteQueryFunction` gains an optional third generic parameter `Validated` (defaulting to `Input`) that represents the argument type after schema validation/transformation ([#15739](https://github.com/sveltejs/kit/pull/15739)) - breaking: `requested` now yields `{ arg, query }` entries instead of the validated argument ([#15739](https://github.com/sveltejs/kit/pull/15739)) ### Patch Changes - fix: allow `query().current`, `.error`, `.loading`, and `.ready` to work in non-reactive contexts ([#15699](https://github.com/sveltejs/kit/pull/15699)) - fix: prevent `deep_set` crash on nullish nested values ([#15600](https://github.com/sveltejs/kit/pull/15600)) - fix: restore correct `RemoteFormFields` typing for nullable array fields (e.g. when a schema uses `.default([])`), so `.as('checkbox')` and friends work again ([#15723](https://github.com/sveltejs/kit/pull/15723)) - fix: don't warn about removed SSI comments in `transformPageChunk` ([#15695](https://github.com/sveltejs/kit/pull/15695)) Server-side include (SSI) directives like `` are HTML comments that are replaced by servers such as nginx. Previously, removing them in `transformPageChunk` would trigger a false positive warning about breaking Svelte's hydration. Since SSI comments always start with `