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

A lot of <style> #48883

Closed
silviaphungky opened this issue May 12, 2024 · 4 comments
Closed

A lot of <style> #48883

silviaphungky opened this issue May 12, 2024 · 4 comments
Labels
🤔 Need Reproduce We cannot reproduce your problem

Comments

@silviaphungky
Copy link

Reproduction link

https://ant.design/components/typography

Steps to reproduce

What is expected?

minimal style injection

What is actually happening?

a lot of style injection in head that cause bigger string in memory inspection

Environment Info
antd 5.17.0
React 18.2.0
System mac
Browser chrome
Screenshot 2024-05-12 at 08 01 22 Screenshot 2024-05-12 at 08 01 43
@MadCcc
Copy link
Member

MadCcc commented May 14, 2024

Styles are injected by component. Please provide a reproduction if you encountered with performance issue.

@MadCcc MadCcc added 🤔 Need Reproduce We cannot reproduce your problem and removed unconfirmed labels May 14, 2024
Copy link
Contributor

Hello @silviaphungky. Please provide a online reproduction by forking codesandbox of antd@5.x or antd@4.x, or provide a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 3 days.

你好 @silviaphungky,我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击这里创建一个 antd@5.xantd@4.x 的 codesandbox,或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。

什么是最小化重现,为什么这是必需的?

@silviaphungky
Copy link
Author

silviaphungky commented May 17, 2024

@MadCcc

https://master--tangerine-sherbet-853a3a.netlify.app/ this one using antd Typography and Flex
https://euphonious-cendol-61a17d.netlify.app/ this one without antd, only inline style

memory result in chrome devtools:

  1. antd: the strings proportion is almost same with the code proportion
Screenshot 2024-05-17 at 09 24 38

if we see more in the sumary, it shows a lot of repetition of Token*** and antd typography style
Screenshot 2024-05-17 at 09 21 44
Screenshot 2024-05-17 at 09 30 37
Screenshot 2024-05-17 at 09 31 02
imagine if I use a lot of components from antd, it will produce bigger strings in the memory that will cause performance issue in my website. I expect the strings is smaller without any repetition

  1. inline style without antd
Screenshot 2024-05-17 at 09 24 15

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
@silviaphungky
Copy link
Author

@MadCcc I aready attach the link for reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 Need Reproduce We cannot reproduce your problem
Projects
None yet
Development

No branches or pull requests

2 participants