feat: updates the default contenthash length in filenames from 8 to 10#7154
feat: updates the default contenthash length in filenames from 8 to 10#7154chenjiahan merged 6 commits intomainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Deploying rsbuild with
|
| Latest commit: |
1f3576a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://23d2d5e2.rsbuild-v2.pages.dev |
| Branch Preview URL: | https://default-filename-hash-0205.rsbuild-v2.pages.dev |
Summary of ChangesHello @chenjiahan, 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 increases the default contenthash length in filenames from 8 to 10 characters. This change improves the reliability of content hashing by significantly lowering the collision risk, while only slightly increasing filename length. The changes include updates to configuration files, tests, and documentation to reflect the new default value. Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Pull request overview
This PR updates the default contenthash length in output filenames from 8 to 10 characters to improve collision resistance while maintaining reasonable filename lengths.
Changes:
- Updated the default contenthash length constant in core code from
[contenthash:8]to[contenthash:10] - Updated all documentation examples (English and Chinese) to reflect the new default hash length
- Updated test snapshots and E2E test patterns to match the new 10-character hash format
- Added version history sections documenting this change as part of v2.0.0
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/helpers/index.ts | Updated default hash constant from contenthash:8 to contenthash:10 |
| packages/core/src/types/config.ts | Updated TypeScript documentation comments to reflect new default values |
| website/docs/*/guide/faq/hmr.mdx | Updated examples in FAQ documentation |
| website/docs/*/guide/basic/wasm-assets.mdx | Updated WASM asset examples |
| website/docs/*/guide/basic/html-template.mdx | Updated HTML template examples |
| website/docs/*/config/tools/html-plugin.mdx | Updated HTML plugin configuration examples (with issues) |
| website/docs/*/config/output/filename.mdx | Updated filename configuration documentation and all examples |
| website/docs/*/config/output/filename-hash.mdx | Updated hash format documentation and added version history |
| website/docs/zh/config/dev/client.mdx | Minor consistency update to version history table header |
| packages//tests/snapshots/.snap | Updated all test snapshots to reflect new hash length |
| e2e/cases/security/sri-*/index.test.ts | Updated E2E test regex patterns for 10-character hashes |
| e2e/cases/print-file-size/helper.ts | Updated regex to match both 8 and 10 character hashes |
| e2e/cases/print-file-size/*/rsbuild.config.ts | Explicitly set filenameHash to contenthash:8 for these tests |
| e2e/cases/css/resolve-alias/index.test.ts | Updated test regex pattern for 10-character hashes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request correctly updates the default contenthash length from 8 to 10 characters across the codebase, including core logic, tests, and documentation. This is a good improvement for reducing hash collision risk. I've found a couple of issues in the documentation that need to be addressed: an incorrect example in one file and some imprecise wording in another. Overall, the changes are solid.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 30 out of 30 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
This PR updates the default contenthash length in filenames from 8 to 10.
Why:
Related issues
Checklist