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: Generate fallback fonts #4086

Merged
merged 4 commits into from Mar 7, 2023

Conversation

wbinnssmith
Copy link
Member

This:

  • Generates and uses definitions for fallback system fonts to use in place of user fonts, or as they are loading.
  • Reads the font metrics file from the next package directly relative to the user's app.
  • Fixes a bug where adjust_font_fallback defaulted to false instead of true.
  • Begins to refactor next/font code to be more modular in anticipation of next/font/local support.
  • Changes handle_resolve_error to take an origin FileSystemPathVc instead of a ResolveOriginVc as this is all it used, and a resolve origin isn't always available.

This:
* Generates and uses definitions for fallback system fonts to use in place of user fonts, or as they are loading.
* Reads the font metrics file from the `next` package directly relative to the user's app.
* Fixes a bug where `adjust_font_fallback` defaulted to `false` instead of `true`.
* Begins to refactor next/font code to be more modular in anticipation of `next/font/local` support.
* Changes `handle_resolve_error` to take an origin `FileSystemPathVc` instead of a `ResolveOriginVc` as this is all it used, and a resolve origin isn't always available.
@wbinnssmith wbinnssmith requested a review from a team as a code owner March 6, 2023 18:56
@vercel
Copy link

vercel bot commented Mar 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
examples-cra-web 🔄 Building (Inspect) Mar 7, 2023 at 6:11PM (UTC)
examples-kitchensink-blog 🔄 Building (Inspect) Mar 7, 2023 at 6:11PM (UTC)
examples-tailwind-web 🔄 Building (Inspect) Mar 7, 2023 at 6:11PM (UTC)
7 Ignored Deployments
Name Status Preview Comments Updated
examples-basic-web ⬜️ Ignored (Inspect) Mar 7, 2023 at 6:11PM (UTC)
examples-designsystem-docs ⬜️ Ignored (Inspect) Mar 7, 2023 at 6:11PM (UTC)
examples-native-web ⬜️ Ignored (Inspect) Mar 7, 2023 at 6:11PM (UTC)
examples-nonmonorepo ⬜️ Ignored (Inspect) Mar 7, 2023 at 6:11PM (UTC)
examples-svelte-web ⬜️ Ignored (Inspect) Mar 7, 2023 at 6:11PM (UTC)
examples-vite-web ⬜️ Ignored (Inspect) Mar 7, 2023 at 6:11PM (UTC)
turbo-site ⬜️ Ignored (Inspect) Visit Preview Mar 7, 2023 at 6:11PM (UTC)

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2023

🟢 CI successful 🟢

Thanks

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2023

Benchmark for 93bc930

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8930.14µs ± 46.68µs 9177.06µs ± 41.58µs +2.76% +0.78%
bench_startup/Turbopack CSR/1000 modules 2595.27ms ± 4.64ms 2566.21ms ± 9.51ms -1.12% -0.03%
bench_startup/Turbopack RCC/1000 modules 2146.47ms ± 4.22ms 2129.34ms ± 4.00ms -0.80% -0.03%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8930.14µs ± 46.68µs 9177.06µs ± 41.58µs +2.76% +0.78%
bench_hmr_to_commit/Turbopack RCC/1000 modules 13.53ms ± 0.14ms 13.46ms ± 0.09ms -0.51%
bench_hmr_to_commit/Turbopack RSC/1000 modules 499.42ms ± 1.44ms 499.26ms ± 1.61ms -0.03%
bench_hmr_to_commit/Turbopack SSR/1000 modules 9278.80µs ± 68.18µs 9233.80µs ± 36.75µs -0.49%
bench_hmr_to_eval/Turbopack CSR/1000 modules 7911.27µs ± 29.45µs 8059.97µs ± 63.09µs +1.88%
bench_hmr_to_eval/Turbopack RCC/1000 modules 12.01ms ± 0.22ms 11.97ms ± 0.25ms -0.28%
bench_hmr_to_eval/Turbopack SSR/1000 modules 8226.28µs ± 35.78µs 8180.82µs ± 43.33µs -0.55%
bench_hydration/Turbopack RCC/1000 modules 3596.07ms ± 8.91ms 3600.30ms ± 12.47ms +0.12%
bench_hydration/Turbopack RSC/1000 modules 3245.98ms ± 13.45ms 3247.59ms ± 15.24ms +0.05%
bench_hydration/Turbopack SSR/1000 modules 3330.65ms ± 7.46ms 3347.19ms ± 8.74ms +0.50%
bench_startup/Turbopack CSR/1000 modules 2595.27ms ± 4.64ms 2566.21ms ± 9.51ms -1.12% -0.03%
bench_startup/Turbopack RCC/1000 modules 2146.47ms ± 4.22ms 2129.34ms ± 4.00ms -0.80% -0.03%
bench_startup/Turbopack RSC/1000 modules 2055.82ms ± 4.05ms 2041.84ms ± 5.00ms -0.68%
bench_startup/Turbopack SSR/1000 modules 2031.75ms ± 1.79ms 2038.83ms ± 5.17ms +0.35%

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2023

Benchmark for c2a58ee

Test Base PR % Significant %
bench_startup/Turbopack CSR/1000 modules 2554.07ms ± 5.29ms 2526.42ms ± 4.49ms -1.08% -0.32%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8536.84µs ± 31.48µs 8575.24µs ± 36.66µs +0.45%
bench_hmr_to_commit/Turbopack RCC/1000 modules 13.19ms ± 0.13ms 13.05ms ± 0.14ms -1.02%
bench_hmr_to_commit/Turbopack RSC/1000 modules 486.65ms ± 0.73ms 485.41ms ± 0.98ms -0.25%
bench_hmr_to_commit/Turbopack SSR/1000 modules 9078.96µs ± 31.78µs 8865.92µs ± 76.07µs -2.35%
bench_hmr_to_eval/Turbopack CSR/1000 modules 7547.36µs ± 18.30µs 7569.66µs ± 40.29µs +0.30%
bench_hmr_to_eval/Turbopack RCC/1000 modules 12.22ms ± 0.08ms 12.32ms ± 0.10ms +0.81%
bench_hmr_to_eval/Turbopack SSR/1000 modules 7891.80µs ± 37.17µs 7795.82µs ± 45.42µs -1.22%
bench_hydration/Turbopack RCC/1000 modules 3503.91ms ± 10.24ms 3512.39ms ± 9.47ms +0.24%
bench_hydration/Turbopack RSC/1000 modules 3166.69ms ± 10.85ms 3170.22ms ± 9.55ms +0.11%
bench_hydration/Turbopack SSR/1000 modules 3230.18ms ± 4.26ms 3251.79ms ± 14.21ms +0.67%
bench_startup/Turbopack CSR/1000 modules 2554.07ms ± 5.29ms 2526.42ms ± 4.49ms -1.08% -0.32%
bench_startup/Turbopack RCC/1000 modules 2075.18ms ± 4.93ms 2072.76ms ± 3.39ms -0.12%
bench_startup/Turbopack RSC/1000 modules 1997.97ms ± 6.55ms 2012.15ms ± 6.92ms +0.71%
bench_startup/Turbopack SSR/1000 modules 2016.69ms ± 2.65ms 2026.06ms ± 2.65ms +0.46%

@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2023

Benchmark for a6544fb

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack SSR/1000 modules 10.12ms ± 0.04ms 9942.63µs ± 38.97µs -1.76% -0.10%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 9854.85µs ± 38.24µs 9882.12µs ± 52.37µs +0.28%
bench_hmr_to_commit/Turbopack RCC/1000 modules 12.63ms ± 0.10ms 12.48ms ± 0.13ms -1.25%
bench_hmr_to_commit/Turbopack RSC/1000 modules 535.07ms ± 2.10ms 528.42ms ± 1.40ms -1.24%
bench_hmr_to_commit/Turbopack SSR/1000 modules 10.12ms ± 0.04ms 9942.63µs ± 38.97µs -1.76% -0.10%
bench_hmr_to_eval/Turbopack CSR/1000 modules 8821.07µs ± 30.71µs 8915.45µs ± 59.39µs +1.07%
bench_hmr_to_eval/Turbopack RCC/1000 modules 11.32ms ± 0.04ms 12.08ms ± 0.84ms +6.68%
bench_hmr_to_eval/Turbopack SSR/1000 modules 8952.28µs ± 40.61µs 8965.21µs ± 64.03µs +0.14%
bench_hydration/Turbopack RCC/1000 modules 3805.71ms ± 11.21ms 3822.78ms ± 12.47ms +0.45%
bench_hydration/Turbopack RSC/1000 modules 3421.66ms ± 12.57ms 3442.23ms ± 14.80ms +0.60%
bench_hydration/Turbopack SSR/1000 modules 3507.50ms ± 9.14ms 3510.80ms ± 7.86ms +0.09%
bench_startup/Turbopack CSR/1000 modules 2724.43ms ± 4.03ms 2722.18ms ± 6.71ms -0.08%
bench_startup/Turbopack RCC/1000 modules 2242.50ms ± 4.93ms 2257.27ms ± 5.41ms +0.66%
bench_startup/Turbopack RSC/1000 modules 2174.20ms ± 12.19ms 2170.10ms ± 11.09ms -0.19%
bench_startup/Turbopack SSR/1000 modules 2153.00ms ± 5.84ms 2151.50ms ± 2.90ms -0.07%

@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2023

Benchmark for 848c489

Test Base PR % Significant %
bench_startup/Turbopack SSR/1000 modules 2040.15ms ± 7.08ms 2015.66ms ± 3.58ms -1.20% -0.16%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 9065.56µs ± 41.88µs 9055.88µs ± 31.33µs -0.11%
bench_hmr_to_commit/Turbopack RCC/1000 modules 12.37ms ± 0.19ms 11.99ms ± 0.24ms -3.06%
bench_hmr_to_commit/Turbopack RSC/1000 modules 500.74ms ± 1.37ms 499.56ms ± 0.96ms -0.24%
bench_hmr_to_commit/Turbopack SSR/1000 modules 9449.02µs ± 66.16µs 9438.50µs ± 31.45µs -0.11%
bench_hmr_to_eval/Turbopack CSR/1000 modules 8214.00µs ± 36.11µs 8141.07µs ± 39.02µs -0.89%
bench_hmr_to_eval/Turbopack RCC/1000 modules 10.36ms ± 0.13ms 10.50ms ± 0.18ms +1.32%
bench_hmr_to_eval/Turbopack SSR/1000 modules 8351.48µs ± 39.99µs 8363.16µs ± 40.48µs +0.14%
bench_hydration/Turbopack RCC/1000 modules 3615.70ms ± 8.29ms 3590.81ms ± 11.29ms -0.69%
bench_hydration/Turbopack RSC/1000 modules 3235.00ms ± 11.29ms 3208.38ms ± 13.22ms -0.82%
bench_hydration/Turbopack SSR/1000 modules 3309.56ms ± 9.14ms 3277.26ms ± 9.96ms -0.98%
bench_startup/Turbopack CSR/1000 modules 2592.59ms ± 5.88ms 2594.57ms ± 14.34ms +0.08%
bench_startup/Turbopack RCC/1000 modules 2121.39ms ± 7.33ms 2112.45ms ± 4.70ms -0.42%
bench_startup/Turbopack RSC/1000 modules 2058.26ms ± 6.12ms 2065.76ms ± 9.00ms +0.36%
bench_startup/Turbopack SSR/1000 modules 2040.15ms ± 7.08ms 2015.66ms ± 3.58ms -1.20% -0.16%

@wbinnssmith wbinnssmith merged commit f5a2f29 into main Mar 7, 2023
@wbinnssmith wbinnssmith deleted the wbinnssmith/font-google-fallback branch March 7, 2023 20:00
wbinnssmith added a commit that referenced this pull request Mar 7, 2023
This removes the duplicated (and possibly mismatching) font data file in favor of loading the copy bundled with next, using `load_next_json` introduced in #4086. It also removes the associated workflow and generation script.
mehulkar pushed a commit that referenced this pull request Mar 7, 2023
This:
* Generates and uses definitions for fallback system fonts to use in
place of user fonts, or as they are loading.
* Reads the font metrics file from the `next` package directly relative
to the user's app.
* Fixes a bug where `adjust_font_fallback` defaulted to `false` instead
of `true`.
* Begins to refactor next/font code to be more modular in anticipation
of `next/font/local` support.
* Changes `handle_resolve_error` to take an origin `FileSystemPathVc`
instead of a `ResolveOriginVc` as this is all it used, and a resolve
origin isn't always available.
wbinnssmith added a commit that referenced this pull request Mar 8, 2023
This removes the duplicated (and possibly mismatching) font data file in
favor of loading the copy bundled with next, using `load_next_json`
introduced in #4086. It also removes the associated workflow and
generation script.
jridgewell pushed a commit to vercel/next.js that referenced this pull request Mar 10, 2023
This:
* Generates and uses definitions for fallback system fonts to use in
place of user fonts, or as they are loading.
* Reads the font metrics file from the `next` package directly relative
to the user's app.
* Fixes a bug where `adjust_font_fallback` defaulted to `false` instead
of `true`.
* Begins to refactor next/font code to be more modular in anticipation
of `next/font/local` support.
* Changes `handle_resolve_error` to take an origin `FileSystemPathVc`
instead of a `ResolveOriginVc` as this is all it used, and a resolve
origin isn't always available.
jridgewell pushed a commit to vercel/next.js that referenced this pull request Mar 10, 2023
…turbo#4111)

This removes the duplicated (and possibly mismatching) font data file in
favor of loading the copy bundled with next, using `load_next_json`
introduced in vercel/turbo#4086. It also removes the associated workflow and
generation script.
sokra pushed a commit to vercel/next.js that referenced this pull request Mar 13, 2023
This:
* Generates and uses definitions for fallback system fonts to use in
place of user fonts, or as they are loading.
* Reads the font metrics file from the `next` package directly relative
to the user's app.
* Fixes a bug where `adjust_font_fallback` defaulted to `false` instead
of `true`.
* Begins to refactor next/font code to be more modular in anticipation
of `next/font/local` support.
* Changes `handle_resolve_error` to take an origin `FileSystemPathVc`
instead of a `ResolveOriginVc` as this is all it used, and a resolve
origin isn't always available.
sokra pushed a commit to vercel/next.js that referenced this pull request Mar 13, 2023
…turbo#4111)

This removes the duplicated (and possibly mismatching) font data file in
favor of loading the copy bundled with next, using `load_next_json`
introduced in vercel/turbo#4086. It also removes the associated workflow and
generation script.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants