next.js
771824da - Move AfterContext to WorkStore (#70806)

Commit
1 year ago
Move AfterContext to WorkStore (#70806) We want to support `after()` to run after all work has completed. Ideally in any scenario that runs the parent. If there's multiple units of work (e.g. batched Actions) or inner work like `"use cache"` / `unstable_cache`, they should ideally all run at the end to avoid blocking the other work. It's difficult to remember how to wire this up each time we shadow a unit or work. It's simpler just to put this on WorkStore which is where we already have all internal "after" like `pendingRevalidates` and `pendingRevalidateWrites`. This is dependent on having a [WorkStore in Middleware](https://github.com/vercel/next.js/pull/70808/) where we currently support `after()`. We do not support `after()` in `pages/`.
Author
Parents
Loading