Skip to content

Lazy dynamic imports for ssr - #98836

Merged
jimmyhmiller merged 9 commits into
canaryfrom
jimmym/lazy-dynamic-imports-ssr-v2
Sep 28, 2026
Merged

jimmyhmiller merged 9 commits into
canaryfrom
jimmym/lazy-dynamic-imports-ssr-v2

Conversation

@jimmyhmiller

@jimmyhmiller jimmyhmiller commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Enables lazy imports for ssr. #97305 This was the old Pr for this. Tried to incorporate the feedback there. The changes here were from testing on v0/chat

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: d49614c

Comment thread crates/next-api/src/project.rs Outdated
Comment thread crates/next-core/src/next_server/context.rs Outdated
Comment thread packages/next/src/server/dev/hot-reloader-turbopack.ts
@jimmyhmiller
jimmyhmiller force-pushed the jimmym/lazy-dynamic-imports-ssr-v2 branch from 80ed85b to 5cb75a7 Compare September 22, 2026 18:51
hash_salt,
style_groups_algorithm,
per_page_module_graph,
lazy_dynamic_imports: _,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you ignoring it here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just keeping scope constrained. I will go and revisit these if they make sense to also be lazy. Basically just not trying to tackle too much all at once.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright. I'd just add todo comments with that workflow. you might end up forgetting something

@jimmyhmiller
jimmyhmiller force-pushed the jimmym/lazy-dynamic-imports-ssr-v2 branch from 5cb75a7 to 6d8f43c Compare September 23, 2026 14:48
Introduce the development-only `turbopackLazyDynamicImportsSSR` flag
and allow the Node runtime to ensure uncached chunks on demand.
Install the on-demand loader only when its host hook is present,
leaving the normal development runtime path unchanged otherwise.
Track server chunk ownership and rebuild owning entries before the Node
runtime loads a chunk activated by `turbopackLazyDynamicImportsSSR`.
Enable manifest-backed lazy compilation for the Node.js App SSR context
behind `turbopackLazyDynamicImportsSSR`.

Cover activation, recompilation, and concurrent renders.
Use the review-suggested comment to connect the host hook to
`EcmascriptOptionsContext.lazy_compilation`.
Regenerate the Node runtime source map after rebasing onto canary.
@jimmyhmiller
jimmyhmiller force-pushed the jimmym/lazy-dynamic-imports-ssr-v2 branch from 6d8f43c to 7272e47 Compare September 23, 2026 16:23
Refresh reference manifests when lazy chunks activate.
Track activated RSC chunks for server HMR.
@jimmyhmiller
jimmyhmiller enabled auto-merge (squash) September 25, 2026 18:51
@jimmyhmiller
jimmyhmiller merged commit 72003a7 into canary Sep 28, 2026
220 of 222 checks passed
@jimmyhmiller
jimmyhmiller deleted the jimmym/lazy-dynamic-imports-ssr-v2 branch September 28, 2026 14:37
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants