next.js
2f8319b5 - Run Middleware within WorkStore (#70808)

Commit
1 year ago
Run Middleware within WorkStore (#70808) The data structure inside WorkStore (formerly StaticGenerationStore) is a mess with a bunch of options (what hidden class?). It's also there to support Route Handlers, App Router Pages and Actions. It should probably be a more specific disjoint union for each use case rather than just optional fields. We could have a separate kind of store for Middleware but it seems like we're going towards Middleware becoming something with same semantics as an App Route Handler. For example, we already support `cookies()`, `headers()`, `after()`, `revalidate` etc. That's why it already has a RequestStore. This becomes a requirement for [moving `AfterContext` context to `WorkStore`](https://github.com/vercel/next.js/pull/70806).
Author
Parents
Loading