[iOS][font] Stop scoping font family name in Expo Go #28344
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
There is no more a reason to scope font family names in Expo Go on iOS. Fonts must be shared between different projects and scoping their names can only cause troubles. In this particular case, because scoped name contains a session ID, the same font loaded by home and NCL would have different font family aliases. As a result NCL is not able to unregister the previous font (from home) to register its own, i.e. it can't get inside this if:
expo/packages/expo-font/ios/FontLoaderModule.swift
Lines 12 to 16 in 739f16d
How
Modified
fontFamilyNeedsScoping
function so that it will never returntrue
on iOS. I'm not sure what's the current situation on Android, but maybe we can remove scoping entirely (for sure too late for SDK 51).Also excluded some tests on iOS that no longer make any sense. Looks like we could remove even more if we do a similar thing on Android (entirely remove
describe('within Expo Go')
)To do once this PR is merged: publish dev home
Test Plan