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: Align with Next.js integration test suite #4039

Merged
merged 8 commits into from Mar 4, 2023

Conversation

wbinnssmith
Copy link
Member

This:

  • Adds a compile-time feature, __internal_nextjs_integration_test, which is set when building Turbopack for the Next.js integration test suite.
  • When built with __internal_nextjs_integration_test, expects the environment variable NEXT_FONT_GOOGLE_MOCKED_RESPONSES to be set with an absolute path to a JavaScript file exporting a mapping of urls to stylesheet text. This is used in place of making real requests to Google Fonts.
  • Addresses some small bugs in next/font/google to bring the implementation in line with the urls generated by Next.js without Turbopack.
  • Changes classnames generated by next/font to use 6 character hashes, bringing it in alignment with Next.js without Turbopack.

Test Plan:

  • Adjusted existing unit tests
  • In Next.js, node run-tests.js -c 1 test/e2e/next-font/index.test.ts

Description

Testing Instructions

  • Auto label

This:
* Adds a compile-time feature, `__internal_nextjs_integration_test`, which is set when building Turbopack for the Next.js integration test suite.
* When built with `__internal_nextjs_integration_test`, expects the environment variable `NEXT_FONT_GOOGLE_MOCKED_RESPONSES` to be set with an absolute path to a JavaScript file exporting a mapping of urls to stylesheet text. This is used in place of making real requests to Google Fonts.
* Addresses some small bugs in next/font/google to bring the implementation in line with the urls generated by Next.js without Turbopack.
* Changes classnames generated by next/font to use 6 character hashes, bringing it in alignment with Next.js without Turbopack.

Test Plan:
* Adjusted existing unit tests
* In Next.js, `node run-tests.js -c 1 test/e2e/next-font/index.test.ts`
@wbinnssmith wbinnssmith requested a review from a team as a code owner March 1, 2023 22:11
@vercel
Copy link

vercel bot commented Mar 1, 2023

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

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

crates/next-core/Cargo.toml Show resolved Hide resolved
crates/next-core/src/next_font_google/util.rs Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2023

🟢 CI successful 🟢

Thanks

@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2023

Benchmark for 73037e6

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 9312.44µs ± 54.60µs 9248.11µs ± 45.14µs -0.69%
bench_hmr_to_commit/Turbopack RCC/1000 modules 12.78ms ± 0.36ms 12.65ms ± 0.15ms -1.02%
bench_hmr_to_commit/Turbopack RSC/1000 modules 506.26ms ± 1.27ms 508.96ms ± 1.10ms +0.53%
bench_hmr_to_commit/Turbopack SSR/1000 modules 9367.75µs ± 39.62µs 9328.49µs ± 57.07µs -0.42%
bench_hmr_to_eval/Turbopack CSR/1000 modules 8306.84µs ± 23.56µs 8232.48µs ± 18.89µs -0.90%
bench_hmr_to_eval/Turbopack RCC/1000 modules 11.05ms ± 0.13ms 11.16ms ± 0.16ms +1.04%
bench_hmr_to_eval/Turbopack SSR/1000 modules 8374.88µs ± 39.77µs 8362.21µs ± 48.94µs -0.15%
bench_hydration/Turbopack RCC/1000 modules 3844.15ms ± 11.49ms 3838.73ms ± 12.09ms -0.14%
bench_hydration/Turbopack RSC/1000 modules 3472.46ms ± 14.11ms 3481.80ms ± 14.71ms +0.27%
bench_hydration/Turbopack SSR/1000 modules 3375.21ms ± 9.00ms 3372.15ms ± 13.78ms -0.09%
bench_startup/Turbopack CSR/1000 modules 2595.06ms ± 7.46ms 2591.30ms ± 7.76ms -0.14%
bench_startup/Turbopack RCC/1000 modules 2340.57ms ± 5.83ms 2365.04ms ± 7.09ms +1.05%
bench_startup/Turbopack RSC/1000 modules 2289.93ms ± 5.97ms 2303.46ms ± 8.05ms +0.59%
bench_startup/Turbopack SSR/1000 modules 2071.85ms ± 1.71ms 2062.87ms ± 3.40ms -0.43%

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

Benchmark for fa550d8

Test Base PR % Significant %
bench_hydration/Turbopack RSC/1000 modules 3234.04ms ± 5.84ms 3195.66ms ± 9.56ms -1.19% -0.24%
bench_startup/Turbopack CSR/1000 modules 2566.84ms ± 7.15ms 2526.50ms ± 7.11ms -1.57% -0.46%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8963.28µs ± 28.86µs 8892.98µs ± 36.76µs -0.78%
bench_hmr_to_commit/Turbopack RCC/1000 modules 12.98ms ± 0.08ms 13.85ms ± 0.79ms +6.75%
bench_hmr_to_commit/Turbopack RSC/1000 modules 497.85ms ± 0.76ms 497.13ms ± 1.04ms -0.14%
bench_hmr_to_commit/Turbopack SSR/1000 modules 9186.04µs ± 38.15µs 9118.86µs ± 39.30µs -0.73%
bench_hmr_to_eval/Turbopack CSR/1000 modules 7983.46µs ± 44.01µs 7992.57µs ± 44.09µs +0.11%
bench_hmr_to_eval/Turbopack RCC/1000 modules 12.01ms ± 0.08ms 11.68ms ± 0.19ms -2.78%
bench_hmr_to_eval/Turbopack SSR/1000 modules 8094.60µs ± 50.26µs 8198.30µs ± 23.03µs +1.28%
bench_hydration/Turbopack RCC/1000 modules 3585.42ms ± 10.33ms 3552.66ms ± 11.07ms -0.91%
bench_hydration/Turbopack RSC/1000 modules 3234.04ms ± 5.84ms 3195.66ms ± 9.56ms -1.19% -0.24%
bench_hydration/Turbopack SSR/1000 modules 3287.09ms ± 8.42ms 3291.93ms ± 9.96ms +0.15%
bench_startup/Turbopack CSR/1000 modules 2566.84ms ± 7.15ms 2526.50ms ± 7.11ms -1.57% -0.46%
bench_startup/Turbopack RCC/1000 modules 2126.75ms ± 6.28ms 2109.79ms ± 5.04ms -0.80%
bench_startup/Turbopack RSC/1000 modules 2052.93ms ± 4.50ms 2048.17ms ± 10.59ms -0.23%
bench_startup/Turbopack SSR/1000 modules 2031.87ms ± 1.48ms 2030.37ms ± 3.54ms -0.07%

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2023

Benchmark for dbca786

Test Base PR % Significant %
bench_startup/Turbopack RSC/1000 modules 2040.30ms ± 2.55ms 2057.51ms ± 6.03ms +0.84% +0.00%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 9023.54µs ± 36.43µs 9055.63µs ± 30.94µs +0.36%
bench_hmr_to_commit/Turbopack RCC/1000 modules 13.16ms ± 0.06ms 13.57ms ± 0.69ms +3.12%
bench_hmr_to_commit/Turbopack RSC/1000 modules 504.77ms ± 2.34ms 499.74ms ± 1.72ms -1.00%
bench_hmr_to_commit/Turbopack SSR/1000 modules 9178.80µs ± 57.53µs 9187.50µs ± 54.19µs +0.09%
bench_hmr_to_eval/Turbopack CSR/1000 modules 7963.12µs ± 11.95µs 8029.44µs ± 40.58µs +0.83%
bench_hmr_to_eval/Turbopack RCC/1000 modules 11.91ms ± 0.20ms 11.80ms ± 0.13ms -0.93%
bench_hmr_to_eval/Turbopack SSR/1000 modules 8215.30µs ± 45.04µs 8195.29µs ± 40.83µs -0.24%
bench_hydration/Turbopack RCC/1000 modules 3591.02ms ± 6.87ms 3593.58ms ± 10.81ms +0.07%
bench_hydration/Turbopack RSC/1000 modules 3267.62ms ± 18.16ms 3220.09ms ± 16.23ms -1.45%
bench_hydration/Turbopack SSR/1000 modules 3287.53ms ± 4.73ms 3287.34ms ± 5.90ms -0.01%
bench_startup/Turbopack CSR/1000 modules 2566.58ms ± 5.21ms 2548.89ms ± 10.63ms -0.69%
bench_startup/Turbopack RCC/1000 modules 2120.27ms ± 4.00ms 2134.79ms ± 4.86ms +0.68%
bench_startup/Turbopack RSC/1000 modules 2040.30ms ± 2.55ms 2057.51ms ± 6.03ms +0.84% +0.00%
bench_startup/Turbopack SSR/1000 modules 2036.70ms ± 3.19ms 2034.00ms ± 2.93ms -0.13%

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2023

Benchmark for dbca786

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 9050.01µs ± 48.72µs 8972.90µs ± 39.26µs -0.85%
bench_hmr_to_commit/Turbopack RCC/1000 modules 14.17ms ± 0.08ms 14.95ms ± 0.78ms +5.51%
bench_hmr_to_commit/Turbopack RSC/1000 modules 493.34ms ± 2.07ms 494.88ms ± 1.64ms +0.31%
bench_hmr_to_commit/Turbopack SSR/1000 modules 9517.54µs ± 70.62µs 9332.50µs ± 34.60µs -1.94%
bench_hmr_to_eval/Turbopack CSR/1000 modules 7994.48µs ± 52.64µs 8108.26µs ± 30.37µs +1.42%
bench_hmr_to_eval/Turbopack RCC/1000 modules 12.19ms ± 0.18ms 12.57ms ± 0.19ms +3.10%
bench_hmr_to_eval/Turbopack SSR/1000 modules 8151.25µs ± 74.13µs 8249.25µs ± 60.80µs +1.20%
bench_hydration/Turbopack RCC/1000 modules 3640.26ms ± 8.76ms 3622.08ms ± 12.18ms -0.50%
bench_hydration/Turbopack RSC/1000 modules 3247.31ms ± 16.67ms 3268.98ms ± 14.36ms +0.67%
bench_hydration/Turbopack SSR/1000 modules 3334.42ms ± 8.01ms 3324.94ms ± 6.25ms -0.28%
bench_startup/Turbopack CSR/1000 modules 2585.63ms ± 5.63ms 2587.17ms ± 7.06ms +0.06%
bench_startup/Turbopack RCC/1000 modules 2144.79ms ± 4.70ms 2142.26ms ± 5.39ms -0.12%
bench_startup/Turbopack RSC/1000 modules 2084.24ms ± 7.54ms 2086.25ms ± 5.29ms +0.10%
bench_startup/Turbopack SSR/1000 modules 2060.76ms ± 2.29ms 2054.45ms ± 4.83ms -0.31%

@wbinnssmith wbinnssmith requested a review from kwonoj March 3, 2023 23:28
@wbinnssmith wbinnssmith merged commit 44df914 into main Mar 4, 2023
@wbinnssmith wbinnssmith deleted the wbinnssmith/font-tests branch March 4, 2023 00:12
jridgewell pushed a commit to vercel/next.js that referenced this pull request Mar 10, 2023
This:
* Adds a compile-time feature, `__internal_nextjs_integration_test`,
which is set when building Turbopack for the Next.js integration test
suite.
* When built with `__internal_nextjs_integration_test`, expects the
environment variable `NEXT_FONT_GOOGLE_MOCKED_RESPONSES` to be set with
an absolute path to a JavaScript file exporting a mapping of urls to
stylesheet text. This is used in place of making real requests to Google
Fonts.
* Addresses some small bugs in next/font/google to bring the
implementation in line with the urls generated by Next.js without
Turbopack.
* Changes classnames generated by next/font to use 6 character hashes,
bringing it in alignment with Next.js without Turbopack.

Test Plan:
* Adjusted existing unit tests
* In Next.js, `node run-tests.js -c 1 test/e2e/next-font/index.test.ts`

### Description

<!--
  ✍️ Write a short summary of your work.
  If necessary, include relevant screenshots.
-->

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->

<!--
  When the below is checked (default) our PR bot will automatically
  assign labels to your PR based on the content to help the team
  organize and review it faster.
-->

- [x] Auto label
sokra pushed a commit to vercel/next.js that referenced this pull request Mar 13, 2023
This:
* Adds a compile-time feature, `__internal_nextjs_integration_test`,
which is set when building Turbopack for the Next.js integration test
suite.
* When built with `__internal_nextjs_integration_test`, expects the
environment variable `NEXT_FONT_GOOGLE_MOCKED_RESPONSES` to be set with
an absolute path to a JavaScript file exporting a mapping of urls to
stylesheet text. This is used in place of making real requests to Google
Fonts.
* Addresses some small bugs in next/font/google to bring the
implementation in line with the urls generated by Next.js without
Turbopack.
* Changes classnames generated by next/font to use 6 character hashes,
bringing it in alignment with Next.js without Turbopack.

Test Plan:
* Adjusted existing unit tests
* In Next.js, `node run-tests.js -c 1 test/e2e/next-font/index.test.ts`

### Description

<!--
  ✍️ Write a short summary of your work.
  If necessary, include relevant screenshots.
-->

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->

<!--
  When the below is checked (default) our PR bot will automatically
  assign labels to your PR based on the content to help the team
  organize and review it faster.
-->

- [x] Auto label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants