Repository navigation
Download each web font once on a first visit - #104707
roryabraham merged 2 commits into
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@Krishna2323 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
dylanexpensify
left a comment
There was a problem hiding this comment.
refactor for performance, product input not required
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.5.21-0 🚀
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.5.23-0 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.5.23-3 🚀
Bundle Size Analysis (Sentry): |


Explanation of Change
Each web font was emitted twice: a fixed-name copy in
/fonts/and the hashed copy the charts import. So a first visit downloaded it twice, and the service worker a third time.fonts.cssis now bundled from the web entry and uses the hashed files, and the/fonts/copy is gone.This also removes the inline
@font-facerules for Expensify Neue Regular and Bold fromweb/index.html. They did not make those fonts download earlier: per CSS Fonts 4 §4.8.1, a browser downloads a font only when text on the page uses it, and by then the bundled CSS already declares the same faces. The early download comes from the<link rel="preload" as="font">tags, which already use the hashed URLs.Fixed Issues
$ #104392
PROPOSAL:
Tests
Test 1: Each font is downloaded once
npm run webFontExpensifyNeue-*,ExpensifyMono-*,ExpensifyNewKansas-*) is requested only once, under a hashed name such asExpensifyNeue-Regular.<hash>.woff2/fonts/...or/css/fonts.cssTest 2: The app still renders with the Expensify fonts
Expensify Neue`hello`Expensify MonoTest 3: The production build references only the hashed fonts
npm run builddist/fonts/does not existdist/index.htmland verify that it has no inline@font-facerules and no link to/css/fonts.css, and that there is exactly one<link rel="preload" as="font">per font, each pointing to a hashed file such as/ExpensifyNeue-Regular.<hash>.woff2dist/service-worker.jsand verify that each font appears once in the precache list, withrevision:nullOffline tests
QA Steps
Test 1: Each font is downloaded once (desktop Chrome only)
FontfilterExpensifyNeue-Regular.<hash>.woff2is not listed twiceExpensifyNeue-Regular.bfe6e44ce4.woff2, and that no font is loaded from a URL containing/fonts/Test 2: All fonts render correctly (all web platforms)
regular,bold,italicandbold italicin Expensify Neue, andinline codein the monospaced Expensify Mono fontTest 3: Fonts still render offline (desktop Chrome only)
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Test 1:
1.test.mov
Test 2:
Screen.Recording.2026-10-22.at.13.24.25.mov
Test 3: