ENG-9668: feat: add rx.google_font for faster font loading from the document head#6597
ENG-9668: feat: add rx.google_font for faster font loading from the document head#6597FarhanAliRaza wants to merge 3 commits into
Conversation
Loading fonts via rx.App(stylesheets=...) chains them behind an @import in the global stylesheet, so the browser only discovers the font after parsing that sheet, delaying first paint. rx.google_font emits preconnect hints and a display=swap stylesheet link for head_components, letting the browser fetch the font during initial HTML parse. Also adds the `as_` prop to el.link so rel="preload" links work.
adhami3310
left a comment
There was a problem hiding this comment.
this might make more sense in reflex-enterprise
Greptile SummaryThis PR introduces
Confidence Score: 3/5Safe to merge after guarding against an empty The core logic for building the Google Fonts URL is correct and well-tested, but passing an empty reflex/utils/misc.py — the Important Files Changed
Reviews (1): Last reviewed commit: "feat: add rx.google_font for faster font..." | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Loading fonts via rx.App(stylesheets=...) chains them behind an @import in the global stylesheet, so the browser only discovers the font after parsing that sheet, delaying first paint. rx.google_font emits preconnect hints and a display=swap stylesheet link for head_components, letting the browser fetch the font during initial HTML parse. Also adds the
as_prop to el.link so rel="preload" links work.All Submissions:
Type of change
Please delete options that are not relevant.
New Feature Submission:
Changes To Core Features: