Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from facebook:main #907

Merged
merged 2 commits into from
Jan 9, 2025
Merged

[pull] main from facebook:main #907

merged 2 commits into from
Jan 9, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented Jan 9, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

sebmarkbage and others added 2 commits January 9, 2025 10:33
Fonts flickering in while loading can be disturbing to any transition
but especially View Transitions. Even if they don't cause layout thrash
- the paint thrash is bad enough. We might add Suspensey fonts to all
Transitions in the future but it's especially a no-brainer for View
Transitions.

We need to apply mutations to the DOM first to know whether that will
trigger new fonts to load. For general Suspensey fonts, we'd have to
revert the commit by applying mutations in reverse to return to the
previous state. For View Transitions, since a snapshot is already
frozen, we can freeze the screen while we're waiting for the font at no
extra cost. It does mean that the page isn't responsive during this time
but we should only block this for a short period anyway.

The timeout needs to be short enough that it doesn't cause too much of
an issue when it's a new load and slow, yet long enough that you have a
chance to load it. Otherwise we wait for no reason. The assumption here
is that you likely have either cached the font or preloaded it earlier -
or you're on an extremely fast connection. This case is for optimizing
the high end experience.

Before:


/~https://github.com/user-attachments/assets/e0acfffe-fa49-40d6-82c3-5b08760175fb

After:


/~https://github.com/user-attachments/assets/615a03d3-9d6b-4eb1-8bd5-182c4c37a628

Note that since the Navigation is blocked on the font now the browser
spinner shows up while the font is loading.
## Summary

Callers for this method has been removed in
facebook/react-native@65bda54,
so these methods no longer need to be conditionally exported and the
feature flag can be removed.

## How did you test this change?

Flow fabric/native
@pull pull bot added the ⤵️ pull label Jan 9, 2025
@pull pull bot merged commit 74ea0c7 into zhengjitf:main Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants