WIP test: enable lazy_compilation by default#5905
Draft
GiveMe-A-Name wants to merge 5 commits intomainfrom
Draft
WIP test: enable lazy_compilation by default#5905GiveMe-A-Name wants to merge 5 commits intomainfrom
GiveMe-A-Name wants to merge 5 commits intomainfrom
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enables lazy compilation by default in Rsbuild's development mode, changing from the previous configuration that only enabled imports but not entries. The change affects how modules are compiled during development, requiring extensive test updates to accommodate the new lazy loading behavior.
- Changed default lazy compilation configuration from selective (imports only) to full enablement
- Updated numerous E2E tests to wait for lazy-loaded content before assertions
- Added explicit lazy compilation disabling for specific tests that rely on immediate compilation
Reviewed Changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/defaultConfig.ts | Changed default lazy compilation from object config to true |
| e2e/cases/tailwindcss/hmr/index.test.ts | Added wait for DOM content before CSS assertions |
| e2e/cases/syntax/using-declaration/index.test.ts | Added wait for global variable before evaluation |
| e2e/cases/sri/enable-dev/src/index.js | Added global variable for test synchronization |
| e2e/cases/sri/enable-dev/index.test.ts | Added wait for global variable before assertions |
| e2e/cases/source/pre-entry/index.test.ts | Skipped test due to lazy compilation ordering issues |
| e2e/cases/server/ssr/rsbuild.config.ts | Explicitly disabled lazy compilation for SSR |
| e2e/cases/server/ssr/index.test.ts | Added lazy compilation disable in test config |
| e2e/cases/server/public-dir-with-template/index.test.ts | Added wait for DOM element before assertions |
| e2e/cases/server/public-dir-with-multi-template/index.test.ts | Changed DOM queries to wait for elements |
| e2e/cases/server/proxy/project1/src/index.js | Added global variable for test synchronization |
| e2e/cases/server/proxy/index.test.ts | Added wait for global variable before assertions |
| e2e/cases/server/history-api-fallback/src/App.jsx | Added ID to DOM element for better test targeting |
| e2e/cases/server/history-api-fallback/historyApiFallback.test.ts | Updated selectors and added waits for lazy content |
| e2e/cases/plugin-stylus/raw-query/index.test.ts | Added wait for multiple global variables |
| e2e/cases/plugin-stylus/inline-query/index.test.ts | Added wait for multiple global variables |
| e2e/cases/plugin-sass/raw-query/index.test.ts | Added wait for multiple global variables |
| e2e/cases/plugin-sass/inline-query/index.test.ts | Added wait for multiple global variables |
| e2e/cases/plugin-less/raw-query/index.test.ts | Added wait for global variables |
| e2e/cases/plugin-less/inline-query/index.test.ts | Added wait for global variables |
| e2e/cases/plugin-api/plugin-hooks/src/index.js | Added global variable for test synchronization |
| e2e/cases/plugin-api/plugin-hooks/index.test.ts | Added wait and updated expected hook sequence |
| e2e/cases/plugin-api/plugin-hooks-environment/src/index.js | Added global variable for test synchronization |
| e2e/cases/plugin-api/plugin-hooks-environment/index.test.ts | Added wait and updated expected hook sequences |
| e2e/cases/output/source-map/index.test.ts | Updated to handle async chunk source maps |
| e2e/cases/output/manifest-environment/index.test.ts | Updated expected file count for lazy chunks |
| e2e/cases/output/inline-chunk/index.test.ts | Updated CSS selectors for lazy-generated filenames |
| e2e/cases/output/charset/index.test.ts | Updated file path expectations for async chunks |
| e2e/cases/mode/basic/index.test.ts | Updated file matching patterns for lazy chunks |
| e2e/cases/minify/js-minify-always/src/index.js | Changed console.log to global variable assignment |
| e2e/cases/minify/js-minify-always/index.test.ts | Updated test for new global variable and file patterns |
| e2e/cases/minify/css-minify/index.test.ts | Added wait for CSS requests |
| e2e/cases/minify/css-minify-inherit/index.test.ts | Updated CSS file paths for async chunks |
| e2e/cases/live-reload/index.test.ts | Disabled lazy compilation for live reload test |
| e2e/cases/hmr/error-recovery/src/App.tsx | Modified test content |
| e2e/cases/hmr/error-recovery/index.test.ts | Skipped test due to HMR issues with lazy compilation |
| e2e/cases/css/raw-query/index.test.ts | Added wait for global variables |
| e2e/cases/css/lightningcss-prefixes/index.test.ts | Updated CSS file path for async chunks |
| e2e/cases/css/inline-query/index.test.ts | Added wait for global variables |
| e2e/cases/css/export-type-string/index.test.ts | Added wait for global variable |
| e2e/cases/css/css-layers/index.test.ts | Added wait for CSS requests |
| e2e/cases/cli/reload-env/index.test.ts | Skipped test and updated file path |
| e2e/cases/assets/raw-query/index.test.ts | Added waits for global variables across multiple tests |
| dev: { | ||
| liveReload: false, | ||
| // in this test, we disable hmr and liveReload, | ||
| // but lazyCompilation dependent hmr or liveReload to load lazy js bundle |
There was a problem hiding this comment.
The comment has grammatical errors. It should be 'but lazyCompilation depends on HMR or liveReload to load lazy JS bundles' (fix 'dependent' to 'depends on', capitalize 'HMR' and 'JS').
Suggested change
| // but lazyCompilation dependent hmr or liveReload to load lazy js bundle | |
| // but lazyCompilation depends on HMR or liveReload to load lazy JS bundles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Related Links
Checklist