Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: entry startup for target node #3006

Merged
merged 1 commit into from
May 4, 2023
Merged

fix: entry startup for target node #3006

merged 1 commit into from
May 4, 2023

Conversation

underfin
Copy link
Collaborator

@underfin underfin commented May 4, 2023

Related issue (if exists)

close #2995

Summary

  • commonjs startup needs runtime to load other initial chunks, so it is different from jsonp.

馃 Generated by Copilot at 10402b0

This pull request adds new features and fixes to the rspack project, which is a Rust-based web packer. It introduces new plugins and runtime modules to handle the dependencies and entry points of chunks that are loaded by different chunk loading types. It also adds new functions and variables to the rspack_core crate to support the new plugins and runtime modules. It updates the rspack_plugin_javascript and the rspack_binding_options crates to use the new plugins and runtime modules. It also adds a changeset file for the @rspack/core package with a patch version bump and a fix message.

Walkthrough

馃 Generated by Copilot at 10402b0

  • Add a changeset file for the @rspack/core package with a patch version bump and a fix message (link)
  • Implement the StartupChunkDependenciesPlugin struct that modifies the runtime requirements and the runtime modules for the chunks that have entry dependent chunks (link, link, link)
  • Implement the StartupChunkDependenciesRuntimeModule struct that ensures that the entry dependent chunks are loaded before the startup function is executed (link, link, link, link)
  • Implement the StartupEntrypointRuntimeModule struct that defines the startup function for the chunk (link, link, link, link, link)
  • Add two new functions to the ChunkGraph struct that check and return the entry dependent chunks of a given chunk (link)
  • Modify the JavascriptPlugin struct to handle the new runtime requirements and generate the source code for the startup function of a chunk (link, link, link)
  • Modify the CommonJsChunkLoadingPlugin struct to add a new runtime requirement for the entry point chunks (link)
  • Modify the GetChunkFilenameRuntimeModule struct to handle the new runtime requirement for including the entry dependent chunks in the chunk ids array (link)
  • Add a commented-out function stub for get_all_referenced_async_entry_points in the Chunk struct (link)
  • Modify the Some function in the rspack_binding_options crate to add a new plugin for the require and import-scripts chunk loading types (link)
  • Add three new constants to the RuntimeGlobals enum and their corresponding cases to the to_string method (link, link)

@changeset-bot
Copy link

changeset-bot bot commented May 4, 2023

馃 Changeset detected

Latest commit: b644018

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@rspack/core Patch
@rspack/cli Patch
@rspack/dev-middleware Patch
@rspack/dev-server Patch
@rspack/plugin-html Patch
webpack-test Patch
benchmarkcase-rspack-react-refresh Patch
@rspack/postcss-loader Patch
@rspack/dev-client Patch
@rspack/plugin-minify Patch
@rspack/plugin-node-polyfill Patch
@rspack/binding-darwin-arm64 Patch
@rspack/binding-darwin-x64 Patch
@rspack/binding-linux-x64-gnu Patch
@rspack/binding-win32-x64-msvc Patch
@rspack/binding Patch
@rspack/fs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label May 4, 2023
@underfin underfin added this pull request to the merge queue May 4, 2023
Merged via the queue into main with commit b452de5 May 4, 2023
17 checks passed
@underfin underfin deleted the fix-node-startup branch May 4, 2023 08:40
This was referenced May 9, 2023
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.

support to use splittingChunks with initial chunks while target: node
2 participants