-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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
[Fizz]: Unify preload queue #27190
[Fizz]: Unify preload queue #27190
Conversation
10f8295
to
29f352c
Compare
29f352c
to
c8add69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% sure I get the argument/rationale here.
I'm saying that absent another singal, like the fact that a resource was actually rendered, we should treat all preloads as the same priority from a flushing order standpoint because it allows the user to decide which assets to prioritize over others using fetchPriority. If we create a flushing hierarchy this can still be done but the browser (or responding server) may already be busy handling lower priority requests when something high priority comes in. So by making there be a single queue we influence the implicit priority of "arbitrary" preloads less. There are exceptions like fonts which we will never "render" but must be treated as being very high priority so those still have their own queue. Does that help clarify or is it still not clear? |
…int is to allow a sort of prioritization by the user via fetchPriority and order of preload calls and by making them use different queues we limit how much control you can have it ordering preloads
c8add69
to
2e5e20e
Compare
Currently React attempts to prioritize certain preloads over others based on their type. This is at odds with allowing the user to control priority by ordering which calls are made first. There are some asset types that generally should just be prioritized first such as fonts since we don't know when fonts will be used and they either block display or may lead to fallback fonts being used. But for scripts and stylesheets we can emit them in the order received with other arbitrary preload types. We will eventually add support for emitting suspensey image preloads before other resources because these also block display however that implementation will look at which images are actually rendered rather than simply preloaded. DiffTrain build for [cb3404a](cb3404a)
Updated React from 9377e1010 to cb3404a0c. ### React upstream changes - facebook/react#27190 - facebook/react#27189 - facebook/react#27201 - facebook/react#27147 - facebook/react#26949 - facebook/react#27058 - facebook/react#27142 - facebook/react#27133 - facebook/react#27130 - facebook/react#27105 - facebook/react#27117 - facebook/react#27057
Currently React attempts to prioritize certain preloads over others based on their type. This is at odds with allowing the user to control priority by ordering which calls are made first. There are some asset types that generally should just be prioritized first such as fonts since we don't know when fonts will be used and they either block display or may lead to fallback fonts being used. But for scripts and stylesheets we can emit them in the order received with other arbitrary preload types. We will eventually add support for emitting suspensey image preloads before other resources because these also block display however that implementation will look at which images are actually rendered rather than simply preloaded.
Currently React attempts to prioritize certain preloads over others based on their type. This is at odds with allowing the user to control priority by ordering which calls are made first. There are some asset types that generally should just be prioritized first such as fonts since we don't know when fonts will be used and they either block display or may lead to fallback fonts being used. But for scripts and stylesheets we can emit them in the order received with other arbitrary preload types. We will eventually add support for emitting suspensey image preloads before other resources because these also block display however that implementation will look at which images are actually rendered rather than simply preloaded. DiffTrain build for commit cb3404a.
stacked on #27189
Currently React attempts to prioritize certain preloads over others based on their type. This is at odds with allowing the user to control priority by ordering which calls are made first. There are some asset types that generally should just be prioritized first such as fonts since we don't know when fonts will be used and they either block display or may lead to fallback fonts being used. But for scripts and stylesheets we can emit them in the order received with other arbitrary preload types.
We will eventually add support for emitting suspensey image preloads before other resources because these also block display however that implementation will look at which images are actually rendered rather than simply preloaded.