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

next/font: tolerate missing unused fields in capsize map #50708

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

wbinnssmith
Copy link
Member

Some font entries in capsize do not include fields like cap_height and x_height. Since these are unused by next/font, remove these from the serde structure entirely.

Additionally, this makes it so that failing to read or deserialize the capsize map results in an Error rather than a FontFallbackError, which causes a build failure rather than silently omitting a fallback font. next/font should always include this map, and it obscured the real issue here. However, a missing entry in this map should result in omitting a fallback.

Some font entries in capsize do not include fields like `cap_height` and `x_height`. Since these are unused by next/font, remove these from the serde structure entirely.

Additionally, this makes it so that failing to read or deserialize the capsize map results in an `Error` rather than a `FontFallbackError`, which causes a build failure rather than silently omitting a fallback font. `next/font` should always include this map, and it obscured the real issue here. However, a missing entry in this map _should_ result in omitting a fallback.
@wbinnssmith wbinnssmith requested review from timneutkens, ijjk, shuding and a team as code owners June 2, 2023 16:41
@ijjk ijjk added Font (next/font) Related to Next.js Font Optimization. Turbopack Related to Turbopack with Next.js. created-by: Turbopack team PRs by the Turbopack team. type: next labels Jun 2, 2023
@kodiakhq kodiakhq bot merged commit e657741 into canary Jun 2, 2023
@kodiakhq kodiakhq bot deleted the wbinnssmith/capsize-optional-fields branch June 2, 2023 17:10
hydRAnger pushed a commit to hydRAnger/next.js that referenced this pull request Jun 12, 2023
Some font entries in capsize do not include fields like `cap_height` and `x_height`. Since these are unused by next/font, remove these from the serde structure entirely.

Additionally, this makes it so that failing to read or deserialize the capsize map results in an `Error` rather than a `FontFallbackError`, which causes a build failure rather than silently omitting a fallback font. `next/font` should always include this map, and it obscured the real issue here. However, a missing entry in this map _should_ result in omitting a fallback.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
created-by: Turbopack team PRs by the Turbopack team. Font (next/font) Related to Next.js Font Optimization. Turbopack Related to Turbopack with Next.js. type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants