Skip to content

fix(turbopack): honor default chunk content hashing - #190

Merged
fireairforce merged 2 commits into
utoofrom
zoomdong/short-production-chunk-names
Sep 9, 2026
Merged

fireairforce merged 2 commits into
utoofrom
zoomdong/short-production-chunk-names

Conversation

@fireairforce

@fireairforce fireairforce commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Summary

BrowserChunkingContext::chunk_path currently ignores chunk_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 --check and formatting check for turbopack-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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-09T06:28:02.995937Z dad324e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread turbopack/crates/turbopack-browser/src/chunking_context.rs Outdated
Comment thread turbopack/crates/turbopack-browser/src/chunking_context.rs Outdated
@fireairforce
fireairforce merged commit fb5c6e3 into utoo Sep 9, 2026
13 of 26 checks passed
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>
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.

1 participant