Conversation
gregorbg
left a comment
There was a problem hiding this comment.
Thanks! Here are some thoughts and "historical knowledge" on the font loading from me :)
| const { ttNormsPro } = await import("@/styles/fonts"); | ||
|
|
||
| return ttNormsPro; |
There was a problem hiding this comment.
With the Webpack import rewrite, is this asynchronous approach even still necessary now?
It has "grown to be" this await import syntax, precisely because we tried very hard to avoid Webpack trying to load the font files. Ultimately, it never worked though, so technically even in the current status quo codebase the await import is completely unnecessary.
With your custom import resolution, I would expect that it is even more unnecessary. So I have a hunch that this can be hugely simplified and turned into a fully synchronous function.
| { prop: "descent-override", value: "-33%" }, | ||
| ], | ||
| }); | ||
| const ttNormsPro = Rubik({ subsets: ["latin"] }); |
There was a problem hiding this comment.
should we now not just rename both of these too appFont?
| ], | ||
| }); | ||
|
|
||
| export { ttNormsPro }; |
There was a problem hiding this comment.
should we now not just rename both of these too appFont?
|
Your original PR description says "tested locally". What exactly have you tested? I cannot opt into the proprietary files on my local machine. Even if I use a |
2fc95eb to
cd23889
Compare
gregorbg
left a comment
There was a problem hiding this comment.
Sorry for commandeering your PR, but even though I had the proprietary font files available it still took a heck of a long time to debug this. SWC is persistent about localFont like you wouldn't imagine!
Implemented by codex and tested locally
What changed
Why
.woff2filesImpact
PROPRIETARY_FONT=TTNormsProValidation
yarn check:types