facebook / facebook/docusaurus

Do not use React svg components for regularly used icons

未关闭
#5,865 9 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
domain: performance proposal
主要语言
TypeScript
星标
66.2k
派生
10k
平均合并
1 天 3 小时
30 天内合并 PR
52

描述

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues).

### Motivation

This issue about updating the number of visible archived versions in the version dropdown lead to a weird build size diff on HTML files:

https://github.com/facebook/docusaurus/pull/5862#issuecomment-958881323

The diff in size is due to using an inlined SVG component for external links 😅 the SVG markup is duplicated in the HTML file for each item

![image](https://user-images.githubusercontent.com/749374/140104236-11e4344c-2f3c-49a6-a118-ff6f7ddb480c.png)

For reusable icons of our theme, we should rather require an `svg` file instead of using a React SVG component, to reduce HTML output size.

It can have a significant impact on pages with a lot of icons (due to navbar, footer, doc sidebar...)

### Self-service

- [ ] I'd be willing to do some initial work on this proposal myself.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。