next.js
03ff785c - Read page name from work store in server module map proxy (#71669)

Commit
1 year ago
Read page name from work store in server module map proxy (#71669) This avoids a race condition when running `next build` where the manifest singleton might be overwritten with the next page's manifest while the previous page is still being rendered. With this PR, we are not storing a page-specific singleton but the whole manifest, and only when accessing an entry is the page read from the work store, and thus scoped to the current page. An exception is when a server module map is needed during module evaluation when no work store is provided, e.g. to create a server action using a higher-order function. In this case it should be safe to return any entry from the manifest that matches the action ID. They all refer to the same module ID, which must also exist in the current page bundle. (This is currently not guaranteed in Turbopack, and needs to be fixed.)
Author
Parents
Loading