Closed
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 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 todefer * asimports across multiple server-side modules - Change async functions to synchronous where dynamic imports were the only async operations
- Enable Rspack's experimental
deferImportfeature in the build configuration - Update TypeScript module configuration from
ES2022toesnext - Add
@prettier/plugin-oxcfor 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.
Member
Author
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
WIP
TODO
typescript-goto support import defer. (Port "Add support forimport deferproposal" microsoft/typescript-go#1826)import deferyet (can be resolved via@prettier/plugin-oxc) (typescript import defer error prettier/prettier#18180)Checklist