Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sveltejs/kit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @sveltejs/adapter-cloudflare@5.0.2
Choose a base ref
...
head repository: sveltejs/kit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @sveltejs/adapter-cloudflare@5.0.3
Choose a head ref
  • 17 commits
  • 43 files changed
  • 10 contributors

Commits on Feb 3, 2025

  1. fix: correct edge function path for route resolution endpoint (#13409)

    * fix: correct edge function path for route resolution endpoint
    
    Went missing during a refactoring in #13383
    
    * Update packages/adapter-vercel/index.js
    
    ---------
    
    Co-authored-by: Tee Ming <chewteeming01@gmail.com>
    dummdidumm and eltigerchino authored Feb 3, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    858d6b2 View commit details
  2. Version Packages (#13410)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Feb 3, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2c6e8dc View commit details
  3. fix: make route resolution imports root-relative if path.relative o…

    …ption is `false` (#13412)
    
    It is necessary to adhere to this setting because rewrites that SvelteKit cannot see may otherwise lead to incorrect relative paths.
    
    Example:
    - route resolution request to _app/route.js
    - rewrite to _app/route/foo.js
    - SvelteKit only sees the later, returning a relative `import('../immutable/...`) which is wrong, because the actual relative path would be `import('./immutable/...)`
    dummdidumm authored Feb 3, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c3f918e View commit details
  4. Version Packages (#13413)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Feb 3, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    461aa95 View commit details

Commits on Feb 4, 2025

  1. fix: make <build> route exclusion rule only exclude static assets (#…

    …13411)
    
    * make `<build>` route exclusion rule only exclude static assets
    
    * Update .changeset/chilled-timers-give.md
    
    ---------
    
    Co-authored-by: Tee Ming <chewteeming01@gmail.com>
    Begad666 and eltigerchino authored Feb 4, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a09db8c View commit details

Commits on Feb 6, 2025

  1. fix: form action submit function callback return type (#13420)

    * fix: add promise return type to enhance form action callback
    
    * remove unnecessary formatting change
    
    * fix: Dangling promise is now awaited
    
    * reapply fix
    
    ---------
    
    Co-authored-by: S. Elliott Johnson <sejohnson@torchcloudconsulting.com>

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    9612a60 View commit details
  2. chore: Add @typescript-eslint/no-floating-promises (#13426)

    * chore: Add `@typescript-eslint/no-floating-promises`
    
    * Update packages/kit/src/core/postbuild/queue.spec.js
    
    Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
    
    ---------
    
    Co-authored-by: Rich Harris <richard.a.harris@gmail.com>

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b835c63 View commit details

Commits on Feb 8, 2025

  1. chore(deps): update dependency vitest to v3.0.5 [security] (#13418)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 8, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a788594 View commit details
  2. chore(deps): update all non-major dependencies (#13404)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 8, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    776ef06 View commit details

Commits on Feb 10, 2025

  1. chore: allow running pnpm 10 (#13442)

    benmccann authored Feb 10, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3bab7e3 View commit details

Commits on Feb 12, 2025

  1. chore: pnpm 10 compatibility (#13451)

    benmccann authored Feb 12, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8a77265 View commit details
  2. chore(deps): update pnpm to v10 (#13414)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 12, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3b2caa1 View commit details
  3. docs: improve FAQ navbar (#13450)

    * docs: improve FAQ navbar
    
    * chore: Fix build errors, probably
    
    ---------
    
    Co-authored-by: S. Elliott Johnson <sejohnson@torchcloudconsulting.com>

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1997c0d View commit details

Commits on Feb 13, 2025

  1. docs: add some tips for setting up icons (#13459)

    benmccann authored Feb 13, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    9719e1e View commit details
  2. fix: change server-side route resolution endpoint (#13461)

    Instead of doing route resolution requests through `_app/route/...`, do it through `<pathname>/__route.js`:
    - more consistent with what we do for `/__data.json` requests already
    - avoids problems with cookies: If you set a cookie on `/foo`, we would need to add it to `_app/route/foo` aswell, if we didn't change this
    dummdidumm authored Feb 13, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3d88ae3 View commit details

Commits on Feb 14, 2025

  1. chore(deps): update pnpm to v10.4.0 (#13463)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 14, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    633b05e View commit details
  2. Version Packages (#13417)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Feb 14, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    133a671 View commit details
Showing with 235 additions and 177 deletions.
  1. +1 −1 .github/workflows/audit.yml
  2. +6 −6 .github/workflows/ci.yml
  3. +1 −1 .github/workflows/release.yml
  4. +1 −1 documentation/docs/25-build-and-deploy/70-adapter-cloudflare-workers.md
  5. +6 −0 documentation/docs/40-best-practices/07-images.md
  6. +9 −9 documentation/docs/60-appendix/10-faq.md
  7. +1 −1 documentation/docs/60-appendix/20-integrations.md
  8. +2 −1 eslint.config.js
  9. +4 −4 package.json
  10. +9 −0 packages/adapter-cloudflare/CHANGELOG.md
  11. +1 −1 packages/adapter-cloudflare/index.js
  12. +1 −1 packages/adapter-cloudflare/package.json
  13. +2 −2 packages/adapter-node/src/handler.js
  14. +15 −0 packages/adapter-vercel/CHANGELOG.md
  15. +4 −4 packages/adapter-vercel/index.js
  16. +1 −1 packages/adapter-vercel/package.json
  17. +15 −0 packages/kit/CHANGELOG.md
  18. +1 −1 packages/kit/package.json
  19. +5 −5 packages/kit/src/core/postbuild/prerender.js
  20. +2 −1 packages/kit/src/core/postbuild/queue.js
  21. +1 −1 packages/kit/src/core/postbuild/queue.spec.js
  22. +3 −3 packages/kit/src/exports/node/index.js
  23. +1 −1 packages/kit/src/exports/public.d.ts
  24. +6 −6 packages/kit/src/exports/vite/dev/index.js
  25. +1 −1 packages/kit/src/exports/vite/preview/index.js
  26. +2 −2 packages/kit/src/runtime/app/forms.js
  27. +1 −1 packages/kit/src/runtime/client/bundle.js
  28. +18 −18 packages/kit/src/runtime/client/client.js
  29. +1 −1 packages/kit/src/runtime/client/fetcher.js
  30. +7 −12 packages/kit/src/runtime/pathname.js
  31. +3 −3 packages/kit/src/runtime/server/page/render.js
  32. +5 −1 packages/kit/src/runtime/server/page/server_routing.js
  33. +4 −4 packages/kit/src/runtime/server/respond.js
  34. +1 −1 packages/kit/src/types/internal.d.ts
  35. +3 −3 packages/kit/src/utils/streaming.spec.js
  36. +1 −1 packages/kit/src/version.js
  37. +3 −1 packages/kit/test/apps/basics/src/routes/actions/enhance/+page.svelte
  38. +1 −1 packages/kit/test/apps/basics/test/client.test.js
  39. +1 −1 packages/kit/test/apps/basics/test/cross-platform/client.test.js
  40. +1 −1 packages/kit/test/utils.js
  41. +1 −1 packages/kit/types/index.d.ts
  42. +1 −1 packages/package/test/index.js
  43. +82 −72 pnpm-lock.yaml
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4.0.0
- uses: pnpm/action-setup@v4.1.0
- uses: actions/setup-node@v4
with:
node-version: '22.x'
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4.0.0
- uses: pnpm/action-setup@v4.1.0
- uses: actions/setup-node@v4
with:
node-version: 22
@@ -35,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4.0.0
- uses: pnpm/action-setup@v4.1.0
- uses: actions/setup-node@v4
with:
node-version: 22
@@ -65,7 +65,7 @@ jobs:
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4.0.0
- uses: pnpm/action-setup@v4.1.0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
@@ -123,7 +123,7 @@ jobs:
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4.0.0
- uses: pnpm/action-setup@v4.1.0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
@@ -157,7 +157,7 @@ jobs:
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4.0.0
- uses: pnpm/action-setup@v4.1.0
- uses: actions/setup-node@v4
with:
node-version: 22
@@ -183,7 +183,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4.0.0
- uses: pnpm/action-setup@v4.1.0
- uses: actions/setup-node@v4
with:
node-version: 18
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ jobs:
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: pnpm/action-setup@v4.0.0
- uses: pnpm/action-setup@v4.1.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
Original file line number Diff line number Diff line change
@@ -133,7 +133,7 @@ For testing the build, you should use [wrangler](https://developers.cloudflare.c

### Worker size limits

When deploying to workers, the server generated by SvelteKit is bundled into a single file. Wrangler will fail to publish your worker if it exceeds [the size limits](https://developers.cloudflare.com/workers/platform/limits/#worker-size) after minification. You're unlikely to hit this limit usually, but some large libraries can cause this to happen. In that case, you can try to reduce the size of your worker by only importing such libraries on the client side. See [the FAQ](./faq#How-do-I-use-X-with-SvelteKit-How-do-I-use-a-client-side-only-library-that-depends-on-document-or-window) for more information.
When deploying to workers, the server generated by SvelteKit is bundled into a single file. Wrangler will fail to publish your worker if it exceeds [the size limits](https://developers.cloudflare.com/workers/platform/limits/#worker-size) after minification. You're unlikely to hit this limit usually, but some large libraries can cause this to happen. In that case, you can try to reduce the size of your worker by only importing such libraries on the client side. See [the FAQ](./faq#How-do-I-use-a-client-side-library-accessing-document-or-window) for more information.

### Accessing the file system

6 changes: 6 additions & 0 deletions documentation/docs/40-best-practices/07-images.md
Original file line number Diff line number Diff line change
@@ -152,6 +152,12 @@ Using a content delivery network (CDN) can allow you to optimize these images dy

CDNs can generally be used without any need for a library. However, there are a number of libraries with Svelte support that make it easier. [`@unpic/svelte`](https://unpic.pics/img/svelte/) is a CDN-agnostic library with support for a large number of providers. You may also find that specific CDNs like [Cloudinary](https://svelte.cloudinary.dev/) have Svelte support. Finally, some content management systems (CMS) which support Svelte (such as [Contentful](https://www.contentful.com/sveltekit-starter-guide/), [Storyblok](https://github.com/storyblok/storyblok-svelte), and [Contentstack](https://www.contentstack.com/docs/developers/sample-apps/build-a-starter-website-with-sveltekit-and-contentstack)) have built-in support for image handling.

## Icons

A great way to use icons is to define them purely in CSS. Iconify offers a huge set of icons [available via CSS](https://iconify.design/docs/usage/css/).

For icons defined in `.svelte` files, it is recommended to avoid libraries that provide a `.svelte` file per icon. These libraries can have thousands of `.svelte` files which really slow down Vite's dependency optimization. This can become especially pathological if the icons are imported both via an umbrella import and subpath import [as described in the `vite-plugin-svelte` FAQ](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#what-is-going-on-with-vite-and-pre-bundling-dependencies).

## Best practices

- For each image type, use the appropriate solution from those discussed above. You can mix and match all three solutions in one project. For example, you may use Vite's built-in handling to provide images for `<meta>` tags, display images on your homepage with `@sveltejs/enhanced-img`, and display user-submitted content with a dynamic approach.
18 changes: 9 additions & 9 deletions documentation/docs/60-appendix/10-faq.md
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ Libraries work best in the browser with Vite when they distribute an ESM version
If you are still encountering issues we recommend searching both [the Vite issue tracker](https://github.com/vitejs/vite/issues) and the issue tracker of the library in question. Sometimes issues can be worked around by fiddling with the [`optimizeDeps`](https://vitejs.dev/config/#dep-optimization-options) or [`ssr`](https://vitejs.dev/config/#ssr-options) config values though we recommend this as only a short-term workaround in favor of fixing the library in question.
## How do I use the view transitions API with SvelteKit?
## How do I use the view transitions API?
While SvelteKit does not have any specific integration with [view transitions](https://developer.chrome.com/docs/web-platform/view-transitions/), you can call `document.startViewTransition` in [`onNavigate`]($app-navigation#onNavigate) to trigger a view transition on every client-side navigation.
@@ -81,15 +81,13 @@ onNavigate((navigation) => {
For more, see ["Unlocking view transitions"](/blog/view-transitions) on the Svelte blog.
## How do I use X with SvelteKit?
Make sure you've read the [documentation section on integrations](./integrations). If you're still having trouble, solutions to common issues are listed below.
### How do I setup a database?
## How do I set up a database?
Put the code to query your database in a [server route](./routing#server) - don't query the database in .svelte files. You can create a `db.js` or similar that sets up a connection immediately and makes the client accessible throughout the app as a singleton. You can execute any one-time setup code in `hooks.server.js` and import your database helpers into any endpoint that needs them.
### How do I use a client-side only library that depends on `document` or `window`?
You can use [the Svelte CLI](/docs/cli/overview) to automatically set up database integrations.
## How do I use a client-side library accessing `document` or `window`?
If you need access to the `document` or `window` variables or otherwise need code to run only on the client-side you can wrap it in a `browser` check:
@@ -157,7 +155,7 @@ Finally, you may also consider using an `{#await}` block:
{/await}
```
### How do I use a different backend API server?
## How do I use a different backend API server?
You can use [`event.fetch`](./load#Making-fetch-requests) to request data from an external API server, but be aware that you would need to deal with [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), which will result in complications such as generally requiring requests to be preflighted resulting in higher latency. Requests to a separate subdomain may also increase latency due to an additional DNS lookup, TLS setup, etc. If you wish to use this method, you may find [`handleFetch`](./hooks#Server-hooks-handleFetch) helpful.
@@ -175,7 +173,7 @@ export function GET({ params, url }) {
(Note that you may also need to proxy `POST`/`PATCH` etc requests, and forward `request.headers`, depending on your needs.)
### How do I use middleware?
## How do I use middleware?
`adapter-node` builds a middleware that you can use with your own server for production mode. In dev, you can add middleware to Vite by using a Vite plugin. For example:
@@ -209,6 +207,8 @@ export default config;
See [Vite's `configureServer` docs](https://vitejs.dev/guide/api-plugin.html#configureserver) for more details including how to control ordering.
## How do I use Yarn?
### Does it work with Yarn 2?
Sort of. The Plug'n'Play feature, aka 'pnp', is broken (it deviates from the Node module resolution algorithm, and [doesn't yet work with native JavaScript modules](https://github.com/yarnpkg/berry/issues/638) which SvelteKit — along with an [increasing number of packages](https://blog.sindresorhus.com/get-ready-for-esm-aa53530b3f77) — uses). You can use `nodeLinker: 'node-modules'` in your [`.yarnrc.yml`](https://yarnpkg.com/configuration/yarnrc#nodeLinker) file to disable pnp, but it's probably easier to just use npm or [pnpm](https://pnpm.io/), which is similarly fast and efficient but without the compatibility headaches.
2 changes: 1 addition & 1 deletion documentation/docs/60-appendix/20-integrations.md
Original file line number Diff line number Diff line change
@@ -49,4 +49,4 @@ Since SvelteKit projects are built with Vite, you can use Vite plugins to enhanc

## Integration FAQs

The SvelteKit FAQ has a [how to do X with SvelteKit](./faq#How-do-I-use-X-with-SvelteKit), which may be helpful if you still have questions.
The SvelteKit FAQ has a [how to do X with SvelteKit](./faq#How-do-I-set-up-a-database), which may be helpful if you still have questions.
3 changes: 2 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -26,7 +26,8 @@ export default [
rules: {
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/require-await': 'error'
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/no-floating-promises': 'error',
},
ignores: [
'packages/adapter-node/rollup.config.js',
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@
"test:cross-platform:build": "pnpm run --dir packages/kit test:cross-platform:build",
"test:server-side-route-resolution:dev": "pnpm run --dir packages/kit test:server-side-route-resolution:dev",
"test:server-side-route-resolution:build": "pnpm run --dir packages/kit test:server-side-route-resolution:build",
"test:vite-ecosystem-ci": "pnpm test --dir packages/kit",
"test:others": "pnpm test -r --filter=./packages/* --filter=!./packages/kit/ --workspace-concurrency=1",
"test:vite-ecosystem-ci": "pnpm --dir packages/kit test",
"test:others": "pnpm -r --filter=./packages/* --filter=!./packages/kit/ --workspace-concurrency=1 test",
"check": "pnpm -r prepublishOnly && pnpm -r check",
"lint": "pnpm -r lint && eslint --cache --cache-location node_modules/.eslintcache 'packages/**/*.js'",
"format": "pnpm -r format",
@@ -31,8 +31,8 @@
"prettier-plugin-svelte": "^3.1.2",
"typescript-eslint": "^8.0.0"
},
"packageManager": "pnpm@9.15.4",
"packageManager": "pnpm@10.4.0",
"engines": {
"pnpm": "^9.0.0"
"pnpm": ">=9.0.0"
}
}
9 changes: 9 additions & 0 deletions packages/adapter-cloudflare/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @sveltejs/adapter-cloudflare

## 5.0.3
### Patch Changes


- fix: exclude the dynamic route `/_app/env.js` from the adapter config `routes.exclude` special value `<build>` ([#13411](https://github.com/sveltejs/kit/pull/13411))

- Updated dependencies [[`9612a60a0277aef0ab4723a0e7ed8dd03a7ffb95`](https://github.com/sveltejs/kit/commit/9612a60a0277aef0ab4723a0e7ed8dd03a7ffb95), [`3d88ae33fc14b08a1d48c2cb7315739c8cfcd9fd`](https://github.com/sveltejs/kit/commit/3d88ae33fc14b08a1d48c2cb7315739c8cfcd9fd)]:
- @sveltejs/kit@2.17.2

## 5.0.2
### Patch Changes

2 changes: 1 addition & 1 deletion packages/adapter-cloudflare/index.js
Original file line number Diff line number Diff line change
@@ -127,7 +127,7 @@ function get_routes_json(builder, assets, { include = ['/*'], exclude = ['<all>'
.flatMap((rule) => (rule === '<all>' ? ['<build>', '<files>', '<prerendered>'] : rule))
.flatMap((rule) => {
if (rule === '<build>') {
return `/${builder.getAppPath()}/*`;
return [`/${builder.getAppPath()}/immutable/*`, `/${builder.getAppPath()}/version.json`];
}

if (rule === '<files>') {
2 changes: 1 addition & 1 deletion packages/adapter-cloudflare/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sveltejs/adapter-cloudflare",
"version": "5.0.2",
"version": "5.0.3",
"description": "Adapter for building SvelteKit applications on Cloudflare Pages with Workers integration",
"keywords": [
"adapter",
4 changes: 2 additions & 2 deletions packages/adapter-node/src/handler.js
Original file line number Diff line number Diff line change
@@ -98,7 +98,7 @@ function serve_prerendered() {
if (query) location += search;
res.writeHead(308, { location }).end();
} else {
next();
void next();
}
};
}
@@ -120,7 +120,7 @@ const ssr = async (req, res) => {
return;
}

setResponse(
await setResponse(
res,
await server.respond(request, {
platform: { req },
15 changes: 15 additions & 0 deletions packages/adapter-vercel/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @sveltejs/adapter-vercel

## 5.6.2
### Patch Changes


- fix: change server-side route resolution endpoint ([#13461](https://github.com/sveltejs/kit/pull/13461))

- Updated dependencies [[`9612a60a0277aef0ab4723a0e7ed8dd03a7ffb95`](https://github.com/sveltejs/kit/commit/9612a60a0277aef0ab4723a0e7ed8dd03a7ffb95), [`3d88ae33fc14b08a1d48c2cb7315739c8cfcd9fd`](https://github.com/sveltejs/kit/commit/3d88ae33fc14b08a1d48c2cb7315739c8cfcd9fd)]:
- @sveltejs/kit@2.17.2

## 5.6.1
### Patch Changes


- fix: correct edge function path for route resolution endpoint ([#13409](https://github.com/sveltejs/kit/pull/13409))

## 5.6.0
### Minor Changes

8 changes: 4 additions & 4 deletions packages/adapter-vercel/index.js
Original file line number Diff line number Diff line change
@@ -394,9 +394,9 @@ const plugin = function (defaults = {}) {
if (builder.config.kit.router?.resolution === 'server') {
// Create a separate edge function just for server-side route resolution.
// By omitting all routes we're ensuring it's small (the routes will still be available
// to the route resolution, becaue it does not rely on the server routing manifest)
// to the route resolution, because it does not rely on the server routing manifest)
await generate_edge_function(
`${builder.config.kit.appDir}/routes`,
`${builder.config.kit.appDir}/route`,
{
external: 'external' in defaults ? defaults.external : undefined,
runtime: 'edge'
@@ -405,8 +405,8 @@ const plugin = function (defaults = {}) {
);

static_config.routes.push({
src: `${builder.config.kit.paths.base}/${builder.config.kit.appDir}/routes(\\.js|/.*)`,
dest: `${builder.config.kit.paths.base}/${builder.config.kit.appDir}/routes`
src: `${builder.config.kit.paths.base}/(|.+/)__route\\.js`,
dest: `${builder.config.kit.paths.base}/${builder.config.kit.appDir}/route`
});
}

2 changes: 1 addition & 1 deletion packages/adapter-vercel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sveltejs/adapter-vercel",
"version": "5.6.0",
"version": "5.6.2",
"description": "A SvelteKit adapter that creates a Vercel app",
"keywords": [
"adapter",
15 changes: 15 additions & 0 deletions packages/kit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @sveltejs/kit

## 2.17.2
### Patch Changes


- fix: add promise return type to the `enhance` action callback ([#13420](https://github.com/sveltejs/kit/pull/13420))


- fix: change server-side route resolution endpoint ([#13461](https://github.com/sveltejs/kit/pull/13461))

## 2.17.1
### Patch Changes


- fix: make route resolution imports root-relative if `paths.relative` option is `false` ([#13412](https://github.com/sveltejs/kit/pull/13412))

## 2.17.0
### Minor Changes

2 changes: 1 addition & 1 deletion packages/kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sveltejs/kit",
"version": "2.17.0",
"version": "2.17.2",
"description": "SvelteKit is the fastest way to build Svelte apps",
"keywords": [
"framework",
10 changes: 5 additions & 5 deletions packages/kit/src/core/postbuild/prerender.js
Original file line number Diff line number Diff line change
@@ -330,7 +330,7 @@ async function prerender({ hash, out, manifest_path, metadata, verbose, env }) {
/** @type {Set<string>} */ (expected_hashlinks.get(key)).add(decoded);
}

enqueue(decoded, decode_uri(pathname), pathname);
void enqueue(decoded, decode_uri(pathname), pathname);
}
}
}
@@ -366,7 +366,7 @@ async function prerender({ hash, out, manifest_path, metadata, verbose, env }) {
if (location) {
const resolved = resolve(encoded, location);
if (is_root_relative(resolved)) {
enqueue(decoded, decode_uri(resolved), resolved);
void enqueue(decoded, decode_uri(resolved), resolved);
}

if (!headers['x-sveltekit-normalize']) {
@@ -485,17 +485,17 @@ async function prerender({ hash, out, manifest_path, metadata, verbose, env }) {

if (processed_id.includes('[')) continue;
const path = `/${get_route_segments(processed_id).join('/')}`;
enqueue(null, config.paths.base + path);
void enqueue(null, config.paths.base + path);
}
}
} else {
enqueue(null, config.paths.base + entry);
void enqueue(null, config.paths.base + entry);
}
}

for (const { id, entries } of route_level_entries) {
for (const entry of entries) {
enqueue(null, config.paths.base + entry, undefined, id);
void enqueue(null, config.paths.base + entry, undefined, id);
}
}

3 changes: 2 additions & 1 deletion packages/kit/src/core/postbuild/queue.js
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ export function queue(concurrency) {

let current = 0;

// TODO: Whenever Node >21 is minimum supported version, we can use `Promise.withResolvers` to avoid this ceremony
/** @type {(value?: any) => void} */
let fulfil;

@@ -39,7 +40,7 @@ export function queue(concurrency) {
current += 1;
const promise = Promise.resolve(task.fn());

promise
void promise
.then(task.fulfil, (err) => {
task.reject(err);
reject(err);
2 changes: 1 addition & 1 deletion packages/kit/src/core/postbuild/queue.spec.js
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ test('starts tasks in sequence', async () => {

test('q.add fails if queue is already finished', async () => {
const q = queue(1);
q.add(() => {});
void q.add(() => {});

await q.done();
expect(() => q.add(() => {})).throws(/Cannot add tasks to a queue that has ended/);
Loading