Vercel middleware simplification#7466
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
lilnasy
commented
Mar 18, 2024
|
|
||
| * The Vercel Edge middleware will always be the **first** function to receive the `Request` and the last function to receive `Response`. This an architectural constraint that follows the [boundaries set by Vercel](https://vercel.com/docs/concepts/functions/edge-middleware). | ||
| * Only `request` and `context` may be used to produce an `Astro.locals` object. Operations like redirects, etc. should be delegated to Astro middleware. | ||
| * `Astro.locals` **must be serializable**. Failing to do so will result in a **runtime error**. This means that you **cannot** store complex types like `Map`, `function`, `Set`, etc. |
Contributor
Author
There was a problem hiding this comment.
This is the one bit of information that remains relevant - the locals added by the user will need to be JSON serializable. I think we communicate this adequately in the section above.
sarah11918
approved these changes
Mar 18, 2024
Member
sarah11918
left a comment
There was a problem hiding this comment.
Hard not to approve removing stuff! Thank you for your service, outdated info. 🫡
Thanks @lilnasy !
ematipico
reviewed
Mar 18, 2024
Member
ematipico
left a comment
There was a problem hiding this comment.
We need to explain to the users how to type Astro.locals.waitUntil
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.
Description (required)
Related issues & labels (optional)