Skip to content

feat(pack): update to next.js@16.2#2572

Merged
xusd320 merged 5 commits intonextfrom
feat/next.js-16.2
Feb 4, 2026
Merged

feat(pack): update to next.js@16.2#2572
xusd320 merged 5 commits intonextfrom
feat/next.js-16.2

Conversation

@xusd320
Copy link
Contributor

@xusd320 xusd320 commented Feb 3, 2026

This pull request includes a series of dependency updates, refactorings, and API changes across the codebase, primarily focused on improving module graph handling, updating dependencies, and simplifying interfaces for module IDs and unused references. The changes modernize how module graphs and binding usage information are managed, streamline configuration and context structures, and update several dependencies to newer versions.

Dependency updates:

  • Updated multiple dependencies in Cargo.toml, including swc_core, modularize_imports, react_remove_properties, remove_console, styled_components, styled_jsx, swc_emotion, and swc_relay. Also updated git sources for include_dir and mdxjs. [1] [2]

Module graph and binding usage refactoring:

  • Refactored the module graph construction and binding usage info retrieval in project.rs to use new APIs (from_single_graph, from_graphs, binding_usage_info, etc.), and changed how unused references are computed and returned, now using the UnusedReferences type. [1] [2] [3] [4] [5] [6] [7]

  • Updated the module_ids method to return a concrete ModuleIdStrategy instead of a boxed trait object, and adjusted related context and config structures accordingly. [1] [2] [3]

Codebase simplification and interface changes:

  • Removed the spawn_once_task method from BundlerTurboTasks, likely due to redundancy or changes in task handling.
  • Updated imports and usages to reflect new module paths and types, such as using chunk_id_strategy::ModuleIdStrategy and UnusedReferences. [1] [2] [3]

Configuration and context improvements:

  • Added new fields (content_type, query, module_type) to various config and condition structures to support more flexible configuration. [1] [2] [3]
  • Updated the file system initialization to use new_with_denied_paths_and_watched_ignored for more precise path control.

Issue handling and diagnostics:

  • Enhanced issue collection by introducing IssueFilter and using it in get_plain_issues for more flexible filtering. [1] [2]

These changes collectively improve maintainability, flexibility, and performance, particularly in how module graphs and unused references are managed throughout the build process.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @xusd320, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request modernizes the project's core dependencies and internal architecture, particularly around module graph processing and chunking contexts. The changes streamline how module IDs and unused references are managed, enhance configuration flexibility, and update the underlying SWC toolchain. These updates are foundational for future improvements in performance and maintainability.

Highlights

  • Dependency Updates: Multiple Rust dependencies have been updated to newer versions, including swc_core (from 49.0.0 to 54.0.0), modularize_imports, react_remove_properties, remove_console, styled_components, styled_jsx, swc_emotion, and swc_relay. Several new dependencies like aws-lc-rs, cesu8, combine, dragonbox_ecma, jni, rustls-platform-verifier, and webpki-root-certs have been introduced. The include_dir and mdxjs crates now point to vercel-labs git repositories.
  • Module Graph and Binding Usage Refactoring: The internal handling of module graphs has been significantly refactored. ModuleGraph::from_modules is replaced by from_single_graph and connect calls. The binding_usage_info and unused_references methods now directly access computed values, and the unused_references type has changed from OptionBindingUsageInfo to UnusedReferences for clearer representation.
  • Module ID Strategy Simplification: The module_ids method now returns a concrete Vc<ModuleIdStrategy> instead of a boxed trait object (Vc<Box<dyn ModuleIdStrategy>>), simplifying the interface and removing the DevModuleIdStrategy abstraction.
  • Configuration and Context Enhancements: New fields such as content_type, query, and module_type have been added to various configuration and condition structures, allowing for more flexible and detailed module rule definitions. File system initialization now uses DiskFileSystem::new_with_denied_paths_and_watched_ignored for improved path control.
  • Runtime and Snapshot Changes: Numerous snapshot tests have been updated, reflecting changes in generated chunk IDs, file names, and runtime code due to the dependency upgrades and internal refactorings. The runtime now includes new worker URL handling and asset suffix logic.
Changelog
  • Cargo.lock
    • Updated numerous dependency versions, including swc_core, modularize_imports, react_remove_properties, remove_console, styled_components, styled_jsx, swc_emotion, and swc_relay.
    • Added new packages: aws-lc-rs, cesu8, combine, dragonbox_ecma, jni, jni-sys, rustls-platform-verifier, rustls-platform-verifier-android, webpki-root-certs, and specific versions of windows-sys and windows-targets.
    • Changed include_dir and mdxjs sources to vercel-labs git repositories.
    • Removed rustls-native-certs from hyper-rustls and quinn-rustls dependencies.
  • Cargo.toml
    • Updated swc_core to 54.0.0.
    • Updated modularize_imports to 0.108.0.
    • Updated react_remove_properties to 0.62.0.
    • Updated remove_console to 0.63.0.
    • Updated styled_components to 0.136.0.
    • Updated styled_jsx to 0.111.0.
    • Updated swc_emotion to 0.112.0.
    • Updated swc_relay to 0.82.0.
    • Updated mdxjs git source.
    • Added include_dir git source.
  • crates/pack-api/src/app.rs
    • Simplified origin.resolve_options(ty.clone()) to origin.resolve_options().
  • crates/pack-api/src/library.rs
    • Simplified origin.resolve_options(ty.clone()) to origin.resolve_options().
    • Changed access to export_usage and unused_references from *project.export_usage().await? to direct project.export_usage() calls.
  • crates/pack-api/src/project.rs
    • Imported UnusedReferences and ModuleIdFallback.
    • Removed DevModuleIdStrategy import.
    • Updated DiskFileSystem::new_with_watched_ignored to new_with_denied_paths_and_watched_ignored.
    • Refactored module graph creation from ModuleGraph::from_modules to from_single_graph with connect.
    • Changed module_ids return type from Vc<Box<dyn ModuleIdStrategy>> to Vc<ModuleIdStrategy> and updated its implementation.
    • Simplified binding_usage_info to directly access module_graphs.binding_usage_info.
    • Updated unused_references to return Vc<UnusedReferences> and use binding_usage_info().unused_references().
    • Adjusted whole_app_module_graph_operation to align with new module graph and binding usage APIs.
  • crates/pack-api/src/tasks.rs
    • Removed spawn_once_task method from BundlerTurboTasks.
  • crates/pack-api/src/utils.rs
    • Imported IssueFilter and used it in get_plain_issues.
  • crates/pack-core/src/client/context.rs
    • Imported UnusedReferences.
    • Updated module_id_strategy type from Vc<Box<dyn ModuleIdStrategy>> to Vc<ModuleIdStrategy>.
    • Updated unused_references type from Vc<OptionBindingUsageInfo> to Vc<UnusedReferences>.
    • Adjusted unused_references access in get_client_chunking_context.
  • crates/pack-core/src/client/runtime_entry.rs
    • Imported ResolveErrorMode and used it in resolve_asset.
  • crates/pack-core/src/config.rs
    • Added content_type and query fields to ConditionItem conversion.
    • Added module_type field to ModuleRule creation.
  • crates/pack-core/src/library/chunking_context.rs
    • Updated imports for UnusedReferences, ModuleIdStrategy, AsyncLoaderModule, and escape_file_path.
    • Removed imports for ModuleId, DevModuleIdStrategy, ModuleReference, and clean_separators.
    • Updated LibraryChunkingContextBuilder methods for module_id_strategy and unused_references types.
    • Added debug_ids builder method.
    • Modified LibraryChunkingContext struct to reflect type changes and add debug_ids.
    • Updated default LibraryChunkingContext initialization.
    • Removed chunk_item_id_from_ident and added chunk_item_id_strategy and async_loader_chunk_item_ident.
    • Replaced is_reference_unused with a unused_references method returning Vc<UnusedReferences>.
    • Changed ident_to_output_filename to use escape_file_path.
  • crates/pack-core/src/library/contexts.rs
    • Updated types for module_id_strategy and unused_references in LibraryChunkingContextOptions.
  • crates/pack-core/src/library/ecmascript/chunk.rs
    • Changed runtime_module_ids type from ReadRef<turbopack_core::chunk::ModuleId> to turbopack_core::chunk::ModuleId.
  • crates/pack-core/src/shared/transforms/swc_ecma_transform_plugins.rs
    • Imported ValueToString and Module.
    • Used ResolveErrorMode in resolve calls.
    • Adjusted logic for retrieving plugin source content.
  • crates/pack-core/src/shared/webpack_rules/less.rs
    • Added module_type field to ModuleRule creation.
  • crates/pack-core/src/shared/webpack_rules/sass.rs
    • Added module_type field to ModuleRule creation.
  • crates/pack-core/src/shared/webpack_rules/style_loader.rs
    • Added module_type field to ModuleRule creation.
  • crates/pack-napi/src/pack_api/endpoint.rs
    • Moved PrettyPrintError import from turbopack_core::error to turbo_tasks.
  • crates/pack-napi/src/pack_api/project.rs
    • Moved PrettyPrintError import from turbopack_core::error to turbo_tasks.
  • crates/pack-napi/src/pack_api/utils.rs
    • Moved PrettyPrintError import from turbopack_core::error to turbo_tasks.
  • crates/pack-tests/tests/snapshot.rs
    • Imported IssueFilter and used it in get_plain_issues.
  • crates/pack-tests/tests/snapshot/async_chunk/output/input_3831cdd3.js
    • Renamed to input_79e6c840.js and content updated.
  • crates/pack-tests/tests/snapshot/async_chunk/output/input_3831cdd3.js.map
    • Removed.
  • crates/pack-tests/tests/snapshot/async_chunk/output/input_4c8dbe3e.js.map
    • Added.
  • crates/pack-tests/tests/snapshot/async_chunk/output/input_79e6c840.js.map
    • Added.
  • crates/pack-tests/tests/snapshot/async_chunk/output/input_b9669e81.js
    • Renamed to input_4c8dbe3e.js and content updated.
  • crates/pack-tests/tests/snapshot/async_chunk/output/input_b9669e81.js.map
    • Removed.
  • crates/pack-tests/tests/snapshot/async_chunk/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/async_chunk/output/stats.json
    • Updated asset and chunk names.
  • crates/pack-tests/tests/snapshot/basic/alias/output/_project___662e3067.js
    • Renamed to _project___e64c8638.js.
  • crates/pack-tests/tests/snapshot/basic/alias/output/_project___662e3067.js.map
    • Renamed to _project___e64c8638.js.map and content updated.
  • crates/pack-tests/tests/snapshot/basic/alias/output/input_index_less_149e42e4.css
    • Renamed to input_index_less_b60023f8.css.
  • crates/pack-tests/tests/snapshot/basic/alias/output/input_index_less_149e42e4.css.map
    • Renamed to input_index_less_b60023f8.css.map.
  • crates/pack-tests/tests/snapshot/basic/alias/output/main.js
    • Updated otherChunks references.
  • crates/pack-tests/tests/snapshot/basic/chunk_loading_global/output/input_index_73b1a34e.js
    • Renamed to input_index_eb42bbdd.js.
  • crates/pack-tests/tests/snapshot/basic/chunk_loading_global/output/input_index_73b1a34e.js.map
    • Renamed to input_index_eb42bbdd.js.map and content updated.
  • crates/pack-tests/tests/snapshot/basic/chunk_loading_global/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/basic/chunk_loading_global/output/stats.json
    • Updated asset and chunk names.
  • crates/pack-tests/tests/snapshot/basic/copy/output/input_index_30a62934.js
    • Renamed to input_index_18a5cc2d.js.
  • crates/pack-tests/tests/snapshot/basic/copy/output/input_index_30a62934.js.map
    • Renamed to input_index_18a5cc2d.js.map and content updated.
  • crates/pack-tests/tests/snapshot/basic/copy/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/basic/copy/output/stats.json
    • Updated asset and chunk names.
  • crates/pack-tests/tests/snapshot/basic/jsx/output/_project___090fbf47.js
    • Renamed to _project___66cb6e44.js.
  • crates/pack-tests/tests/snapshot/basic/jsx/output/_project___090fbf47.js.map
    • Renamed to _project___66cb6e44.js.map and content updated.
  • crates/pack-tests/tests/snapshot/basic/jsx/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/basic/minify/output/input_index_9198c6ed.js
    • Renamed to input_index_878163a0.js.
  • crates/pack-tests/tests/snapshot/basic/minify/output/input_index_9198c6ed.js.map
    • Renamed to input_index_878163a0.js.map and content updated.
  • crates/pack-tests/tests/snapshot/basic/minify/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/basic/no_named_export_default/output/_project___010b064a.js
    • Renamed to _project___451105d8.js.
  • crates/pack-tests/tests/snapshot/basic/no_named_export_default/output/_project___010b064a.js.map
    • Renamed to _project___451105d8.js.map and content updated.
  • crates/pack-tests/tests/snapshot/basic/no_named_export_default/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/circular_dependency/output/input_4d28b519.js.map
    • Added.
  • crates/pack-tests/tests/snapshot/circular_dependency/output/input_d39849f5.js
    • Renamed to input_4d28b519.js and content updated.
  • crates/pack-tests/tests/snapshot/circular_dependency/output/input_d39849f5.js.map
    • Removed.
  • crates/pack-tests/tests/snapshot/circular_dependency/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/concatenate_modules/duplicate-imports/output/input_d691f15f.js
    • Renamed to input_314b046a.js.
  • crates/pack-tests/tests/snapshot/concatenate_modules/duplicate-imports/output/input_d691f15f.js.map
    • Renamed to input_314b046a.js.map and content updated.
  • crates/pack-tests/tests/snapshot/concatenate_modules/duplicate-imports/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/concatenate_modules/library-shared/output/main.js
    • Reordered module IDs and updated content.
  • crates/pack-tests/tests/snapshot/concatenate_modules/library-shared/output/main.js.map
    • Updated module ID references and content.
  • crates/pack-tests/tests/snapshot/concatenate_modules/side-effects-import/output/a.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/concatenate_modules/side-effects-import/output/b.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/concatenate_modules/side-effects-import/output/input_15f62441.js
    • Renamed to input_abc4019c.js and content updated.
  • crates/pack-tests/tests/snapshot/concatenate_modules/side-effects-import/output/input_15f62441.js.map
    • Removed.
  • crates/pack-tests/tests/snapshot/concatenate_modules/side-effects-import/output/input_abc4019c.js.map
    • Added.
  • crates/pack-tests/tests/snapshot/concatenate_modules/side-effects-import/output/input_c10f485c.js
    • Renamed to input_ded1aa15.js and content updated.
  • crates/pack-tests/tests/snapshot/concatenate_modules/side-effects-import/output/input_c10f485c.js.map
    • Removed.
  • crates/pack-tests/tests/snapshot/concatenate_modules/side-effects-import/output/input_ded1aa15.js.map
    • Added.
  • crates/pack-tests/tests/snapshot/define/basic/output/input_index_ts_1c44b6d5.js
    • Renamed to input_index_ts_c6f64044.js.
  • crates/pack-tests/tests/snapshot/define/basic/output/input_index_ts_1c44b6d5.js.map
    • Renamed to input_index_ts_c6f64044.js.map and content updated.
  • crates/pack-tests/tests/snapshot/define/basic/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/define/complex/output/input_index_ts_912061dd.js
    • Added.
  • crates/pack-tests/tests/snapshot/define/complex/output/input_index_ts_d97c2c59.js
    • Removed.
  • crates/pack-tests/tests/snapshot/define/complex/output/input_index_ts_d97c2c59.js.map
    • Renamed to input_index_ts_912061dd.js.map and content updated.
  • crates/pack-tests/tests/snapshot/define/complex/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/dynamic_import/library-chunk/output/main.js.map
    • Updated source map names.
  • crates/pack-tests/tests/snapshot/dynamic_import/very-dynamic/output/input_index_ts_39ba5ecc.js
    • Renamed to input_index_ts_570ff46a.js.
  • crates/pack-tests/tests/snapshot/dynamic_import/very-dynamic/output/input_index_ts_39ba5ecc.js.map
    • Renamed to input_index_ts_570ff46a.js.map and content updated.
  • crates/pack-tests/tests/snapshot/dynamic_import/very-dynamic/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/externals/basic/output/_root-of-the-server___c3991380.js
    • Renamed to _root-of-the-server___28c3d6aa.js.
  • crates/pack-tests/tests/snapshot/externals/basic/output/_root-of-the-server___c3991380.js.map
    • Renamed to _root-of-the-server___28c3d6aa.js.map and content updated.
  • crates/pack-tests/tests/snapshot/externals/basic/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/externals/subpath/output/_root-of-the-server___eca97b31.js
    • Renamed to _root-of-the-server___27e41d76.js.
  • crates/pack-tests/tests/snapshot/externals/subpath/output/_root-of-the-server___eca97b31.js.map
    • Renamed to _root-of-the-server___27e41d76.js.map and content updated.
  • crates/pack-tests/tests/snapshot/externals/subpath/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/externals/with-alias/output/_root-of-the-server___c5f466d1.js
    • Renamed to _root-of-the-server___bbab5121.js.
  • crates/pack-tests/tests/snapshot/externals/with-alias/output/_root-of-the-server___c5f466d1.js.map
    • Renamed to _root-of-the-server___bbab5121.js.map.
  • crates/pack-tests/tests/snapshot/externals/with-alias/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/node_polyfill/output/_root-of-the-server___aa804e41.js
    • Renamed to _root-of-the-server___f5532ddc.js.
  • crates/pack-tests/tests/snapshot/node_polyfill/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/optimization/modularize_imports_camel_case/output/_project___307ab340.js
    • Renamed to _project___fefa8990.js.
  • crates/pack-tests/tests/snapshot/optimization/modularize_imports_camel_case/output/_project___307ab340.js.map
    • Renamed to _project___fefa8990.js.map and content updated.
  • crates/pack-tests/tests/snapshot/optimization/modularize_imports_camel_case/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/optimization/modularize_imports_keba_case/output/_project___a4d3bca3.js
    • Renamed to _project___988514db.js.
  • crates/pack-tests/tests/snapshot/optimization/modularize_imports_keba_case/output/_project___a4d3bca3.js.map
    • Renamed to _project___988514db.js.map and content updated.
  • crates/pack-tests/tests/snapshot/optimization/modularize_imports_keba_case/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/optimization/remove_console/output/input_index_7ed5b393.js
    • Renamed to input_index_d733edeb.js.
  • crates/pack-tests/tests/snapshot/optimization/remove_console/output/input_index_7ed5b393.js.map
    • Renamed to input_index_d733edeb.js.map and content updated.
  • crates/pack-tests/tests/snapshot/optimization/remove_console/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/optimization/remove_unused_imports_reexport/output/input_index_2a89c2c3.js
    • Renamed to input_index_358467c4.js.
  • crates/pack-tests/tests/snapshot/optimization/remove_unused_imports_reexport/output/input_index_2a89c2c3.js.map
    • Renamed to input_index_358467c4.js.map and content updated.
  • crates/pack-tests/tests/snapshot/optimization/remove_unused_imports_reexport/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/provider/basic/output/_project___d73befd5.js
    • Renamed to _project___65ac11d6.js.
  • crates/pack-tests/tests/snapshot/provider/basic/output/_project___d73befd5.js.map
    • Renamed to _project___65ac11d6.js.map and content updated.
  • crates/pack-tests/tests/snapshot/provider/basic/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/public_path/basic/output/input_6c7d2ba3.js
    • Renamed to input_687d2c57.js and content updated.
  • crates/pack-tests/tests/snapshot/public_path/basic/output/input_6c7d2ba3.js.map
    • Renamed to input_687d2c57.js.map and content updated.
  • crates/pack-tests/tests/snapshot/public_path/basic/output/input_lazy_8fecfece.js
    • Renamed to input_lazy_438c58b8.js.
  • crates/pack-tests/tests/snapshot/public_path/basic/output/input_lazy_8fecfece.js.map
    • Renamed to input_lazy_438c58b8.js.map and content updated.
  • crates/pack-tests/tests/snapshot/public_path/basic/output/main.js
    • Updated otherChunks reference.
    • Modified runtime constants like CHUNK_SUFFIX to ASSET_SUFFIX and added WORKER_FORWARDED_GLOBALS.
    • Updated worker URL generation logic and asset suffix handling.
  • crates/pack-tests/tests/snapshot/public_path/runtime/output/input_bf6c0d42.js
    • Renamed to input_f34f5e12.js.
  • crates/pack-tests/tests/snapshot/public_path/runtime/output/input_bf6c0d42.js.map
    • Renamed to input_f34f5e12.js.map and content updated.
  • crates/pack-tests/tests/snapshot/public_path/runtime/output/main.js
    • Updated otherChunks reference.
    • Modified runtime constants like CHUNK_SUFFIX to ASSET_SUFFIX and added WORKER_FORWARDED_GLOBALS.
    • Updated worker URL generation logic and asset suffix handling.
  • crates/pack-tests/tests/snapshot/runtime/app_build_runtime/output/input_index_45265639.js
    • Renamed to input_index_c1a07ff7.js.
  • crates/pack-tests/tests/snapshot/runtime/app_build_runtime/output/input_index_45265639.js.map
    • Renamed to input_index_c1a07ff7.js.map and content updated.
  • crates/pack-tests/tests/snapshot/runtime/app_build_runtime/output/main.js
    • Updated otherChunks reference.
    • Modified runtime constants like CHUNK_SUFFIX to ASSET_SUFFIX and added WORKER_FORWARDED_GLOBALS.
    • Updated worker URL generation logic and asset suffix handling.
  • crates/pack-tests/tests/snapshot/runtime/app_dev_runtime/output/input_index_36765d14.js
    • Renamed to input_index_4000282c.js.
  • crates/pack-tests/tests/snapshot/runtime/app_dev_runtime/output/input_index_36765d14.js.map
    • Renamed to input_index_4000282c.js.map and content updated.
  • crates/pack-tests/tests/snapshot/runtime/app_dev_runtime/output/main.js
    • Updated otherChunks reference.
    • Modified runtime constants like CHUNK_SUFFIX to ASSET_SUFFIX and added WORKER_FORWARDED_GLOBALS.
    • Updated worker URL generation logic and asset suffix handling.
  • crates/pack-tests/tests/snapshot/runtime/export_entry_exports/output/input_index_ts_40cf707f.js
    • Renamed to input_index_ts_8ea70179.js.
  • crates/pack-tests/tests/snapshot/runtime/export_entry_exports/output/input_index_ts_40cf707f.js.map
    • Renamed to input_index_ts_8ea70179.js.map and content updated.
  • crates/pack-tests/tests/snapshot/runtime/export_entry_exports/output/main.js
    • Updated otherChunks reference.
    • Modified runtime constants like CHUNK_SUFFIX to ASSET_SUFFIX and added WORKER_FORWARDED_GLOBALS.
    • Updated worker URL generation logic and asset suffix handling.
  • crates/pack-tests/tests/snapshot/static-assets/json/output/input_Regular_Expressions__JavaScript__tmLanguage_json_3ad9e616.js
    • Renamed to input_Regular_Expressions__JavaScript__tmLanguage_json_82538685.js.
  • crates/pack-tests/tests/snapshot/static-assets/json/output/input_dd792433.js
    • Renamed to input_f4a57059.js and content updated.
  • crates/pack-tests/tests/snapshot/static-assets/json/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/static-assets/wasm/output/_project___9ce54f1d.js
    • Renamed to _project___0a75223c.js and content updated.
  • crates/pack-tests/tests/snapshot/static-assets/wasm/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/style/css_instantiate_error/output/input_e7381c60.css
    • Renamed to input_0ccb5ef4.css.
  • crates/pack-tests/tests/snapshot/style/css_instantiate_error/output/input_index_ts_8c255178.js
    • Renamed to input_index_ts_e10c8c69.js.
  • crates/pack-tests/tests/snapshot/style/css_instantiate_error/output/main.js
    • Updated otherChunks references.
  • crates/pack-tests/tests/snapshot/style/css_modules/output/input_c6961dd6.js
    • Renamed to input_ef2fa198.js.
  • crates/pack-tests/tests/snapshot/style/css_modules/output/input_c94b7e1a.css
    • Renamed to input_30f79b81.css.
  • crates/pack-tests/tests/snapshot/style/css_modules/output/main.js
    • Updated otherChunks references.
  • crates/pack-tests/tests/snapshot/style/global_css/output/input_index_09afdc62.js
    • Renamed to input_index_93f8e476.js.
  • crates/pack-tests/tests/snapshot/style/global_css/output/input_index_less_b9413c4d.css
    • Renamed to input_index_less_1b4b7942.css.
  • crates/pack-tests/tests/snapshot/style/global_css/output/main.js
    • Updated otherChunks references.
  • crates/pack-tests/tests/snapshot/style/global_scoped/output/input_a08e9969.js
    • Renamed to input_df8c5e3d.js.
  • crates/pack-tests/tests/snapshot/style/global_scoped/output/input_a08e9969.js.map
    • Renamed to input_df8c5e3d.js.map and content updated.
  • crates/pack-tests/tests/snapshot/style/global_scoped/output/input_a60ed54c.css
    • Renamed to input_56612396.css.
  • crates/pack-tests/tests/snapshot/style/global_scoped/output/input_a60ed54c.css.map
    • Renamed to input_56612396.css.map.
  • crates/pack-tests/tests/snapshot/style/global_scoped/output/main.js
    • Updated otherChunks references.
  • crates/pack-tests/tests/snapshot/style/invalid_pseudo_class/issues/Module-not-found-Can-t-resolve-791687.txt
    • Removed.
  • crates/pack-tests/tests/snapshot/style/invalid_pseudo_class/issues/Module-not-found-Can-t-resolve-path-to-image-03e98d.txt
    • Removed.
  • crates/pack-tests/tests/snapshot/style/invalid_pseudo_class/issues/Unknown-module-type-5d8e89.txt
    • Added.
  • crates/pack-tests/tests/snapshot/style/invalid_pseudo_class/output/input_abae66a4.js
    • Renamed to input_85370376.js.
  • crates/pack-tests/tests/snapshot/style/invalid_pseudo_class/output/input_abae66a4.js.map
    • Renamed to input_85370376.js.map.
  • crates/pack-tests/tests/snapshot/style/invalid_pseudo_class/output/input_index_less_9bc845ef.css
    • Renamed to input_index_less_6ea67be6.css.
  • crates/pack-tests/tests/snapshot/style/invalid_pseudo_class/output/input_index_less_9bc845ef.css.map
    • Renamed to input_index_less_6ea67be6.css.map.
  • crates/pack-tests/tests/snapshot/style/invalid_pseudo_class/output/main.js
    • Updated otherChunks references.
  • crates/pack-tests/tests/snapshot/style/less/output/_project___42ea47e5.css
    • Renamed to _project___a7de151a.css.
  • crates/pack-tests/tests/snapshot/style/less/output/_project___42ea47e5.css.map
    • Renamed to _project___a7de151a.css.map.
  • crates/pack-tests/tests/snapshot/style/less/output/input_8e3bd241.js
    • Renamed to input_ef57f19d.js.
  • crates/pack-tests/tests/snapshot/style/less/output/input_8e3bd241.js.map
    • Renamed to input_ef57f19d.js.map.
  • crates/pack-tests/tests/snapshot/style/less/output/main.js
    • Updated otherChunks references.
  • crates/pack-tests/tests/snapshot/typescript/dts_export/output/input_index_ts_ef127c09.js
    • Renamed to input_index_ts_a8bf6e67.js.
  • crates/pack-tests/tests/snapshot/typescript/dts_export/output/input_index_ts_ef127c09.js.map
    • Renamed to input_index_ts_a8bf6e67.js.map.
  • crates/pack-tests/tests/snapshot/typescript/dts_export/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/typescript/foreign_tsconfig/output/_project___73f2b224.js
    • Renamed to _project___9d6e002b.js.
  • crates/pack-tests/tests/snapshot/typescript/foreign_tsconfig/output/_project___73f2b224.js.map
    • Renamed to _project___9d6e002b.js.map and content updated.
  • crates/pack-tests/tests/snapshot/typescript/foreign_tsconfig/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/typescript/interface_export/output/input_827249d7.js
    • Renamed to input_a7642bc5.js.
  • crates/pack-tests/tests/snapshot/typescript/interface_export/output/input_827249d7.js.map
    • Renamed to input_a7642bc5.js.map.
  • crates/pack-tests/tests/snapshot/typescript/interface_export/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/typescript/use_define_for_class_fileds/output/input_index_ts_80d7fb65.js
    • Renamed to input_index_ts_86f22bf3.js.
  • crates/pack-tests/tests/snapshot/typescript/use_define_for_class_fileds/output/input_index_ts_80d7fb65.js.map
    • Renamed to input_index_ts_86f22bf3.js.map and content updated.
  • crates/pack-tests/tests/snapshot/typescript/use_define_for_class_fileds/output/main.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/umd/async-module/output/main.js
    • Updated module IDs and content.
  • crates/pack-tests/tests/snapshot/umd/async-module/output/main.js.map
    • Updated module ID references and content.
  • crates/pack-tests/tests/snapshot/umd/basic/output/main.js.map
    • Updated source map names.
  • crates/pack-tests/tests/snapshot/webpack-loaders/custom-loader/issues/Parsing-ecmascript-source-code-failed-9fca75.txt
    • Removed.
  • crates/pack-tests/tests/snapshot/webpack-loaders/custom-loader/issues/Unknown-module-type-5d8e89.txt
    • Added.
  • crates/pack-tests/tests/snapshot/webpack-loaders/custom-loader/output/_project___65084584.js
    • Renamed to _project___cb8308e3.js and content updated.
  • crates/pack-tests/tests/snapshot/webpack-loaders/custom-loader/output/_project___65084584.js.map
    • Renamed to _project___cb8308e3.js.map and content updated.
  • crates/pack-tests/tests/snapshot/webpack-loaders/custom-loader/output/index.js
    • Updated otherChunks reference.
  • crates/pack-tests/tests/snapshot/webpack-loaders/sass/output/index.js
    • Updated otherChunks references.
  • crates/pack-tests/tests/snapshot/webpack-loaders/sass/output/input_index_ts_67644e0e.js
    • Renamed to input_index_ts_cb0ae599.js.
  • crates/pack-tests/tests/snapshot/webpack-loaders/sass/output/input_index_ts_67644e0e.js.map
    • Renamed to input_index_ts_cb0ae599.js.map.
  • crates/pack-tests/tests/snapshot/webpack-loaders/sass/output/input_style_sass_26b91c76.css
    • Renamed to input_style_sass_cf3fd10c.css.
  • crates/pack-tests/tests/snapshot/webpack-loaders/sass/output/input_style_sass_26b91c76.css.map
    • Renamed to input_style_sass_cf3fd10c.css.map.
  • next.js
    • Updated subproject commit from 241a1219a9748b8ca7b777032e9360fdd1a111fc to 3b0f03db5ffa7f2340ff3a5c9185be597cbc52f1.
  • rust-toolchain.toml
    • Updated channel from nightly-2025-10-27 to nightly-2026-01-04.
Activity
  • The pull request introduces a series of dependency updates and refactorings across the codebase.
  • Key changes involve modernizing module graph handling and simplifying interfaces for module IDs and unused references.
  • Configuration and context structures have been enhanced with new fields for more flexible control.
  • Issue collection has been improved with the introduction of IssueFilter.
  • The spawn_once_task method has been removed from BundlerTurboTasks, indicating a change in task management.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a significant set of changes, primarily focused on updating dependencies like swc_core and refactoring the module graph handling within Turbopack. The changes simplify APIs by removing trait objects for module ID strategies and introducing more explicit and robust methods for creating module graphs and handling unused references. The dependency updates are extensive and bring the project up to date with next.js@16.2. Overall, these changes improve maintainability and modernize the codebase. My review found one potential compilation issue in the library chunking context.

fireairforce
fireairforce previously approved these changes Feb 4, 2026
Copy link
Contributor

@fireairforce fireairforce left a comment

Choose a reason for hiding this comment

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

lgtm

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

📊 Performance Benchmark Report (with-antd)

🚀 Utoopack Performance Report: Async Task Scheduling Overhead Analysis

Report ID: utoopack_performance_report_20260204_102754
Generated: 2026-02-04 10:27:54
Trace File: trace_antd.json (1.4GB, 7.32M events)
Test Project: examples/with-antd


📊 Executive Summary

This report analyzes the performance of Utoopack/Turbopack, covering the full spectrum of the Performance Analysis Protocol (P0-P4).

Key Findings

Metric Value Assessment
Total Wall Time 8,999.5 ms Baseline
Total Thread Work 77,060.4 ms ~8.6x parallelism
Thread Utilization 171.3% ✅ Good
turbo_tasks::function Invocations 3,542,613 Total count
Meaningful Tasks (≥ 10µs) 1,297,773 (36.6% of total)
Tracing Noise (< 10µs) 2,244,840 (63.4% of total)

Workload Distribution by Tier

Category Tasks Total Time (ms) % of Work
P0: Runtime/Resolution 877,555 46,441.5 60.3%
P1: I/O & Heavy Tasks 35,491 2,910.6 3.8%
P3: Asset Pipeline 28,922 4,326.9 5.6%
P4: Bridge/Interop 0 0.0 0.0%
Other 355,805 16,030.7 20.8%

⚡ Parallelization Analysis (P0-P2)

Thread Utilization

Metric Value
Number of Threads 5
Total Thread Work 77,060.4 ms
Avg Work per Thread 15,412.1 ms
Theoretical Parallelism 8.56x
Thread Utilization 171.3%

Assessment: With 5 threads available, achieving 8.6x parallelism indicates reasonable throughput.


📈 Top 20 Tasks (Global)

These are the most significant tasks by total duration:

Total (ms) Count Avg (µs) % Work Task Name
38,148.4 727,722 52.4 49.5% turbo_tasks::function
7,028.3 117,721 59.7 9.1% task execution completed
5,927.0 69,741 85.0 7.7% turbo_tasks::resolve_call
2,671.6 32,632 81.9 3.5% analyze ecmascript module
1,784.6 59,503 30.0 2.3% resolving
1,498.9 27,000 55.5 1.9% module
1,491.0 24,515 60.8 1.9% effects processing
1,477.9 41,635 35.5 1.9% precompute code generation
1,471.6 13,103 112.3 1.9% process parse result
1,045.2 6,156 169.8 1.4% parse ecmascript
938.1 32,494 28.9 1.2% internal resolving
754.8 25,952 29.1 1.0% process module
734.1 26,555 27.6 1.0% resolve_relative_request
649.2 1,918 338.5 0.8% analyze variable values
466.9 14,523 32.2 0.6% resolve_module_request
445.8 1,936 230.3 0.6% generate source map
400.2 14,706 27.2 0.5% handle_after_resolve_plugins
395.4 16,439 24.1 0.5% resolved
381.9 1,937 197.2 0.5% swc_parse
294.8 9,151 32.2 0.4% code generation

🔍 Deep Dive by Tier

🔴 Tier 1: Runtime & Resolution (P0)

Focus: Task scheduling and dependency resolution.

Metric Value Status
Total Scheduling Time 46,441.5 ms ⚠️ High
Resolution Hotspots 9 tasks 🔍 Check Top Tasks

Potential P0 Issues:

  • Low thread utilization (171.3%) suggests critical path serialization or lock contention.
  • 2,244,840 tasks < 10µs (63.4%) contribute to scheduler pressure.

🟠 Tier 2: Physical & Resource Barriers (P1)

Focus: Hardware utilization, I/O, and heavy monoliths.

Metric Value Status
I/O Work (Estimated) 2,910.6 ms ✅ Healthy
Large Tasks (> 100ms) 16 🚨 Critical

Potential P1 Issues:

  • 16 tasks exceed 100ms. These "Heavy Monoliths" are prime candidates for splitting.

🟡 Tier 3: Architecture & Asset Pipeline (P2-P3)

Focus: Global state and transformation pipeline.

Metric Value Status
Asset Processing (P3) 4,326.9 ms 5.6% of work
Bridge Overhead (P4) 0.0 ms ✅ Low

💡 Recommendations (Prioritized P0-P2)

🚨 Critical: (P0) Improvement

Problem: 171.3% thread utilization.
Action:

  1. Profile lock contention if utilization < 60%.
  2. Convert sequential await chains to try_join.

⚠️ High Priority: (P1) Optimization

Problem: 16 heavy tasks detected.
Action:

  1. Identify module-level bottlenecks (e.g., barrel files).
  2. Optimize I/O batching for metadata.

⚠️ Medium Priority: (P3) Pipeline Efficiency

Action:

  1. Review transformation logic for frequently changed assets.
  2. Minimize cross-language serialization (P4) if overhead exceeds 10%.

📐 Diagnostic Signal Summary

Signal Status Finding
Tracing Noise (P0) ⚠️ Significant 63.4% of tasks < 10µs
Thread Utilization (P0) ✅ Good 171.3% utilization
Heavy Monoliths (P1) ⚠️ Detected 16 tasks > 100ms
Asset Pipeline (P3) 🔍 Review 4,326.9 ms total
Bridge/Interop (P4) ✅ Low 0.0 ms total

🎯 Action Items (Comprehensive P0-P4)

  1. [P0] Investigate task scheduling gaps for incremental gains
  2. [P1] Breakdown heavy monolith tasks (>100ms) to improve granularity
  3. [P1] Review I/O patterns for potential batching opportunities
  4. [P3] Optimize asset transformation pipeline hot-spots
  5. [P4] Reduce "chatty" bridge operations if interop overhead is significant

Report generated by Utoopack Performance Analysis Agent on 2026-02-04
Following: Utoopack Performance Analysis Agent Protocol

@xusd320 xusd320 merged commit 574158b into next Feb 4, 2026
16 checks passed
@xusd320 xusd320 deleted the feat/next.js-16.2 branch February 4, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants