-
-
Notifications
You must be signed in to change notification settings - Fork 245
WIP test: enable lazy_compilation by default #5905
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
@@ -51,6 +51,9 @@ rspackOnlyTest( | |||
rsbuildConfig: { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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').
// but lazyCompilation dependent hmr or liveReload to load lazy js bundle | |
// but lazyCompilation depends on HMR or liveReload to load lazy JS bundles |
Copilot uses AI. Check for mistakes.
Summary
Related Links
Checklist