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

docs: prevent highlight code initially #44344

Merged
merged 1 commit into from
Aug 22, 2023
Merged

Conversation

afc163
Copy link
Member

@afc163 afc163 commented Aug 22, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

  • 避免页面加载时就运行 Prima.hightlight 这种高消耗操作,现在展开代码才会运行。
  • Prima.hightlight 移出 render,放到 useEffect 里去。
  • CSS tab 的样式也顺便统一掉。

缺点是 Table 页面点击展开全部代码,会有一点点卡。

图片

性能对比效果

线上 修改后
截屏2023-08-23 下午7 41 12 截屏2023-08-23 下午7 41 09

📝 Changelog

Language Changelog
🇺🇸 English --
🇨🇳 Chinese --

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

🤖 Generated by Copilot at 32cebc9

No summary available (Limit exceeded: required to process 52276 tokens, but only 50000 are allowed per call)

🔍 Walkthrough

🤖 Generated by Copilot at 32cebc9

No walkthrough available (Limit exceeded: required to process 52276 tokens, but only 50000 are allowed per call)

@stackblitz
Copy link

stackblitz bot commented Aug 22, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 22, 2023

const highlightedCodes = {
jsx: Prism.highlight(jsx, Prism.languages.javascript, 'jsx'),
tsx: Prism.highlight(entryCode, Prism.languages.javascript, 'jsx'),
};
Copy link
Member Author

Choose a reason for hiding this comment

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

原来的写法是直接放 render 里。。。

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
./dist/antd.min.js 388.24 KB
./dist/antd-with-locales.min.js 447.22 KB

@argos-ci
Copy link

argos-ci bot commented Aug 22, 2023

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No change detected - Aug 22, 2023, 7:41 AM

>
<Previewer {...props} />
</Suspense>
<ErrorBoundary>
Copy link
Member

Choose a reason for hiding this comment

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

这个是啥场景要加个 ErrorBoundary

Copy link
Member Author

Choose a reason for hiding this comment

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

CodePreview 代码本身写错了一行代码直接白了,顺手加个。

@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (80e1bc8) 100.00% compared to head (32cebc9) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #44344   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          660       660           
  Lines        11230     11230           
  Branches      3039      3039           
=========================================
  Hits         11230     11230           

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

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.

2 participants