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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: add experimental support for importModule #737

Merged
merged 6 commits into from Apr 16, 2021

Conversation

sokra
Copy link
Member

@sokra sokra commented Apr 12, 2021

This replaces the child compiler with a
lightweight execution of modules within
the module graph of the original compilation

To try the new approach.

  • Use webpack >= 5.32.0
  • experimentalUseImportModule: true in MiniCssPlugin options
  • Avoid publicPath in MiniCssPlugin options, that doesn't work yet
  • Set a static output.publicPath in webpack options

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

child compiler take up too much memory and performance

Breaking Changes

none

Additional Info

Not all tests are passing yet with the new approach.
There is nothing to do in mini-css-extract-plugin to fix this.
Currently I think that are all webpack problems that I will fix eventually.
Biggest problem currently is that it breaks with HMR.

This replaces the child compiler with a
lightweight execution of modules within
the module graph of the original compilation
@codecov
Copy link

codecov bot commented Apr 12, 2021

Codecov Report

Merging #737 (a79fa7a) into master (a33f22f) will decrease coverage by 0.41%.
The diff coverage is 90.24%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #737      +/-   ##
==========================================
- Coverage   89.69%   89.27%   -0.42%     
==========================================
  Files           6        6              
  Lines         776      802      +26     
  Branches      240      247       +7     
==========================================
+ Hits          696      716      +20     
- Misses         77       83       +6     
  Partials        3        3              
Impacted Files Coverage Δ
src/index.js 87.94% <83.33%> (-0.09%) ⬇️
src/loader.js 90.36% <90.78%> (-2.06%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a33f22f...a79fa7a. Read the comment docs.

@sokra
Copy link
Member Author

sokra commented Apr 12, 2021

@vyobukhov https://github.com/vyobukhov/mini-css-memory-issues builds within --max-old-space-size=512 with this PR.

use old publicPath logic
add CI tests for experimentalUseImportModule
disable auxiliaryAssets test with experimentalUseImportModule
src/loader.js Outdated
);
return;
}
console.log(publicPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need avoid it 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Fixed

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need remove console.log and I think we can merge and release it

@sokra
Copy link
Member Author

sokra commented Apr 16, 2021

🚀

@alexander-akait alexander-akait merged commit 8471ac2 into master Apr 16, 2021
@alexander-akait alexander-akait deleted the feature/import-module branch April 16, 2021 15:24
@alexander-akait
Copy link
Member

I will do release tomorrow 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants