Skip to content

refactor: rename webpack reexport vars to Rspack format#12263

Merged
chenjiahan merged 2 commits intomainfrom
rename_reexports_1121
Nov 22, 2025
Merged

refactor: rename webpack reexport vars to Rspack format#12263
chenjiahan merged 2 commits intomainfrom
rename_reexports_1121

Conversation

@chenjiahan
Copy link
Member

Summary

Update reexport variable naming convention:

  • __WEBPACK_REEXPORT_OBJECT__ -> __rspack_reexport
  • __WEBPACK_IMPORT_KEY__ -> __rspack_import_key

Also simplified the createRequire variables:

  • __rspack_external_createRequire -> __rspack_createRequire
  • __rspack_external_createRequire_require -> __rspack_createRequire_require

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 09:05
@netlify
Copy link

netlify bot commented Nov 21, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit cb50e70
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/69202d9cb548e10008c0d160

@github-actions github-actions bot added release: refactor team The issue/pr is created by the member of Rspack. labels Nov 21, 2025
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 variable naming convention for reexport and external module helpers to follow the Rspack naming format instead of the legacy Webpack naming. The changes standardize internal variable names across the codebase and generated output.

  • Updates ESM reexport variable names from Webpack-style to Rspack-style
  • Simplifies external module helper variable names by removing the redundant "external" prefix
  • Updates all test snapshots to reflect the new naming convention

Reviewed Changes

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

Show a summary per file
File Description
crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs Updates ESM reexport variable names from __WEBPACK_REEXPORT_OBJECT__ to __rspack_reexport and __WEBPACK_IMPORT_KEY__ to __rspack_import_key
crates/rspack_core/src/external_module.rs Simplifies createRequire variable names from __rspack_external_createRequire to __rspack_createRequire
crates/rspack_plugin_javascript/src/plugin/api_plugin.rs Updates createRequire import and variable declaration with simplified naming
crates/rspack_plugin_javascript/src/parser_plugin/api_plugin.rs Updates the generated require variable name in API plugin
tests/rspack-test/configCases/library/esm-external/index.js Updates test assertion to check for new variable name
tests/rspack-test/configCases/externals/module-import/index.js Updates test assertion to check for new variable name
tests/rspack-test/configCases/library/modern-module-force-concaten/snapshot/f.js.txt Updates snapshot with new variable names
tests/rspack-test/esmOutputCases/externals/externals-aliased/snapshots/esm.snap.txt Updates snapshot with new variable names
tests/rspack-test/esmOutputCases/externals/aliased/snapshots/esm.snap.txt Updates snapshot with new variable names
tests/rspack-test/esmOutputCases/dynamic-import/magic-comment/snapshots/esm.snap.txt Updates snapshot with new variable names

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

@github-actions
Copy link
Contributor

📦 Binary Size-limit

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

❌ Size increased by 4.00KB from 47.63MB to 47.63MB (⬆️0.01%)

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 21, 2025

CodSpeed Performance Report

Merging #12263 will not alter performance

Comparing rename_reexports_1121 (cb50e70) with main (4746bb1)

Summary

✅ 17 untouched

@chenjiahan chenjiahan merged commit ca1a20f into main Nov 22, 2025
47 checks passed
@chenjiahan chenjiahan deleted the rename_reexports_1121 branch November 22, 2025 08:12
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