Skip to content
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

feat: support react/jsx-runtime #12219

Merged
merged 3 commits into from Mar 22, 2024
Merged

Conversation

Wu-kung
Copy link
Contributor

@Wu-kung Wu-kung commented Mar 19, 2024

支持 React 16.14.0 版本以上使用全新的转换,可以单独使用 JSX 而无需引入 React。

Copy link

vercel bot commented Mar 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
umi ⬜️ Ignored (Inspect) Visit Preview Mar 21, 2024 3:17pm

@fz6m
Copy link
Member

fz6m commented Mar 20, 2024

有这个需求的原因是啥,你们有 v16.14+ 的项目在用 umi 4 吗,我理解不是升级的项目的话, umi 4 的项目已经绝大多数都是 18 或 17 了。

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 28.41%. Comparing base (b4098c2) to head (c77e8b7).

❗ Current head c77e8b7 differs from pull request most recent head d07c875. Consider uploading reports for the commit d07c875 to get more accurate results

Files Patch % Lines
...ckages/preset-umi/src/commands/dev/getBabelOpts.ts 0.00% 3 Missing ⚠️
packages/preset-umi/src/commands/build.ts 0.00% 2 Missing ⚠️
packages/preset-umi/src/commands/dev/dev.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12219      +/-   ##
==========================================
- Coverage   28.41%   28.41%   -0.01%     
==========================================
  Files         492      492              
  Lines       15166    15156      -10     
  Branches     3626     3620       -6     
==========================================
- Hits         4310     4306       -4     
+ Misses      10084    10078       -6     
  Partials      772      772              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sorrycc
Copy link
Member

sorrycc commented Mar 20, 2024

@fz6m 背景是,之前内网答疑同学遇到的,老项目升级,可能由于加了 babel 插件没有写 import React from 'react';,升级过来后没有写这句会报错,因为是 react 16。

@@ -348,12 +348,12 @@ PORT=8888 umi dev
},
});

const isGTEReact17 =
const isGTEReact16 =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isGTEReact16 > shouldUseAutomaticRuntime

@sorrycc sorrycc merged commit 2c43662 into umijs:master Mar 22, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants