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

[Feature] 优先使用用户安装的 babel-plugin-react-compiler #12404

Closed
fz6m opened this issue May 18, 2024 · 4 comments
Closed

[Feature] 优先使用用户安装的 babel-plugin-react-compiler #12404

fz6m opened this issue May 18, 2024 · 4 comments

Comments

@fz6m
Copy link
Member

fz6m commented May 18, 2024

说明

新增功能:forget 功能在使用 babel-plugin-react-compiler 时,优先使用用户安装的 babel-plugin-react-compiler ,如果用户没安装,再使用内置的,因为这个包经常发版,内置的版本很容易陈旧。

更多说明见 #12396 (comment)

PR Welcome ,认领请先留言避免重复提交。

@fz6m
Copy link
Member Author

fz6m commented May 25, 2024

另可新增 forget.experimental.enableCompilerWithReact18 选项,参考此 文章 与此 gist 代码片段,新增实验性 react 18 使用 react compiler ,调整如下:

1、在开启此选项时 check react 是否为 v18

2、开启此选项时给出明显警告,因为 react compiler 发言人 不推荐 此种行为,只是权宜之计

3、把需要的 runtime 内容,写一个临时文件,然后配制成 @/.umi/plugin-xxx/reactCompilerRuntime.js 的方式导入。

@rjl-cli

This comment was marked as off-topic.

@zFitness
Copy link

enableCompilerWithReact18
这个配置项没有生效,react18使用forget模式会报错

@fz6m
Copy link
Member Author

fz6m commented Jun 22, 2024

因为 enableCompilerWithReact18 这个功能没实现呢,这是一个 feature request 提案,还没落地。

@fz6m fz6m closed this as completed Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants