Skip to content

Conversation

@chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Jun 24, 2025

Summary

This PR disables the default bundler info injection to reduce bundle size. This removes the Rspack version information from the bundle code and is not noticeable to users.

  • before:
File (web)                           Size      Gzip   
dist/static/js/index.a18d906c.js     0.37 kB   0.28 kB
  • after:
File (web)                           Size      Gzip   
dist/static/js/index.c2760cca.js     0.18 kB   0.17 kB

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings June 24, 2025 13:38
@netlify
Copy link

netlify bot commented Jun 24, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 87efe37
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/685ab02a8851bf0008e8d2ed
😎 Deploy Preview https://deploy-preview-5476--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 79 (🔴 down 8 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR disables the default BundlerInfo injection in Rspack to reduce bundle size.

  • Adds rspackFuture.bundlerInfo.force = false in the basic plugin when using Rspack
  • Updates snapshot tests across environments, default, builder, and basic suites to include the new experiments block

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/core/src/plugins/basic.ts Inject rspackFuture.bundlerInfo.force = false when bundler is Rspack
packages/core/tests/__snapshots/environments.test.ts.snap Added default rspackFuture.bundlerInfo in snapshots
packages/core/tests/__snapshots/default.test.ts.snap Added default rspackFuture.bundlerInfo in snapshots
packages/core/tests/__snapshots/builder.test.ts.snap Added default rspackFuture.bundlerInfo in snapshots
packages/core/tests/__snapshots/basic.test.ts.snap Added default rspackFuture.bundlerInfo in snapshots
Comments suppressed due to low confidence (2)

packages/core/src/plugins/basic.ts:94

  • Add unit tests to verify behavior when rspackFuture.bundlerInfo.force is set to true or false, ensuring that injection is correctly applied or omitted in each case.
        if (api.context.bundlerType === 'rspack') {

packages/core/src/plugins/basic.ts:96

  • [nitpick] Spreading chain.get('experiments') performs a shallow merge of experiment flags. Consider using a deep-merge utility or chain.merge to preserve nested experiment settings correctly.
            ...chain.get('experiments'),

@chenjiahan chenjiahan merged commit 859ca25 into main Jun 24, 2025
11 checks passed
@chenjiahan chenjiahan deleted the bundler_info_0624 branch June 24, 2025 14:26
@chenjiahan chenjiahan mentioned this pull request Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant