-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
fix: use jsx/runtime only for react 17 and above #12258
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
WalkthroughThe recent updates in the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (2)
- packages/preset-umi/src/commands/build.ts (1 hunks)
- packages/preset-umi/src/commands/dev/dev.ts (3 hunks)
Additional comments not posted (3)
packages/preset-umi/src/commands/build.ts (1)
102-105
: The update to check for React version '17.0.0' and the added comments explaining the rationale behind not using '16.14.0' are clear and align well with the PR's objectives. This change ensures that the build process correctly handles React versions, especially with the introduction of the new JSX transform in React 17.packages/preset-umi/src/commands/dev/dev.ts (2)
303-303
: The modification to thestartBuildWorker
function, setting it as a no-op by default, is a sensible change. It ensures safe invocation of the function without unintended side effects when the MFSU strategy is not set to 'eager'. This adjustment likely improves build performance and reliability.
353-353
: Updating the React version check to '17.0.0' in the development process, similar to the build process, ensures consistency and correct handling of React versions across different environments. This change is crucial for addressing the issue with externals for React 17 and above.
Size Change: +72 B (0%) Total Size: 9.9 MB
ℹ️ View Unchanged
|
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.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (2)
- packages/preset-umi/src/commands/build.ts (1 hunks)
- packages/preset-umi/src/commands/dev/dev.ts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- packages/preset-umi/src/commands/build.ts
- packages/preset-umi/src/commands/dev/dev.ts
此问题感觉可以改进为若配置了 react 的 external ,则以 |
#12219 引入的问题,针对 16.14 调整了 react 的转移方式,之前没考虑到的场景是「会影响到 externals」,会导致「externals 只处理了 react 而没有处理 react/runtime」的场景会出问题。
Summary by CodeRabbit
startBuildWorker
function and comparison logic for React version check.