-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
deprecation(vercel): vercel-edge-middleware.js file #10476
deprecation(vercel): vercel-edge-middleware.js file #10476
Conversation
🦋 Changeset detectedLatest commit: 94f9d79 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 |
c1ad0d7
to
94f9d79
Compare
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.
🎵 I'm on the edge. CDN. And I'm deprecating functions with you 🎵
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.
A couple of things. The first one (the important one) is that we must expose the types to the users to augment the Astro.locals
types.
The second one (less important), is that Netlify and Cloudflare adapters have using their named object e.g. Astro.locals.netlify
. It would be nice if we could align it, but it's nice to have.
@ematipico addressed |
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.
Thank you! I left a comment (now outdated) in the docs PR too.
@ematipico Added docs for typing here: withastro/docs#7485 |
Changes
vercel-edge-middleware.js
file allowed users to access the vercel edge runtime'sRequestContext
object, and create the middlewarelocals
from its fields. However, this object includes only one field - thewaitUntil()
function - which is now available directly asctx.locals.waitUntil()
.console.log(context)
Testing
Docs