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

feat(fonts): Prioritize woff2 #3003

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat(fonts): Prioritize woff2 #3003

wants to merge 1 commit into from

Conversation

jrood
Copy link
Contributor

@jrood jrood commented Jan 6, 2025

Overview

When we include a @font-face declaration with multiple files (e.g. woff and woff2), the browser will try the first file given and only load subsequent files if the first fails. Since woff2 has better compression and is supported by all evergreen browsers (including Safari), we should list woff2 first. These files are rendered in @font-face declarations here.

We also should only preload woff2 so that we don't waste critical early load-time network resources on woff1 files that likely won't be used.

PR Checklist

  • Related to designs:
  • Related to JIRA ticket: DOT-718
  • I have run this code to verify it works
  • This PR includes unit tests for the code change
  • This PR includes testing instructions tests for the code change
  • The alpha package of this PR is passing end-to-end tests in all relevant Codecademy repositories

Testing Instructions

  1. Visit the Portal PR ENV
  2. Open the network tab
  3. Reload the page
  4. Filter network requests using the search "apercu"
  5. Ensure we are only loading woff2 files and not woff.

PR Links and Envs

Repository PR Link PR Env
Monolith Monolith PR Monolith Env
Portal Portal PR Portal Env

@jrood jrood requested a review from a team as a code owner January 6, 2025 17:57
@jrood jrood requested review from BandanaKM and dreamwasp January 6, 2025 17:57
Copy link

nx-cloud bot commented Jan 6, 2025

View your CI Pipeline Execution ↗ for commit 9d95ebc.


☁️ Nx Cloud last updated this comment at 2025-01-06 22:56:05 UTC

@jrood jrood changed the title Give woff2 priority feat(fonts): Give woff2 priority Jan 6, 2025
@jrood jrood marked this pull request as draft January 6, 2025 17:59
@jrood jrood force-pushed the jrood.woff2-priority branch from e89971f to b161769 Compare January 6, 2025 18:51
@jrood jrood changed the title feat(fonts): Give woff2 priority feat(Fonts): Give woff2 priority Jan 6, 2025
@jrood jrood force-pushed the jrood.woff2-priority branch from b161769 to cab68fb Compare January 6, 2025 22:44
@jrood jrood changed the title feat(Fonts): Give woff2 priority feat(fonts): Prioritize woff2 Jan 6, 2025
@jrood jrood force-pushed the jrood.woff2-priority branch from cab68fb to a72a8a9 Compare January 6, 2025 22:49
@jrood jrood force-pushed the jrood.woff2-priority branch from a72a8a9 to 9d95ebc Compare January 6, 2025 22:50
@codecademydev
Copy link
Collaborator

🚀 Styleguide deploy preview ready!

https://677c5f50f2c08b6c195f12b6--gamut-preview.netlify.app

Deploy Logs

@codecademydev
Copy link
Collaborator

📬Published Alpha Packages:

@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]

@jrood jrood marked this pull request as ready for review January 7, 2025 14:02
@jrood jrood requested review from BandanaKM, dreamwasp, a team, christian-dinh and klcodecademy and removed request for a team January 7, 2025 14:03
Copy link

@klcodecademy klcodecademy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been able to confirm that fonts being preloaded are in the woff2 format

@jrood jrood enabled auto-merge (squash) January 8, 2025 13:37
@jrood jrood disabled auto-merge January 8, 2025 13:38
@jrood jrood requested a review from aresnik11 January 8, 2025 20:29
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.

3 participants