Built-In Font Optimization: Improve Angular Performance & Core Web Vitals
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- angular, typescript
- 领域
- cli, frontend, performance
调研方向
首先检查 @angular/core 和 @angular/cli 中涉及构建时字体处理的区域,并将提议的行为与 Next.js next/font 进行比较。在实现之前,定义受支持的字体标识符、构建时下载和自托管流程,以及 preconnect、preload 和 size-adjust 的行为。该功能能够用于 Google Fonts,并改善所述的加载和布局偏移目标,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Which @angular/* package(s) are relevant/related to the feature request?
@angular/core and @angular/cli
Problems :
-
Using custom fonts from Google Fonts can significantly impact FCP, LCP and initial load performance in Angular applications.
-
Downloading fonts from Google servers adds extra HTTP requests and latency, slowing down initial paint times.
-
The font swapping has the potential to cause layout shifts and so impact Cumulative Layout Shift (CLS).
Proposed Solution :
-
Introduce a built-in mechanism in Angular to automatically downloads fonts specified by their Google Fonts names (or similar identifiers) during the build process and self-host fonts within the application, eliminating the need for external font services like Google Fonts.
-
Utilize preconnect, preload, and size-adjust for optimal performance and seamless font rendering.
Benefits :
-
Improved Performance: Reduces reliance on external requests, minimizes layout shifts (thanks to the underlying CSS size-adjust) , and enables efficient caching.
-
Improved FCP and LCP: Optimized fonts and proactive loading strategies contribute to significantly faster loading times and smoother user experiences.
-
Enhanced SEO: Better Core Web Vitals can lead to higher search engine ranking and increased website traffic.
-
Enhanced Security: Minimizes exposure to external vulnerabilities and provides more control over font sources.
-
Developer Experience: Built-in font optimization in Angular improves developer experience.
Alternatives considered
Anyone interested is welcome to comment on what the proposed syntax and feature set will be.
Inspired by next.js automatic font self-hosting library ( next/font )
- 主要语言
- TypeScript
- 星标
- 27k
- 派生
- 11.8k
- 平均合并
- 16 小时 35 分钟
- 30 天内合并 PR
- 176
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
angular/angular-cli 的其他 Issue
-
area: @angular/build gemini-triaged
难度 2/5 1-3 小时 新手友好度 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
难度 2/5 1-3 小时 新手友好度 72/100
angular/angular-cli#33055 · 1 条评论 · 3 个 reaction ·
-
area: @angular/build gemini-triaged
难度 4/5 3-5 天 新手友好度 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 已指派 1 人 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 已指派 1 人 ·
查看 angular/angular-cli 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
vicharanashala/fln#563 ·