feat: split edge functions - #17045
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/524d615a24f1608958c6b7ddf07bae1b5bf9c633Open in |
🦋 Changeset detectedLatest commit: 524d615 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
…caping or encoding' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: QUIET Plan: Advanced Run ID: 📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe Netlify adapter now supports combined Merge Risk: 🟡 Moderate · up to Split edge deployments with colliding optional-parameter route names can serve the wrong route handler because one generated function overwrites another. This should be resolved before merge. 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟡 Other comments (1)
.github/workflows/platform-tests-netlify.yml-146-149 (1)
146-149: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winGate the generated-file assertion for serverless builds.
The deploy step sets
EDGE=true, so the adapter writes functions to.netlify/v1/edge-functions. The sharedsplit generates multiple function filestest reads.netlify/v1/functionsand fails withENOENT. SetEDGE: trueontest-split-edgeso the Playwright step can skip this serverless-only assertion. Keep the--functions=".netlify/v1/functions"option; Netlify CLI accepts a missing functions folder and still deploys edge functions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: QUIET
Plan: Advanced
Run ID: 50df0117-2774-4a0b-8849-575c9d026723
📒 Files selected for processing (11)
.changeset/petite-sites-enter.md.github/actions/netlify-deploy/action.yml.github/workflows/platform-tests-netlify.ymldocumentation/docs/25-build-and-deploy/80-adapter-netlify.mdpackages/adapter-netlify/files/edge.jspackages/adapter-netlify/files/serverless.jspackages/adapter-netlify/files/tsconfig.jsonpackages/adapter-netlify/index.d.tspackages/adapter-netlify/index.jspackages/adapter-netlify/internal.d.tspackages/adapter-netlify/test/apps/split/vite.config.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
sveltejs/vite-plugin-svelte(manual)vitejs/vite(manual)sveltejs/svelte(manual)
💤 Files with no reviewable changes (3)
- packages/adapter-netlify/internal.d.ts
- documentation/docs/25-build-and-deploy/80-adapter-netlify.md
- packages/adapter-netlify/index.d.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| * @typedef {{ | ||
| * build?: { publish?: string } | ||
| * functions?: { node_bundler?: 'zisi' | 'esbuild' } | ||
| * } & TomlTable} NetlifyConfig |
There was a problem hiding this comment.
We don't use this type anywhere so I removed it
| read: async (file) => { | ||
| const url = `${origin}/${file}`; | ||
| const response = await fetch(url); | ||
| const initialized = server.init({ |
There was a problem hiding this comment.
wrapped the logic of this file so that it's similar to the files/serverless.js one where we export a higher order function
| else | ||
| echo "::error::Netlify deployment failed" | ||
| echo "$deploy_json" >&2 | ||
| exit 1 |
There was a problem hiding this comment.
Helps error when deployment fails rather than silently passing
| ); | ||
| }); | ||
|
|
||
| // always strip __pathname query parameter as it's reserved for split function reroutes |
There was a problem hiding this comment.
need to manually verify this
This PR removes the arbitrary limitation where Netlify edge functions cannot be split.
Note: the Netlify split edge CI job won't run until it's in the
mainbranch #17052Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits