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

fix: use incremental in production build #8311

Merged
merged 4 commits into from
Nov 1, 2024
Merged

fix: use incremental in production build #8311

merged 4 commits into from
Nov 1, 2024

Conversation

ahabhgk
Copy link
Contributor

@ahabhgk ahabhgk commented Nov 1, 2024

Summary

fix #8106 (comment)

Before using incremental: true will panic in production build, caused by concatenateModules, this is expected but we should have better experience, so this PR will disable incremental.moduleHashes/moduleCodegen/moduleRuntimeRequirements when using with concatenateModules/usedExports/mangleExports, and log warnings.

And the docs is also updated to recommend user to only enable incremental in development mode.

Checklist

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

@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Nov 1, 2024
Copy link

netlify bot commented Nov 1, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 601efc8
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/6724c016270923000819f929

@ahabhgk ahabhgk enabled auto-merge (squash) November 1, 2024 11:48
Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

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

LGTM 👍

When incremental becomes more stable, we can provide more optimal defaults to reduce the burden on users to understand these configurations.

@ahabhgk ahabhgk merged commit 1161016 into main Nov 1, 2024
29 checks passed
@ahabhgk ahabhgk deleted the inc-fix-prod branch November 1, 2024 13:48
@slorber
Copy link

slorber commented Nov 14, 2024

I tried incremental true in facebook/docusaurus#10648

I got the following warnings, despite not configuring usedExports.

<w> [rspack.FlagDependencyUsagePlugin] `optimization.usedExports` can't be used with `incremental.modulesHashes` as export usage is a global effect. `incremental.modulesHashes` has been overridden to false.
<w> [rspack.FlagDependencyUsagePlugin] `optimization.usedExports` can't be used with `incremental.modulesCodegen` as export usage is a global effect. `incremental.modulesCodegen` has been overridden to false.
<w> [rspack.FlagDependencyUsagePlugin] `optimization.usedExports` can't be used with `incremental.modulesRuntimeRequirements` as export usage is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false.
<w> [rspack.FlagDependencyUsagePlugin] `optimization.usedExports` can't be used with `incremental.modulesHashes` as export usage is a global effect. `incremental.modulesHashes` has been overridden to false.
<w> [rspack.FlagDependencyUsagePlugin] `optimization.usedExports` can't be used with `incremental.modulesCodegen` as export usage is a global effect. `incremental.modulesCodegen` has been overridden to false.
<w> [rspack.FlagDependencyUsagePlugin] `optimization.usedExports` can't be used with `incremental.modulesRuntimeRequirements` as export usage is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false.

The error doesn't make it super clear to understand what is happening and what I should do.

Rereading the docs/blog post it's quite obvious: I'll disable this in prod builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tracking]: affected-based incremental rebuild
3 participants