Skip to content

Commit 6357b54

Browse files
authored
Bump @capsizecss/metrics to 3.4.0 for Geist Google Font (#72746)
### Why? `next/font` depends on the Google Fonts metrics from the `@capsizecss/metrics`. Added support for Geist at seek-oss/capsize#217, so we update version. ### How? - Bump `@capsizecss/metrics` to 3.4.0 - Update the test to match the metrics. #### Bonus - Modified the test to use `.toMatchInlineSnapshot` to identify and update future changes more easily. ### RFC The `@capsizecss` team is planning to [automate the updating process](seek-oss/capsize#217 (review)). Should we continue to depend on them or replace them with our custom script to fetch Google Font API (requires API key)? x-ref: #47115 x-ref: [Twitter Feedback](https://x.com/illyism/status/1855500917589602706)
1 parent a1b0d9c commit 6357b54

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

packages/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
"@babel/runtime": "7.22.5",
153153
"@babel/traverse": "7.22.5",
154154
"@babel/types": "7.22.5",
155-
"@capsizecss/metrics": "3.2.0",
155+
"@capsizecss/metrics": "3.4.0",
156156
"@edge-runtime/cookies": "5.0.0",
157157
"@edge-runtime/ponyfill": "3.0.0",
158158
"@edge-runtime/primitives": "5.1.1",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/e2e/next-font/google-fetch-error.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,22 @@ describe('next/font/google fetch error', () => {
3838
const ascentOverride = await browser.eval(
3939
'Array.from(document.fonts.values()).find(font => font.family.includes("Inter Fallback")).ascentOverride'
4040
)
41-
expect(ascentOverride).toBe('90.49%')
41+
expect(ascentOverride).toMatchInlineSnapshot(`"90.44%"`)
4242

4343
const descentOverride = await browser.eval(
4444
'Array.from(document.fonts.values()).find(font => font.family.includes("Inter Fallback")).descentOverride'
4545
)
46-
expect(descentOverride).toBe('22.56%')
46+
expect(descentOverride).toMatchInlineSnapshot(`"22.52%"`)
4747

4848
const lineGapOverride = await browser.eval(
4949
'Array.from(document.fonts.values()).find(font => font.family.includes("Inter Fallback")).lineGapOverride'
5050
)
51-
expect(lineGapOverride).toBe('0%')
51+
expect(lineGapOverride).toMatchInlineSnapshot(`"0%"`)
5252

5353
const sizeAdjust = await browser.eval(
5454
'Array.from(document.fonts.values()).find(font => font.family.includes("Inter Fallback")).sizeAdjust'
5555
)
56-
expect(sizeAdjust).toBe('107.06%')
56+
expect(sizeAdjust).toMatchInlineSnapshot(`"107.12%"`)
5757

5858
expect(next.cliOutput.slice(outputIndex)).toInclude(
5959
'Failed to download `Inter` from Google Fonts. Using fallback font instead.'

0 commit comments

Comments
 (0)