Skip to content

Revert "Enable lazy dynamic imports by default in development (#101873)" - #102379

Merged
jimmyhmiller merged 1 commit into
canaryfrom
jimmym/revert-lazy-dynamic-imports-default
Nov 25, 2026
Merged

jimmyhmiller merged 1 commit into
canaryfrom
jimmym/revert-lazy-dynamic-imports-default

Conversation

@jimmyhmiller

Copy link
Copy Markdown
Contributor

Summary

Reverts #101873, which was merged before it was ready. experimental.turbopackLazyDynamicImports and experimental.turbopackLazyDynamicImportsSSR go back to being off by default in development, and the related docs and test expectations are restored.

The bugfixes from #101937 are kept. This only reverts the default change.

Verification

  • Clean git revert of 59490df
  • Not run: local tests (relying on CI)

(#101873)"

This reverts commit 59490df.

The bugfixes from #101937 are kept; only the default change and
its test expectations are reverted.
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: cd0c224
View workflow run

@github-actions github-actions Bot added Documentation Related to Next.js' official documentation. tests Turbopack Related to Turbopack with Next.js. type: next labels Nov 25, 2026
@jimmyhmiller
jimmyhmiller marked this pull request as ready for review November 25, 2026 18:15
@jimmyhmiller
jimmyhmiller requested a review from a team November 25, 2026 18:15
@vercel
vercel Bot requested review from mischnic and sokra November 25, 2026 18:17
@vercel

vercel Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Vercel Agent Verified Review finished reviewing your changes and found no issues.
cd0c224 • Wed, 25 Nov 2026 18:17:08 GMT • 55.4s • Report • Details

Important

Needs a person: this repository’s review rules call for a person’s review.

Why?

This is a clean revert of a default flip, and I found no correctness problems: the Rust default, the JS default, the docs and the test expectations all agree on false. The author is on the team (`authorIsTeamMember`). The diff is small: 10 implementation lines. But the config-and-flags rubric calls any default change in config-shared.ts a strong, public escalation, and the turbopack-next-integration rubric flags translation changes in next_config.rs as medium. The default of an experimental config option is a public behavior under REVIEW.md's definitions, and the author doesn't own either area.

  • Trigger: Changes or additions to public APIs or behaviors (config-shared.ts:2650). The rubric says 'Any default change in config-shared.ts (strong, public)'. This PR removes the `true` defaults for turbopackLazyDynamicImports and turbopackLazyDynamicImportsSSR from defaultConfig.
  • Trigger: changes to next_import_map.rs or next_config.rs translation (next_config.rs:2807). The `unwrap_or` fallbacks for both flags change from true to false.

Review requested from: mischnic, sokra.

Facts from the base’s scripts/review-context.mjs: areas: config-and-flags, turbopack-next-integration, docs, dev-server-and-hmr · authorIsTeamMember: true · implementationLines: 10 · totalLines: 43

Summary

Reverts #101873: experimental.turbopackLazyDynamicImports and turbopackLazyDynamicImportsSSR go back to off by default in next dev. The change covers the Rust fallback in next_config.rs, the JS defaultConfig and its JSDoc, the docs, and two test expectations. The bugfixes from #101937 stay in.

Questions for the author (1)

  • v16.5.0-canary.65 shipped with lazy dynamic imports on by default. Should the release notes say the default went back to off, so canary users who saw the new behavior aren't surprised?
Checked (4)

     Check Location
Holds The Rust defaults for both flags are back to false, and only development mode can enable them.
Read both accessors: next_mode.is_development() && ...unwrap_or(false).
next_config.rs:2801
Holds Every file #101873 touched is byte-identical to its pre-#101873 state, so this is a clean revert.
git diff 59490df^ HEAD over the seven files #101873 changed shows nothing. None of those files changed in the commits between 59490df and the base.
config-shared.ts:1138
Holds The JS side matches the Rust default: with the keys gone from defaultConfig, the hot reloader reads undefined, which is falsy.
Read where the hot reloader reads nextConfig.experimental.turbopackLazyDynamicImports(SSR). Its gates at lines 1575 and 2442 are truthiness checks.
hot-reloader-turbopack.ts:400
Holds Tests that depend on lazy imports still turn the flags on explicitly, so they keep exercising the feature.
Grepped the tests. The lazy-dynamic-imports, lazy-dynamic-nested-imports, lazy-dynamic-chunk-list-collision and webpack-loader-import-module fixtures all set the flags to true.
next.config.js:7
Review steps

     Step Time
Sandbox set up 16.3s
Repository rules read: REVIEW.md and AGENTS.md files (5)
Agent review: 0 of 7 changed files opened, 1 command run 36.7s
Repros run on the head and the base (0), findings graded (0) 2.4s

Read the full report ↗ (Download report.json • report.md)

@jimmyhmiller
jimmyhmiller merged commit 69ddf91 into canary Nov 25, 2026
127 checks passed
@jimmyhmiller
jimmyhmiller deleted the jimmym/revert-lazy-dynamic-imports-default branch November 25, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Related to Next.js' official documentation. tests Turbopack Related to Turbopack with Next.js. type: next

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants