Skip to content

Vercel middleware simplification#7466

Merged
lilnasy merged 3 commits into
mainfrom
vercel-middleware-simplification
Mar 20, 2024
Merged

Vercel middleware simplification#7466
lilnasy merged 3 commits into
mainfrom
vercel-middleware-simplification

Conversation

@lilnasy
Copy link
Copy Markdown
Contributor

@lilnasy lilnasy commented Mar 18, 2024

Description (required)

  • Removed a section that documented behavior controlled by vercel and their tools.
  • Removed another section for a deprecated feature.

Related issues & labels (optional)

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Mar 20, 2024 2:44pm
1 Ignored Deployment
Name Status Preview Updated (UTC)
docs-i18n ⬜️ Ignored (Inspect) Mar 20, 2024 2:44pm


* 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.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard not to approve removing stuff! Thank you for your service, outdated info. 🫡

Thanks @lilnasy !

@sarah11918 sarah11918 added improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)! labels Mar 18, 2024
Copy link
Copy Markdown
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to explain to the users how to type Astro.locals.waitUntil

@lilnasy lilnasy merged commit 94a78e4 into main Mar 20, 2024
@lilnasy lilnasy deleted the vercel-middleware-simplification branch March 20, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants