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

Investigate breaks in experiments for webpack on performance-benchmark. #17036

Closed
TheLarkInn opened this issue Apr 20, 2023 · 12 comments
Closed
Assignees

Comments

@TheLarkInn
Copy link
Member

  1. Fork or clone: https://github.com/TheLarkInn/performance-compare
  2. Add experments.futureDefaults & experiments.lazyCompilation to both babel and swc webpack configurations
  3. Run the individual start command npm run start:webpack
  4. Open the dev server link

Expected Output:

  • webpack dev mode loads the page just like all the other benchmarks do

Actual Outcome:

  • Console errors related to lazyCompilation
    image

  • Console errors related to futureDefaults
    image

@TheLarkInn
Copy link
Member Author

I believe since there isn't many integrations that this is caused by: https://github.com/pmmmwh/react-refresh-webpack-plugin

@alexander-akait
Copy link
Member

@TheLarkInn Is it broken?

@TheLarkInn
Copy link
Member Author

I think this plugin breaks when used with experiments.futureDefaults and experiments.lazyCompilation. We can reduce further if needed but the original repo should be enough to triage I think. cc @pmmmwh

@TheLarkInn
Copy link
Member Author

My concern is that this is a very popular plugin for webpack+react users so we should prioritize futureproofing finding the bugs in the plugin for when we enable these future defaults and features.

@alexander-akait
Copy link
Member

Yeah, agree

@hardfist
Copy link
Contributor

hardfist commented Jul 3, 2023

@TheLarkInn @alexander-akait
I'm digging this issue to investigate how fast webpack rebuild can become, and find it's the experiments.css:true and node.global:warn cause the runtime error and warning.
this config works on my machine

module.exports = 
{
   node: {
    global: false,
  },
  experiments: {
    css:false,
    futureDefaults:true
  }
}

related MR web-infra-dev/performance-compare#3

the performance gain is shown in the following

  • before
    image

  • after
    image

I'm wondering are there any configuration could improve rebuild performance of webpack, the problems we met in rspack when following webpack's rebuild strategy is that it seems the rebuild cost is linear to project's scale (related to module number and chunk number), so we take another approach like parcel's parcel-bundler/parcel#6047 which is faster in some normal edit case.

sapphi-red added a commit to sapphi-red/performance-compare that referenced this issue Aug 31, 2023
See webpack/webpack#17036 (comment)

Co-Authored-By: hardfist <1562502418@qq.com>
@webpack-bot
Copy link
Contributor

This issue had no activity for at least three months.

It's subject to automatic issue closing if there is no activity in the next 15 days.

@pmmmwh
Copy link

pmmmwh commented Oct 2, 2023

Bump - I'll try to investigate this soon and hopefully we can figure out what's wrong

@alexander-akait
Copy link
Member

bump

@hardfist
Copy link
Contributor

hardfist commented Jan 5, 2024

@alexander-akait I investigated it before, it's not related to react-refresh-webpack-plugin, it's caused by futureDefault enable experiments.css by default which conflicts with style-loader, so disable experiments.css could solve this

@alexander-akait
Copy link
Member

@hardfist oh, thank you, I think we need to send a fix there

@webpack-bot
Copy link
Contributor

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Priority - Low
Development

No branches or pull requests

5 participants