Remove `useFonts` and embed them as part of the App Binary
Good morning Infinite Red,
I came across this X.com thread: https://x.com/aleqsio/status/1968273285239734405 and I read through the expo font docs: https://docs.expo.dev/versions/latest/sdk/font/
and they talk about the preference for fonts is to not use useFonts and load them asynchronously but to include them in the app binary using the expo-config-plugin. I just finished getting this working in my app, and here are all the diffs, which should be similar to ignite, just with different fonts:
App.tsx:
app.json:
package.json:
typography:
Then you have to add the font files under the assets/fonts folder.
This should theoretically decrease the TTI of the app and reduce splash screen show time.
Looks pretty sweet to me. What about Expo Web?
That's a solid question, didn't think about web. I'll look into that as well.
Thanks @ChristopherGabba! We've been talking about this a bit internally, the web question has come up but your solution looks like what we've been tossing around.
We'll take a closer look soon, I may not have time before next week but maybe someone else will. Just wanted to say thanks for the PR even if takes a bit for us to get to the review. :)
edit: meant to post this on the PR, haha.
Sounds good @coolsoftwaretyler, just made another small change and removed the unneeded android section from the config plugin after some more studying.
Feel free to adjust the code names, etc. to make more sense as needed, whichever you prefer!