Skip to content

Conversation

@chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Nov 3, 2025

Summary

WIP

TODO

Screenshot 2025-11-03 at 13 48 29

Checklist

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

Copilot AI review requested due to automatic review settings November 3, 2025 05:48
@netlify
Copy link

netlify bot commented Nov 3, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 73cc6dc
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/690b557ea6d17c0008b0983f
😎 Deploy Preview https://deploy-preview-6490--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 70 (🟢 up 10 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@chenjiahan chenjiahan marked this pull request as draft November 3, 2025 05:49
Copy link
Contributor

Copilot AI left a 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 refactors dynamic imports to use deferred imports, converting async module loading to synchronous top-level imports with the defer modifier. This optimization eliminates unnecessary async operations while enabling Rspack's experimental deferImport feature for better build performance.

Key changes:

  • Convert dynamic import() calls to defer * as imports across multiple server-side modules
  • Change async functions to synchronous where dynamic imports were the only async operations
  • Enable Rspack's experimental deferImport feature in the build configuration
  • Update TypeScript module configuration from ES2022 to esnext
  • Add @prettier/plugin-oxc for enhanced code formatting

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/config/tsconfig.json Updated module target to esnext to support newer module features
packages/core/src/server/runner/asModule.ts Replaced dynamic import with deferred import for node:vm
packages/core/src/server/prodServer.ts Replaced dynamic imports with deferred imports for node:zlib and converted createHttpServer call to synchronous
packages/core/src/server/open.ts Replaced dynamic imports with deferred imports for node:child_process and node:util, made getHostInUrl synchronous
packages/core/src/server/httpServer.ts Replaced dynamic imports with deferred imports for http modules and converted function to synchronous
packages/core/src/server/hmrFallback.ts Replaced dynamic import with deferred import for node:dns
packages/core/src/server/helper.ts Replaced dynamic imports with deferred imports for node:net and made getHostInUrl synchronous
packages/core/src/server/devServer.ts Removed await from createHttpServer call
packages/core/src/server/cliShortcuts.ts Replaced dynamic import with deferred import for node:readline
packages/core/src/plugins/cache.ts Removed await from hash function call
packages/core/src/loadConfig.ts Replaced dynamic import with deferred import for jiti
packages/core/src/helpers/index.ts Converted hash function from async to sync with deferred crypto import
packages/core/src/createContext.ts Removed await from hash function call
packages/core/rslib.config.ts Enabled Rspack's experimental deferImport feature
package.json Added @prettier/plugin-oxc dev dependency
.prettierrc Configured Prettier to use oxc plugin
pnpm-lock.yaml Updated lock file with new dependencies
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan changed the title refactor(core): switch to import defer refactor(core): using import defer Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants