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

fix(c2c): clickToComponent only in dev mode #10759

Merged
merged 3 commits into from
Mar 23, 2023

Conversation

F-loat
Copy link
Contributor

@F-loat F-loat commented Mar 15, 2023

click-to-react-component 组件虽然做了如下处理,但在生产模式下启用的话其组件仍然会被打包,且默认不会走构建,会导致低版本浏览器兼容问题

// index.js
export const ClickToComponent =
  process.env.NODE_ENV === 'development' ? Component : () => null

// ContextMenu.js
if (!open) onClose?.()

@vercel
Copy link

vercel bot commented Mar 15, 2023

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

1 Ignored Deployment
Name Status Preview Comments Updated
umi ⬜️ Ignored (Inspect) Mar 15, 2023 at 3:38PM (UTC)

@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01 ⚠️

Comparison is base (08e0f61) 29.11% compared to head (4550dfe) 29.10%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10759      +/-   ##
==========================================
- Coverage   29.11%   29.10%   -0.01%     
==========================================
  Files         462      462              
  Lines       13871    13872       +1     
  Branches     3253     3254       +1     
==========================================
  Hits         4038     4038              
- Misses       9143     9144       +1     
  Partials      690      690              
Impacted Files Coverage Δ
.../src/features/clickToComponent/clickToComponent.ts 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@F-loat F-loat changed the title fix(ctc): clickToComponent only in dev mode fix(c2c): clickToComponent only in dev mode Mar 15, 2023
Copy link
Member

@PeachScript PeachScript left a comment

Choose a reason for hiding this comment

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

+1

@PeachScript PeachScript merged commit 7a545a4 into umijs:master Mar 23, 2023
@github-actions
Copy link

感谢 PR!如果有兴趣一起参与维护 Umi,可加入我们的 Umi Contributor 群。加入方式是先用钉钉扫下方二维码加我钉钉,记得注明 github id,然后我会拉你到群里。

@F-loat F-loat deleted the fix/click-to-component branch March 23, 2023 12:54
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.

3 participants