-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add included metadata to chunks to allow deduplicate chunk loads at runtime #4488
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Ignored Deployments
|
✅ This changes can build |
🟢 CI successful 🟢Thanks |
de335d5
to
f9a7f48
Compare
f9a7f48
to
648c966
Compare
648c966
to
07f317d
Compare
196e654
to
fd44600
Compare
fd44600
to
cd83130
Compare
cd83130
to
ebf8ab8
Compare
ebf8ab8
to
6d3aae4
Compare
Benchmark for 0ba9742Click to view benchmark
|
Benchmark for b245f99Click to view benchmark
|
loadChunk( | ||
typeof otherChunkData === "string" | ||
? otherChunkData | ||
: otherChunkData.path, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a function getChunkPath(chunkData)
, we do this very often.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only used once in this file
Benchmark for db28da1Click to view benchmark
|
Benchmark for 729bc00Click to view benchmark
|
### What? * fix app dir chunking * fix app dir 404s * improve app dir performance * rerender shadowportal on errors to re-add nextjs-portal to avoid empty page * inject polyfills before user code * fix manifest generation see also vercel/turbo#4488 ### Why? App dir was very slow and lead to 404 errors ### How? add included metadata to chunks to allow deduplicate chunk loads at runtime
### Description follow up changes from #4488
…untime (vercel#4488) ### Description Chunk loading is now more than just a single chunk filepath. It might consist of additional metadata which tells the chunk loading logic the entry modules included in this chunk. This allows the runtime logic to avoid loading chunks when all entry modules are already loaded. This means loading the same chunk from multiple sources (with different available modules) will only trigger a single load and so avoids transferring more code than needed. This is especially relevant in app dir where every client component is considers as separate chunk loading. next.js: vercel/next.js#48025
### Description follow up changes from vercel#4488
Description
Chunk loading is now more than just a single chunk filepath. It might consist of additional metadata which tells the chunk loading logic the entry modules included in this chunk. This allows the runtime logic to avoid loading chunks when all entry modules are already loaded.
This means loading the same chunk from multiple sources (with different available modules) will only trigger a single load and so avoids transferring more code than needed.
This is especially relevant in app dir where every client component is considers as separate chunk loading.
next.js: vercel/next.js#48025