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

[Tracking]: affected-based incremental rebuild #8106

Open
ahabhgk opened this issue Oct 14, 2024 · 2 comments · Fixed by #8311
Open

[Tracking]: affected-based incremental rebuild #8106

ahabhgk opened this issue Oct 14, 2024 · 2 comments · Fixed by #8311
Assignees
Labels
team The issue/pr is created by the member of Rspack. tracking issue Category: A tracking issue for an RFC or an unstable feature.

Comments

@ahabhgk
Copy link
Contributor

ahabhgk commented Oct 14, 2024

RFC: #8243
Docs: https://rspack.dev/config/experiments#experimentsincremental

This issue tracks the progress of affected-based incremental rebuild:

  • proof of concept, implement for some passes
  • more tests, enable for bytedance internal projects, stabilize for some passes (👈 we are here)
  • stabilize all passes and enable by default

The passes we planned to support:

Currently you can enable this by experiments.incremental = isDev, feel free to report bugs to us.

@ahabhgk ahabhgk added the tracking issue Category: A tracking issue for an RFC or an unstable feature. label Oct 14, 2024
@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Oct 14, 2024
@chenjiahan
Copy link
Member

chenjiahan commented Nov 1, 2024

Bug Report

experiments.incremental breaks the production build (Rspack v1.1.0-beta.0):

Image

Reproduction steps

  1. Clone https://github.com/rspack-contrib/performance-compare
  2. pnpm i
  3. enable experiments.incremental in rsbuild.config.js
export default defineConfig({
  plugins: [pluginReact()],
  tools: {
    rspack: {
      experiments: {
        incremental: true,
      },
    },
  },
});
  1. pnpm run build:rsbuild

Workaround

Only enable experiments.incremental in dev mode:

export default defineConfig({
  plugins: [pluginReact()],
  tools: {
    rspack: {
      experiments: {
        incremental: process.env.NODE_ENV === "development",
      },
    },
  },
});

@ahabhgk
Copy link
Contributor Author

ahabhgk commented Nov 1, 2024

@chenjiahan This should be fixed by #8311, after further consideration I think we should recommend user to only enable this in development mode, since in production build incremental can't be used with optimization.concatenateModules/usedExports/mangleExports together, on Rspack side only thing we can do is overriding to false and log warnings, so now if user use incremental: true they will get warnings and won't have a panic, if user use incremental: isDev they won't have panic and warnings. Related docs is also updated in this PR.

@chenjiahan chenjiahan reopened this Nov 1, 2024
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. tracking issue Category: A tracking issue for an RFC or an unstable feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants