Skip to content

chore: entry change to arc str#13327

Draft
SyMind wants to merge 11 commits intomainfrom
refactor-entry-name
Draft

chore: entry change to arc str#13327
SyMind wants to merge 11 commits intomainfrom
refactor-entry-name

Conversation

@SyMind
Copy link
Copy Markdown
Member

@SyMind SyMind commented Mar 12, 2026

Summary

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.

Related links

Checklist

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

Copilot AI review requested due to automatic review settings March 12, 2026 10:44
@github-actions github-actions Bot added the team The issue/pr is created by the member of Rspack. label Mar 12, 2026
@SyMind SyMind marked this pull request as draft March 12, 2026 10:48
Copy link
Copy Markdown
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 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 Entries and chunk-graph entrypoints/named_chunk_groups maps to Arc<str> keys.
  • Update plugins and core utilities to accept/compare Arc<str> entry names (using as_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.

Comment thread crates/rspack_core/src/runtime.rs Outdated
Comment thread crates/rspack_plugin_html/src/asset.rs Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 12, 2026

Rsdoctor Bundle Diff Analysis

⚠️ Note: The latest commit (9752c3177d) does not have baseline artifacts. Using commit f294667ab5 for baseline comparison instead. If this seems incorrect, please wait a few minutes and try rerunning the workflow.

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB 0
react-1k 826.2 KB 0
react-5k 2.7 MB 0
ui-components 2.3 MB 0
rome 984.2 KB 0

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 12, 2026

📦 Binary Size-limit

Comparing 7949b14 to chore: enable enableGlobalVirtualStore for pnpm (#13363) by hardfist

❌ Size increased by 43.38KB from 49.00MB to 49.04MB (⬆️0.09%)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 12, 2026

Merging this PR will not alter performance

✅ 16 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing refactor-entry-name (7949b14) with main (f294667)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (74775a8) during the generation of this report, so f294667 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@web-infra-dev web-infra-dev deleted a comment from github-actions Bot Mar 13, 2026
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 13, 2026

Deploying rspack with  Cloudflare Pages  Cloudflare Pages

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

View logs

@SyMind SyMind force-pushed the refactor-entry-name branch from c7bd07d to 01e3021 Compare March 13, 2026 08:51
@SyMind SyMind marked this pull request as ready for review March 13, 2026 09:19
@SyMind SyMind requested a review from JSerFeng as a code owner March 13, 2026 09:19
@SyMind SyMind marked this pull request as draft March 13, 2026 09:41
@SyMind SyMind marked this pull request as ready for review March 13, 2026 10:07
@SyMind SyMind marked this pull request as draft March 13, 2026 10:15
ahabhgk
ahabhgk previously approved these changes Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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