Skip to content

[Feature] Create a global vercel like context #540

@conico974

Description

@conico974

We should create a global request context with AsyncLocalStorage that would look like the vercel request context and would allow us to hook into next/after easily.
We already have a global.__als, but it should be on every function and should cover the middleware as well

It could also allow people to access stuff like headers or cookies even in ISR/SSG

This would also allow us to provide a @vercel/request-context for libs that rely on this to detect if next is running in serverless (This should probably be optional since it could break some lib)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions