Repository navigation
fix: run reroute in a middleware function before split functions
#16590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
0745c8f
add reroute adapter primitives in kit
teemingc 7b61281
add fix and test for netlify
teemingc da5a2bc
add kit changeset
teemingc cecfbef
Merge branch 'version-3' into fix-split-reroute
teemingc aebb49a
add adapter changeset
teemingc cca9daf
vercel fix?
teemingc 70b1398
reserved func name
teemingc 51ecad1
dry
teemingc 2c6920e
Update respond.js
teemingc 3ec93b8
default to false
teemingc 976b003
avoid changing url
teemingc 87cbbad
Merge branch 'version-3' into fix-split-reroute
teemingc 44e9b3a
add split test app
teemingc 98a197b
make basic test specific to split app
teemingc 0110bc5
revert
teemingc 9cadb34
Update package.json
teemingc 85afce7
Merge branch 'chore-vercel-split-test' into fix-split-reroute
teemingc 859bced
Apply suggestion from @teemingc
teemingc c6c2796
move into different branch
teemingc 4269f7f
Merge branch 'chore-vercel-split-test' into fix-split-reroute
teemingc c8db289
add test
teemingc 67c938f
move
teemingc 9360e32
Merge branch 'chore-vercel-split-test' into fix-split-reroute
teemingc e8adade
Revert "Merge branch 'chore-vercel-split-test' into fix-split-reroute"
teemingc 327e87c
Merge branch 'fix-split-reroute' of https://github.com/sveltejs/kit i…
teemingc 078ac53
format
teemingc 00e0505
Merge branch 'version-3' into fix-split-reroute
teemingc eae3139
Update packages/adapter-vercel/index.js
teemingc df404ce
Apply suggestions from code review
teemingc fd3d200
Merge branch 'version-3' into fix-split-reroute
teemingc de53193
generate reroute module for middlewares
teemingc 6a70886
fix alias
teemingc 85b6068
Delete 15-@sveltejs-kit-adapter.md
teemingc bbf353f
avoid bundling otel into reroute module
teemingc 5d22322
Merge branch 'version-3' into fix-split-reroute
teemingc fa04c01
Apply suggestion from @teemingc
teemingc c82020a
Update index.js
teemingc de5a81c
avoid unnecessary prebundling
teemingc d7316b0
replace global constants used in paths file
teemingc 12cc7b7
Merge branch 'version-3' into fix-split-reroute
teemingc b375a12
ensure resolved_path is updated when url.pathname is modified
teemingc 29e21be
Update rolldown.config.js
teemingc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| '@sveltejs/adapter-netlify': major | ||
| '@sveltejs/adapter-vercel': major | ||
| --- | ||
|
|
||
| fix: run `reroute` in an edge middleware if the app has been split into multiple functions | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@sveltejs/kit': minor | ||
| --- | ||
|
|
||
| feat: add `builder.hasRerouteHook` and `builder.generateRerouteModule` helpers for running `reroute` in a middleware before the main handler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| .DS_Store | ||
| node_modules | ||
| /files | ||
| /files/serverless.js |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { applyReroute } from 'REROUTE'; | ||
|
|
||
| /** @type {import('@netlify/edge-functions').EdgeFunction} */ | ||
| export default async function middleware(request, context) { | ||
| const new_request = await applyReroute(request); | ||
|
|
||
| // Netlify rewrites can cause an endless loop because it will re-run this | ||
| // function with the rewritten URL. Therefore, we use `context.next` instead | ||
| // to specifically invoke the next function in the chain with the rewritten URL | ||
| return context.next(new_request); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using a major here to make it more noticeable that folks will have this extra middleware function deployed