Skip to content

refactor: rename webpack default export var to rspack format#12257

Merged
chenjiahan merged 1 commit intomainfrom
rename_default_export_1121
Nov 21, 2025
Merged

refactor: rename webpack default export var to rspack format#12257
chenjiahan merged 1 commit intomainfrom
rename_default_export_1121

Conversation

@chenjiahan
Copy link
Member

Summary

Update default export variable naming convention from __WEBPACK_DEFAULT_EXPORT__ to __rspack_default_export.

See #12244 for more details.

Checklist

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

Copilot AI review requested due to automatic review settings November 21, 2025 02:56
@github-actions github-actions bot added release: refactor team The issue/pr is created by the member of Rspack. labels Nov 21, 2025
@netlify
Copy link

netlify bot commented Nov 21, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 7e71758
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/691fd4f92934020008785778

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 refactors the default export variable naming convention from webpack's __WEBPACK_DEFAULT_EXPORT__ to rspack's __rspack_default_export, aligning the codebase more closely with rspack branding and adopting a lowercase naming style.

Key changes:

  • Updated core constant definitions in the Rust codebase to use the new naming convention
  • Regenerated all test snapshots to reflect the new variable name in generated output
  • Modified test code that validates or checks for the old variable name

Reviewed Changes

Copilot reviewed 127 out of 127 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/rspack_core/src/utils/concatenation_scope.rs Updated DEFAULT_EXPORT_ATOM and DEFAULT_EXPORT constants to use __rspack_default_export
crates/rspack_core/src/reserved_names.rs Updated reserved names array to include the new naming convention
Multiple test snapshot files Regenerated snapshots showing the new default export variable name in generated code
tests/rspack-test/configCases/parsing/harmony-export-comment/index.js Updated test assertion to check for new variable name
tests/rspack-test/configCases/parsing/default-export-const/supports-const.js Updated error message expectation to match new variable name
tests/rspack-test/statsAPICases/exports.js Updated hash expectations due to code generation changes
tests/rspack-test/diagnosticsCases/module-parse-failed/concatenate_parse_module/stats.err Updated error output snapshot

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 7e71758 to feat: support SRI with experiments.css and CssExtractRspackPlugin (#12239) by harpsealjs

🙈 Size remains the same at 47.63MB

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 21, 2025

CodSpeed Performance Report

Merging #12257 will not alter performance

Comparing rename_default_export_1121 (7e71758) with main (480f74a)

Summary

✅ 17 untouched

@chenjiahan chenjiahan merged commit 5322cc8 into main Nov 21, 2025
56 checks passed
@chenjiahan chenjiahan deleted the rename_default_export_1121 branch November 21, 2025 03:26
@chenjiahan chenjiahan changed the title refactor: rename rspack default export var to rspack format refactor: rename webpack default export var to rspack format Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: refactor team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants