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

[5/n] @next/font/google: Port utilities for generating stylesheet urls #2856

Merged
merged 6 commits into from Dec 8, 2022

Conversation

wbinnssmith
Copy link
Member

@wbinnssmith wbinnssmith commented Nov 28, 2022

In order to generate urls to stylesheets, this ports over logic from the upstream JavaScript implementation, namely getFontAxes0, which generates a font axes structure from the user's request and font data, and getUrl1, which generates a url to a Google fonts stylesheet from the user's request and the font axes structure.

Test Plan:

  • Added unit tests
  • Manually verified stylesheet urls generated by tests (will need adjusting to be valid fonts and attributes)

@vercel
Copy link

vercel bot commented Nov 28, 2022

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

Name Status Preview Comments Updated
examples-basic-web 🔄 Building (Inspect) Dec 8, 2022 at 2:54AM (UTC)
examples-svelte-web 🔄 Building (Inspect) Dec 8, 2022 at 2:54AM (UTC)
6 Ignored Deployments
Name Status Preview Comments Updated
examples-cra-web ⬜️ Ignored (Inspect) Dec 8, 2022 at 2:54AM (UTC)
examples-designsystem-docs ⬜️ Ignored (Inspect) Dec 8, 2022 at 2:54AM (UTC)
examples-kitchensink-blog ⬜️ Ignored (Inspect) Dec 8, 2022 at 2:54AM (UTC)
examples-native-web ⬜️ Ignored (Inspect) Dec 8, 2022 at 2:54AM (UTC)
examples-nonmonorepo ⬜️ Ignored (Inspect) Dec 8, 2022 at 2:54AM (UTC)
turbo-site ⬜️ Ignored (Inspect) Visit Preview Dec 8, 2022 at 2:54AM (UTC)

@wbinnssmith wbinnssmith force-pushed the wbinnssmith/next-font-google-utils branch 3 times, most recently from 10ae16f to f815dd9 Compare November 29, 2022 00:00
@wbinnssmith wbinnssmith marked this pull request as ready for review November 29, 2022 00:01
@wbinnssmith wbinnssmith requested a review from a team as a code owner November 29, 2022 00:01
@wbinnssmith wbinnssmith force-pushed the wbinnssmith/import-map-next-font branch from 685c47f to 6e09f52 Compare November 29, 2022 19:31
@wbinnssmith wbinnssmith force-pushed the wbinnssmith/next-font-google-utils branch from f815dd9 to 1263828 Compare November 29, 2022 19:31
@wbinnssmith wbinnssmith changed the title @next/font/google: Port utilities for generating stylesheet urls [5/n] @next/font/google: Port utilities for generating stylesheet urls Nov 29, 2022
@wbinnssmith wbinnssmith force-pushed the wbinnssmith/next-font-google-utils branch 2 times, most recently from 7ca5381 to 513e0ea Compare November 29, 2022 19:50
@wbinnssmith
Copy link
Member Author

wbinnssmith commented Dec 6, 2022

Graphite Merge Job

Current status: ⚠️ Downstack blocker

A downstack pull request blocked this pull request from being merged.

This comment was auto-generated by Graphite.

Job Reference: GTwTicpFoR97BYmAqnX0

@wbinnssmith wbinnssmith merged commit b90a395 into main Dec 8, 2022
@wbinnssmith wbinnssmith deleted the wbinnssmith/next-font-google-utils branch December 8, 2022 03:38
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2022

Benchmark for d7f79e0

Test Base PR % Significant %
bench_startup/Turbopack CSR/1000 modules 1485.51ms ± 7.57ms 1444.25ms ± 10.96ms -2.78% -0.29%
bench_startup/Turbopack SSR/1000 modules 2408.12ms ± 8.89ms 2374.96ms ± 4.72ms -1.38% -0.25%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8448.22µs ± 51.35µs 8376.06µs ± 59.30µs -0.85%
bench_hmr_to_commit/Turbopack RCC/1000 modules 8709.14µs ± 66.37µs 8697.91µs ± 66.24µs -0.13%
bench_hmr_to_commit/Turbopack RSC/1000 modules 881.25ms ± 25.85ms 870.26ms ± 23.28ms -1.25%
bench_hmr_to_commit/Turbopack SSR/1000 modules 8455.77µs ± 32.34µs 8474.46µs ± 66.33µs +0.22%
bench_hmr_to_eval/Turbopack CSR/1000 modules 7435.31µs ± 53.88µs 7406.16µs ± 60.83µs -0.39%
bench_hmr_to_eval/Turbopack RCC/1000 modules 7491.65µs ± 90.07µs 7547.84µs ± 69.66µs +0.75%
bench_hmr_to_eval/Turbopack SSR/1000 modules 7511.65µs ± 70.51µs 7452.36µs ± 48.68µs -0.79%
bench_hydration/Turbopack RCC/1000 modules 3564.26ms ± 19.06ms 3511.80ms ± 26.16ms -1.47%
bench_hydration/Turbopack RSC/1000 modules 2708.83ms ± 48.23ms 2718.52ms ± 47.09ms +0.36%
bench_hydration/Turbopack SSR/1000 modules 2989.04ms ± 7.77ms 2976.66ms ± 12.40ms -0.41%
bench_startup/Turbopack CSR/1000 modules 1485.51ms ± 7.57ms 1444.25ms ± 10.96ms -2.78% -0.29%
bench_startup/Turbopack RCC/1000 modules 2695.70ms ± 23.33ms 2654.17ms ± 47.11ms -1.54%
bench_startup/Turbopack RSC/1000 modules 2332.62ms ± 32.04ms 2352.96ms ± 36.54ms +0.87%
bench_startup/Turbopack SSR/1000 modules 2408.12ms ± 8.89ms 2374.96ms ± 4.72ms -1.38% -0.25%

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2022

⚠️ CI failed ⚠️

The following steps have failed in CI:

  • Rust benchmark tests

See workflow summary for details

jridgewell added a commit to vercel/next.js that referenced this pull request Mar 10, 2023
…rls (vercel/turbo#2856)

* Implement get_font_axes

* Implement get_stylesheet_url

* Handle font axes without wght

Co-authored-by: Hannes Bornö <hannes.borno@vercel.com>

* Implement extract_font_urls

* Update crates/next-core/src/next_font_google/util.rs

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>

* Remove extraction of fonts

Co-authored-by: Hannes Bornö <hannes.borno@vercel.com>
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
sokra pushed a commit to vercel/next.js that referenced this pull request Mar 13, 2023
…rls (vercel/turbo#2856)

* Implement get_font_axes

* Implement get_stylesheet_url

* Handle font axes without wght

Co-authored-by: Hannes Bornö <hannes.borno@vercel.com>

* Implement extract_font_urls

* Update crates/next-core/src/next_font_google/util.rs

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>

* Remove extraction of fonts

Co-authored-by: Hannes Bornö <hannes.borno@vercel.com>
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
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

3 participants