Skip to content

refactor: rename webpack imported vars to rspack format#12245

Merged
chenjiahan merged 3 commits intomainfrom
rename_import_var_1120
Nov 20, 2025
Merged

refactor: rename webpack imported vars to rspack format#12245
chenjiahan merged 3 commits intomainfrom
rename_import_var_1120

Conversation

@chenjiahan
Copy link
Member

Summary

Update import variable naming convention from WEBPACK_IMPORTED_MODULE to rspack_import.

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 20, 2025 03:07
@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: refactor labels Nov 20, 2025
@netlify
Copy link

netlify bot commented Nov 20, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 3978fab
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/691e85e0fd2370000897008d
😎 Deploy Preview https://deploy-preview-12245--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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 refactors the import variable naming convention from webpack's WEBPACK_IMPORTED_MODULE format to rspack's rspack_import format, aligning with the discussion in #12244.

  • Renames all imported module variables from *__WEBPACK_IMPORTED_MODULE_N__ to *__rspack_import_N__
  • Updates core code generation logic in the compilation module and wasm plugin
  • Updates all test snapshots to reflect the new naming convention

Reviewed Changes

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

Show a summary per file
File Description
crates/rspack_core/src/compilation/mod.rs Updates core import variable generation logic to use rspack_import format
crates/rspack_plugin_wasm/src/parser_and_generator.rs Updates wasm module import variable naming to rspack_import format
website/docs/en/config/externals.mdx Updates documentation example with new import variable names
website/docs/zh/config/externals.mdx Updates Chinese documentation example with new import variable names
tests/rspack-test/treeShakingCases/**/*.snap.txt Updates tree shaking test snapshots with new naming convention
tests/rspack-test/hotCases/**/*.snap.txt Updates hot module replacement test snapshots
tests/rspack-test/builtinCases/**/*.snap.txt Updates builtin test case snapshots
tests/rspack-test/configCases/**/*.js Updates config test cases to match new import variable format
tests/rspack-test/esmOutputCases/**/*.snap.txt Updates ESM output test snapshots
tests/rspack-test/statsOutputCases/**/*.snap.txt Updates stats output test snapshots
tests/rspack-test/hookCases/**/*.snap.txt Updates hook test case snapshots

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

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 3978fab to chore(deps): update patch npm dependencies (#12242) by renovate[bot]

🙈 Size remains the same at 47.62MB

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 20, 2025

CodSpeed Performance Report

Merging #12245 will not alter performance

Comparing rename_import_var_1120 (3978fab) with main (b6ebb41)

Summary

✅ 17 untouched

@chenjiahan chenjiahan enabled auto-merge (squash) November 20, 2025 03:24
@chenjiahan chenjiahan merged commit 7d5c56d into main Nov 20, 2025
56 checks passed
@chenjiahan chenjiahan deleted the rename_import_var_1120 branch November 20, 2025 03:26
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