Merged
Conversation
* feat: build option `splitMiddleware` * fix regression * chore: correct config validation * change name as per code suggestion
🦋 Changeset detectedLatest commit: 8d7b6fc The changes in this PR will be included in the next version bump. 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 |
Member
Author
|
!preview vercel-edge-middleware |
Contributor
|
bluwy
reviewed
Jul 4, 2023
packages/integrations/vercel/test/fixtures/middleware/astro.config.mjs
Outdated
Show resolved
Hide resolved
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
sarah11918
reviewed
Jul 5, 2023
Member
sarah11918
left a comment
There was a problem hiding this comment.
Looks pretty good @ematipico ! Left some copy edits to consider! 🙌
| export default function({ request, context }) { | ||
| // do something with request and context | ||
| return { | ||
| title: "Spider-man's blog" |
Member
There was a problem hiding this comment.
I can't believe you made me spell check this! 😂
Member
Author
There was a problem hiding this comment.
That's what you get from me when I have to write content that is not "foo", "bar" or "lorem" 🤣
sarah11918
reviewed
Jul 5, 2023
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
bluwy
approved these changes
Jul 5, 2023
Merged
matthewp
pushed a commit
that referenced
this pull request
Jul 11, 2023
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
ArmandPhilippot
added a commit
to ArmandPhilippot/astro-docs
that referenced
this pull request
Jan 29, 2025
`entryPoints` added in withastro/astro#7220 so v2.7.0 `middlewareEntryPoint` added in withastro/astro#7532 so 2.8.0
ematipico
added a commit
that referenced
this pull request
Feb 6, 2025
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
This PR adds support for vercel edge middleware via Astro middleware.
This is an opt-in feature, and the
@astrojs/vercel/serverlessadapter will automatically create the edge middleware function for you.Please refer to the readme for limitations and constraints.
To quickly opt in to the feature, you need to use the new option
build.excludeMiddlewareand - obviously - have a middleware file in your code base:This PR should be ready to be merged to
main. I will create another preview release to test it a little bit, although I tested it locally, and the feature works as intended. There might be some edge cases that I didn't take into consideration.Testing
Test cases were added along the way.
Docs
@withastro/maintainers-docs It's now time for your help to review the changes :) There are a bunch of changesets because a few stuff were added.