Skip to content

Conversation

@LingyuCoder
Copy link
Contributor

@LingyuCoder LingyuCoder commented Nov 11, 2025

Summary

Rename some class and static variables, remove webpack in them.

Related links

Checklist

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

Copilot AI review requested due to automatic review settings November 11, 2025 06:01
@netlify
Copy link

netlify bot commented Nov 11, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 458ec96
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6912d27f803c5f0008c9186e

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 naming across the rspack codebase to improve consistency by removing "webpack" prefixes and replacing them with more generic or rspack-specific names. The main focus is on renaming classes, constants, and static variables to better reflect their purpose or to align with rspack branding.

Key Changes

  • Renamed runtime globals from SYSTEM_CONTEXT to API_SYSTEM_CONTEXT
  • Renamed module/file from export_webpack_require to export_require
  • Renamed expression name constants from IMPORT_META_WEBPACK_* to more concise names
  • Renamed magic comment infrastructure from webpack_comment to magic_comment
  • Renamed dependency types and templates from WebpackIsIncluded to IsIncluded
  • Renamed various API-related constants to use API_ prefix consistently

Reviewed Changes

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

Show a summary per file
File Description
crates/rspack_plugin_runtime/src/runtime_plugin.rs Updated reference to API_SYSTEM_CONTEXT runtime global
crates/rspack_plugin_runtime/src/runtime_module/system_context.rs Updated runtime global reference in code generation
crates/rspack_plugin_runtime/src/runtime_module/mod.rs Renamed module and export from export_webpack_require to export_require
crates/rspack_plugin_runtime/src/runtime_module/export_require.rs Renamed struct and constant identifiers
crates/rspack_plugin_runtime/src/module_chunk_loading.rs Updated import and usage of renamed runtime module
crates/rspack_plugin_runtime/src/lib.rs Updated public export of renamed constant
crates/rspack_plugin_rstest/src/import_dependency.rs Renamed constant from WEBPACK_REQUIRE_IMPORT_ACTUAL to REQUIRE_IMPORT_ACTUAL
crates/rspack_plugin_lazy_compilation/src/plugin.rs Renamed regex static from WEBPACK_DEV_SERVER_CLIENT_RE to DEV_SERVER_CLIENT_RE
crates/rspack_plugin_javascript/src/visitors/dependency/util.rs Renamed expression name constants to remove redundant "webpack" prefix
crates/rspack_plugin_javascript/src/visitors/dependency/parser/mod.rs Updated plugin name from WebpackIsIncludedPlugin to IsIncludedPlugin
crates/rspack_plugin_javascript/src/plugin/mod.rs Renamed variables from webpack_exports_* to rspack_exports_*
crates/rspack_plugin_javascript/src/plugin/impl_plugin_for_js_plugin.rs Updated dependency template imports and registrations
crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs Updated magic comment extraction function name and method calls
crates/rspack_plugin_javascript/src/parser_plugin/url_plugin.rs Updated magic comment imports and usage
crates/rspack_plugin_javascript/src/parser_plugin/mod.rs Renamed plugin module and exports from webpack_included_plugin to is_included_plugin
crates/rspack_plugin_javascript/src/parser_plugin/is_included_plugin.rs Renamed plugin struct and constant
crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs Updated magic comment function calls and simplified method names
crates/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs Renamed method and updated expression name constants
crates/rspack_plugin_javascript/src/parser_plugin/import_meta_context_dependency_parser_plugin.rs Updated expression name constant references
crates/rspack_plugin_javascript/src/parser_plugin/hot_module_replacement_plugin.rs Updated expression name constant references
crates/rspack_plugin_javascript/src/parser_plugin/exports_info_api_plugin.rs Renamed constant from WEBPACK_EXPORTS_INFO to EXPORTS_INFO
crates/rspack_plugin_javascript/src/parser_plugin/esm_export_dependency_parser_plugin.rs Updated tag constant reference
crates/rspack_plugin_javascript/src/parser_plugin/esm_detection_parser_plugin.rs Renamed enum variants from WebpackExports/WebpackModule to RspackExports/RspackModule
crates/rspack_plugin_javascript/src/parser_plugin/define_plugin/utils.rs Renamed regex and identifier constants
crates/rspack_plugin_javascript/src/parser_plugin/const/mod.rs Renamed resource fragment/query constants
crates/rspack_plugin_javascript/src/parser_plugin/compatibility_plugin.rs Renamed nested identifier tag constant
crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs Updated magic comment function calls and method name
crates/rspack_plugin_javascript/src/parser_plugin/api_plugin.rs Renamed all API-related constants to use API_ prefix
crates/rspack_plugin_javascript/src/magic_comment.rs Renamed from webpack_comment.rs, updated all types and functions
crates/rspack_plugin_javascript/src/lib.rs Renamed module from webpack_comment to magic_comment
crates/rspack_plugin_javascript/src/dependency/is_included_dependency.rs Renamed dependency and template types
crates/rspack_plugin_esm_library/src/render.rs Updated constant import reference
crates/rspack_core/src/runtime_globals.rs Renamed runtime global constant and its name mapping
crates/rspack_core/src/normal_module_factory.rs Renamed function from match_webpack_ext to match_ext
crates/rspack_core/src/module.rs Renamed enum variants from WebpackModule/WebpackExports to RspackModule/RspackExports
crates/rspack_core/src/dependency/dependency_type.rs Renamed dependency type variant and its display string
crates/rspack_core/src/context_module.rs Renamed chunk name placeholder constants
crates/rspack_binding_api/src/source.rs Renamed function from to_webpack_map to to_map
crates/rspack_binding_api/src/runtime.rs Updated runtime global declaration

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

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

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

Comments suppressed due to low confidence (2)

crates/rspack_plugin_javascript/src/parser_plugin/is_included_plugin.rs:11

  • The constant name IS_INCLUDED was renamed from WEBPACK_IS_INCLUDED, but the value still contains "webpack": "__webpack_is_included__". For consistency with the renaming effort, consider either:
  1. Updating the value to remove the "webpack" reference (e.g., "__is_included__"), or
  2. Reverting the constant name to WEBPACK_IS_INCLUDED to match the value.

This inconsistency could cause confusion between the constant name and its value.
crates/rspack_plugin_runtime/src/runtime_module/export_require.rs:9

  • The runtime module identifier still uses the old path "webpack/runtime/export_webpack_require". Since the module was renamed to ExportRequireRuntimeModule and the constant to EXPORT_REQUIRE_RUNTIME_MODULE_ID, the identifier path should likely be updated to "webpack/runtime/export_require" for consistency. This could affect module resolution or caching if the identifier is used as a key.

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

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 458ec96 to refactor: render runtime globals with runtime template (#12144) by harpsealjs

❌ Size increased by 4.75KB from 48.09MB to 48.09MB (⬆️0.01%)

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 11, 2025

CodSpeed Performance Report

Merging #12145 will not alter performance

Comparing refactor/rename-webpack-class (458ec96) with main (f70f870)

Summary

✅ 17 untouched

@LingyuCoder LingyuCoder enabled auto-merge (squash) November 11, 2025 08:39
@LingyuCoder LingyuCoder merged commit d281117 into main Nov 11, 2025
78 of 80 checks passed
@LingyuCoder LingyuCoder deleted the refactor/rename-webpack-class branch November 11, 2025 08:48
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.

3 participants