Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors entry/entrypoint naming across rspack_core and multiple plugins/bindings to use Arc<str> instead of String, aiming to reduce cloning/allocation overhead and align entry-name handling across the chunk graph and related APIs.
Changes:
- Switch compilation
Entriesand chunk-graphentrypoints/named_chunk_groupsmaps toArc<str>keys. - Update plugins and core utilities to accept/compare
Arc<str>entry names (usingas_ref()/as_str()as needed). - Adjust binding-layer conversions to continue exposing strings where required (e.g., JS-facing structs/DTOs).
Reviewed changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_plugin_size_limits/src/lib.rs | Accept entrypoint name refs as &Arc<str> when building diagnostics. |
| crates/rspack_plugin_rsdoctor/src/data.rs | Store rsdoctor entrypoint name as Arc<str>. |
| crates/rspack_plugin_rsdoctor/src/chunk_graph.rs | Update rsdoctor collection helpers to consume IndexMap<Arc<str>, ...>. |
| crates/rspack_plugin_rsc/src/server_plugin.rs | Remove redundant entry-name cloning; pass Arc<str> through entry options. |
| crates/rspack_plugin_rsc/src/manifest_runtime_module.rs | Avoid converting entry option name into a new Arc (now already Arc<str>). |
| crates/rspack_plugin_rsc/src/hot_reloader.rs | Remove redundant entry-name cloning in change tracking loop. |
| crates/rspack_plugin_rsc/src/client_plugin.rs | Use as_ref() for Arc<str> entry-name lookups in plugin state. |
| crates/rspack_plugin_mf/src/sharing/shared_container_plugin.rs | Store MF container name as Arc<str> and compare via as_ref(). |
| crates/rspack_plugin_mf/src/manifest/utils.rs | Update entrypoint-name comparisons/substring checks for Arc<str>. |
| crates/rspack_plugin_mf/src/manifest/mod.rs | Build entry_point_names from Arc<str> entrypoint keys for filtering. |
| crates/rspack_plugin_mf/src/manifest/asset.rs | Update entrypoint-name skip checks to use name.as_ref(). |
| crates/rspack_plugin_mf/src/container/container_plugin.rs | Store container plugin option name as Arc<str> and compare via as_ref(). |
| crates/rspack_plugin_mf/src/container/container_entry_module.rs | Store module name as Arc<str> and adapt group-options name handling. |
| crates/rspack_plugin_mf/src/container/container_entry_dependency.rs | Store dependency name as Arc<str> and update constructors. |
| crates/rspack_plugin_javascript/src/parser_plugin/worker_plugin.rs | Convert entry option name to Arc<str> when creating EntryOptions. |
| crates/rspack_plugin_javascript/src/parser_plugin/require_ensure_dependencies_block_parse_plugin.rs | Convert chunk-group name to Arc<str> when setting options. |
| crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs | Convert dynamic-import chunk-group names to Arc<str>. |
| crates/rspack_plugin_html/src/asset.rs | Adapt entrypoint filtering and lookup to Arc<str> entrypoint keys. |
| crates/rspack_plugin_extract_css/src/plugin.rs | Convert chunk-group name Arc<str> to String for display/join. |
| crates/rspack_plugin_esm_library/src/preserve_modules.rs | Convert entry name keys from Arc<str> to String for map output. |
| crates/rspack_plugin_dll/src/dll_entry/dll_module.rs | Store DLL module name as Arc<str>. |
| crates/rspack_plugin_dll/src/dll_entry/dll_entry_plugin.rs | Store DLL entry plugin option name as Arc<str>. |
| crates/rspack_plugin_dll/src/dll_entry/dll_entry_dependency.rs | Store DLL entry dependency name as Arc<str>. |
| crates/rspack_plugin_circular_dependencies/src/lib.rs | Convert entrypoint name to String at call sites after entry-name type change. |
| crates/rspack_core/src/utils/runtime.rs | Update get_entry_runtime to accept &Entries and lookup by &str. |
| crates/rspack_core/src/stats/utils.rs | Adapt chunk-group name handling for Option<&Arc<str>>. |
| crates/rspack_core/src/runtime_template.rs | Map group-options name Arc<str> to &str for comment rendering. |
| crates/rspack_core/src/runtime.rs | Adapt from_entry_options for EntryOptions.name: Option<Arc<str>>. |
| crates/rspack_core/src/options/entry.rs | Rename Entry to Entries and change key type to Arc<str>. |
| crates/rspack_core/src/context_module.rs | Convert chunk-group option names to Arc<str> and borrow as &str when needed. |
| crates/rspack_core/src/compilation/mod.rs | Update compilation entries storage and entrypoints API to Arc<str> keys. |
| crates/rspack_core/src/compilation/build_chunk_graph/incremental.rs | Update entry recreation bookkeeping for Arc<str> names and borrowed lookups. |
| crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs | Use Arc<str> for named chunk-group bookkeeping and entrypoint insertion. |
| crates/rspack_core/src/chunk_group.rs | Change EntryOptions.name/ChunkGroupOptions.name to Arc<str> and expose Option<&Arc<str>> name accessors. |
| crates/rspack_core/src/chunk_graph/mod.rs | Borrow &str from Arc<str> when formatting DOT output. |
| crates/rspack_core/src/artifacts/build_chunk_graph_artifact.rs | Store entrypoints and named_chunk_groups with Arc<str> keys. |
| crates/rspack_binding_api/src/rsdoctor.rs | Convert Arc<str> rsdoctor entrypoint name back to String for JS. |
| crates/rspack_binding_api/src/raw_options/raw_builtins/raw_mf.rs | Convert raw MF names into Arc<str> for core/plugin options. |
| crates/rspack_binding_api/src/raw_options/raw_builtins/raw_dll.rs | Convert raw DLL entry name into Arc<str>. |
| crates/rspack_binding_api/src/options/entry.rs | Convert JS entry option name into Arc<str>. |
| crates/rspack_binding_api/src/compilation/mod.rs | Return named chunk-group keys borrowed from Arc<str> keys and lookup via as_str(). |
| crates/rspack_binding_api/src/compilation/entries.rs | Return entry option names / entry keys as &str backed by Arc<str>, and insert keys via into(). |
| crates/rspack/src/builder/mod.rs | Convert builder entry option name into Arc<str>. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff Analysis
Found 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
❌ Size increased by 43.38KB from 49.00MB to 49.04MB (⬆️0.09%) |
Merging this PR will not alter performance
Comparing Footnotes
|
Deploying rspack with
|
| Latest commit: |
7949b14
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e33bf742.rspack-v2.pages.dev |
| Branch Preview URL: | https://refactor-entry-name.rspack-v2.pages.dev |
c7bd07d to
01e3021
Compare
Summary
This PR refactors entry/entrypoint naming across
rspack_coreand multiple plugins/bindings to useArc<str>instead ofString, aiming to reduce cloning/allocation overhead and align entry-name handling across the chunk graph and related APIs.Related links
Checklist