next.js
4b1a0165 - Simplify Flight manifest plugin (#51589)

Commit
2 years ago
Simplify Flight manifest plugin (#51589) Instead of traversing the entire client module graph twice (!), this PR changes it to only traverse the client **entry** modules only. Because of the way we create client entries, all client modules' _boundaries_ can be retrieved via all outgoing connections of all chunks' entry modules, filtered by `next-flight-client-entry-loader`. This brings down the time complexity from `2 * num_client_modules` to `num_client_entry_modules`. Closes #51240. Additional notes from @timneutkens - Removed `module.unsafeCache` as it seemed to be leaking modules across multiple compilations, this should help with memory usage - Changed entry-loader to have consistent module import map (sort it) to ensure cache key is consistent --------- Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Author
Parents
Loading