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: context module elimated #3151

Merged
merged 4 commits into from
May 18, 2023
Merged

fix: context module elimated #3151

merged 4 commits into from
May 18, 2023

Conversation

IWANABETHATGUY
Copy link
Contributor

@IWANABETHATGUY IWANABETHATGUY commented May 15, 2023

Related issue (if exists)

Summary

馃 Generated by Copilot at cc8830d

This pull request improves the tree-shaking optimization for context modules in rspack_core and adds a new test case for it in rspack_plugin_javascript. It also fixes a minor inconsistency in the mut function and a typo in optimizer.rs.

Walkthrough

馃 Generated by Copilot at cc8830d

  • Fix a bug that causes context entry modules to be included in the bundle even if they are not reachable from the entry modules by removing them from the initial queue of reachable modules in optimize function (link)
  • Improve the tree-shaking optimization for context modules by analyzing their actual dependencies instead of treating them as external modules in optimize function (link)
  • Add a test case for tree-shaking context modules that are dynamically required or imported based on a variable in crates/rspack/tests/tree-shaking/context-module-elimated folder (link, link, link, link, link, link, link)
  • Use the enable method instead of the is_true method for the builtin_tree_shaking option in mut function for consistency and clarity (link)
  • Fix a typo in the optimize function to use the correct variable name module_identifier instead of module_ident for consistency and readability (link)
  • Add a debug statement to the optimize function to print the current module identifier being processed by the queue for debugging purposes (link)
  • Remove an empty line from the optimize function for formatting and style (link)

@github-actions github-actions bot added release: bug fix team The issue/pr is created by the member of Rspack. labels May 15, 2023
@IWANABETHATGUY
Copy link
Contributor Author

!canary

@IWANABETHATGUY IWANABETHATGUY force-pushed the fix/context-module-elimated branch 2 times, most recently from ed46797 to e3281d6 Compare May 18, 2023 08:11
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review May 18, 2023 08:11
@underfin underfin added this pull request to the merge queue May 18, 2023
@IWANABETHATGUY
Copy link
Contributor Author

!canary

Merged via the queue into main with commit 0a31024 May 18, 2023
13 checks passed
@underfin underfin deleted the fix/context-module-elimated branch May 18, 2023 09:34
@github-actions
Copy link
Contributor

Packages: {
"@rspack/binding-darwin-arm64": "0.0.0-canary-c568a67-20230518102709",
"@rspack/binding-darwin-x64": "0.0.0-canary-c568a67-20230518102709",
"@rspack/binding-linux-x64-gnu": "0.0.0-canary-c568a67-20230518102709",
"@rspack/binding-win32-x64-msvc": "0.0.0-canary-c568a67-20230518102709",
"@rspack/binding": "0.0.0-canary-c568a67-20230518102709",
"@rspack/cli": "0.0.0-canary-c568a67-20230518102709",
"@rspack/core": "0.0.0-canary-c568a67-20230518102709",
"@rspack/dev-client": "0.0.0-canary-c568a67-20230518102709",
"@rspack/dev-middleware": "0.0.0-canary-c568a67-20230518102709",
"@rspack/dev-server": "0.0.0-canary-c568a67-20230518102709",
"@rspack/plugin-html": "0.0.0-canary-c568a67-20230518102709",
"@rspack/plugin-minify": "0.0.0-canary-c568a67-20230518102709",
"@rspack/plugin-node-polyfill": "0.0.0-canary-c568a67-20230518102709",
"@rspack/postcss-loader": "0.0.0-canary-c568a67-20230518102709"
}

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.

None yet

2 participants