fix(turbopack): honor default chunk content hashing - #190
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dad324e723
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
fireairforce
added a commit
that referenced
this pull request
Sep 14, 2026
Rebased onto vercel/next.js canary 3c9d1ca. Includes the previous utoo follow-ups: - feat(turbo-tasks): expose completed task count (#187) - fix(turbopack): preserve CSS chunk order in identity (#188) - feat(turbopack): support React 17 compiler target (#189) - fix(turbopack): honor default chunk content hashing (#190) - fix(turbopack): fall back after filtering declaration path aliases (#191) - fix(turbopack): handle undefined defaults in dynamic URLs (#192) Adaptations for this sync: - swc v77: build Function.body as FunctionBody in async_module.rs - turbo-tasks GC roots: extend the wasm in-memory backing storage stub - lazy dynamic imports: port the follow-reexports evaluation/side-effect semantics into module_canonicalization.rs - strict factory chunks: keep browser_global_ident and compress options in the rewritten chunk emitters Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BrowserChunkingContext::chunk_pathcurrently ignoreschunk_content_hashing, so consumers that enable production content hashing still receive long, path-derived filenames unless they provide output templates.Restore the upstream default: when no explicit filename template applies, use
Xxh3Hash128Base38, truncate to the configured length, and retain the supplied prefix and extension. Explicit JS/CSS filename templates keep their existing behavior, including their content-hash format. Contexts without content hashing retain readable names.The companion Utoo PR #3342 enables 13-character hashes for production client builds and supplies regression fixtures and updated snapshots. Merge this PR before the companion integration PR.
Test Plan
cargo fmt --checkand formatting check forturbopack-browser.cargo clippy -p turbopack-browser --all-targets -- -D warnings --no-deps.Companion Utoo checkout on its latest base:
cargo test -p pack-tests— 143 passed.Regression coverage for long paths, explicit JS/CSS templates, and source-map references; existing development, worker, external, and multi-entry cases pass.
Browser smoke test with a rebuilt binding: async JS/CSS, static image and Worker loading; identical rebuilds preserve filenames/content, and changed lazy-module content updates hashes and references.
Review follow-up: default chunk hashes honor the configured context salt and clamp requested lengths to the available 25 base38 characters.
Regression coverage lives in Utoo
crates/pack-tests/tests/chunk_hashing.rs: JS/CSS salt changes and stability, preserved prefix/extension, and 26/255-character requests. The new test and all 143 existing snapshot tests pass; full-workspace and targeted browser Clippy and formatting checks pass.