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

Check if suspensey instance resolves in immediate task #26427

Merged
merged 1 commit into from
Mar 20, 2023

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Mar 19, 2023

When rendering a suspensey resource that we haven't seen before, it may have loaded in the background while we were rendering. We should yield to the main thread to see if the load event fires in an immediate task.

For example, if the resource for a link element has already loaded, its load event will fire in a task right after React yields to the main thread. Because the continuation task is not scheduled until right before React yields, the load event will ping React before it resumes.

If this happens, we can resume rendering without showing a fallback.

I don't think this matters much for images, because the completed property tells us whether the image has loaded, and during a non-urgent render, we never block the main thread for more than 5ms at a time (for now — we might increase this in the future). It matters more for stylesheets because the only way to check if it has loaded is by listening for the load event.

This is essentially the same trick that use does for userspace promises, but a bit simpler because we don't need to replay the host component's begin phase; the work-in-progress fiber already completed, so we can just continue onto the next sibling without any additional work.

As part of this change, I split the shouldSuspendCommit host config method into separate maySuspendCommit and preloadInstance methods. Previously shouldSuspendCommit was used for both.

This raised a question of whether we should preload resources during a synchronous render. My initial instinct was that we shouldn't, because we're going to synchronously block the main thread until the resource is inserted into the DOM, anyway. But I wonder if the browser is able to initiate the preload even while the main thread is blocked. It's probably a micro-optimization either way because most resources will be loaded during transitions, not urgent renders.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Mar 19, 2023
@acdlite acdlite force-pushed the suspensey-commits-immediate-load branch from 2e42765 to 7f8169b Compare March 19, 2023 01:36
@react-sizebot
Copy link

react-sizebot commented Mar 19, 2023

Comparing: 842bd78...3fcd918

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js +0.17% 157.77 kB 158.03 kB +0.20% 50.28 kB 50.38 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.17% 159.36 kB 159.62 kB +0.23% 50.79 kB 50.91 kB
facebook-www/ReactDOM-prod.classic.js +0.24% 542.73 kB 544.06 kB +0.18% 96.62 kB 96.80 kB
facebook-www/ReactDOM-prod.modern.js +0.25% 526.47 kB 527.77 kB +0.19% 94.16 kB 94.33 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-noop-renderer/cjs/react-noop-renderer.production.min.js +0.88% 15.16 kB 15.29 kB +1.18% 4.56 kB 4.61 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer.production.min.js +0.88% 15.16 kB 15.29 kB +1.18% 4.56 kB 4.61 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer.production.min.js +0.88% 15.16 kB 15.29 kB +1.18% 4.56 kB 4.61 kB
oss-experimental/react-noop-renderer/cjs/react-noop-renderer-persistent.production.min.js +0.88% 15.22 kB 15.36 kB +1.16% 4.58 kB 4.63 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer-persistent.production.min.js +0.88% 15.22 kB 15.36 kB +1.16% 4.58 kB 4.63 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer-persistent.production.min.js +0.88% 15.22 kB 15.36 kB +1.16% 4.58 kB 4.63 kB
oss-experimental/react-noop-renderer/cjs/react-noop-renderer.development.js +0.83% 42.01 kB 42.36 kB +1.76% 9.43 kB 9.59 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer.development.js +0.83% 42.01 kB 42.36 kB +1.76% 9.43 kB 9.59 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer.development.js +0.83% 42.01 kB 42.36 kB +1.76% 9.43 kB 9.59 kB
oss-experimental/react-noop-renderer/cjs/react-noop-renderer-persistent.development.js +0.83% 42.15 kB 42.49 kB +1.77% 9.44 kB 9.61 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer-persistent.development.js +0.83% 42.15 kB 42.49 kB +1.77% 9.44 kB 9.61 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer-persistent.development.js +0.83% 42.15 kB 42.49 kB +1.77% 9.44 kB 9.61 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-prod.js +0.46% 293.38 kB 294.74 kB +0.39% 51.80 kB 52.00 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.development.js +0.46% 762.57 kB 766.08 kB +0.50% 165.89 kB 166.72 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.development.js +0.46% 762.59 kB 766.10 kB +0.50% 165.92 kB 166.74 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.development.js +0.46% 762.96 kB 766.47 kB +0.50% 166.02 kB 166.84 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.development.js +0.46% 798.76 kB 802.42 kB +0.47% 167.80 kB 168.58 kB
oss-stable/react-test-renderer/umd/react-test-renderer.development.js +0.46% 798.78 kB 802.44 kB +0.47% 167.82 kB 168.60 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.development.js +0.46% 799.18 kB 802.83 kB +0.47% 167.90 kB 168.68 kB
oss-stable-semver/react-art/cjs/react-art.development.js +0.45% 783.19 kB 786.70 kB +0.43% 170.11 kB 170.84 kB
oss-stable/react-art/cjs/react-art.development.js +0.45% 783.21 kB 786.72 kB +0.43% 170.13 kB 170.86 kB
oss-experimental/react-art/cjs/react-art.development.js +0.44% 791.52 kB 795.03 kB +0.43% 171.64 kB 172.37 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-profiling.js +0.44% 309.11 kB 310.47 kB +0.34% 54.18 kB 54.36 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-dev.js +0.43% 777.73 kB 781.09 kB +0.48% 167.76 kB 168.57 kB
react-native/implementations/ReactFabric-prod.js +0.43% 316.97 kB 318.33 kB +0.39% 55.91 kB 56.13 kB
facebook-www/ReactTestRenderer-dev.modern.js +0.42% 793.96 kB 797.32 kB +0.46% 170.94 kB 171.72 kB
facebook-www/ReactTestRenderer-dev.classic.js +0.42% 793.96 kB 797.32 kB +0.46% 170.93 kB 171.72 kB
react-native/implementations/ReactNativeRenderer-prod.js +0.42% 323.43 kB 324.79 kB +0.36% 56.96 kB 57.16 kB
react-native/implementations/ReactFabric-prod.fb.js +0.42% 327.71 kB 329.07 kB +0.38% 57.90 kB 58.12 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.development.js +0.41% 880.22 kB 883.85 kB +0.39% 187.63 kB 188.35 kB
oss-stable/react-reconciler/cjs/react-reconciler.development.js +0.41% 880.24 kB 883.88 kB +0.39% 187.65 kB 188.38 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js +0.41% 888.55 kB 892.19 kB +0.39% 189.19 kB 189.92 kB
react-native/implementations/ReactNativeRenderer-prod.fb.js +0.41% 334.15 kB 335.51 kB +0.35% 59.03 kB 59.24 kB
oss-stable-semver/react-art/umd/react-art.development.js +0.41% 897.12 kB 900.77 kB +0.37% 189.23 kB 189.92 kB
oss-stable/react-art/umd/react-art.development.js +0.41% 897.14 kB 900.80 kB +0.37% 189.25 kB 189.94 kB
react-native/implementations/ReactFabric-profiling.js +0.41% 336.36 kB 337.72 kB +0.31% 59.10 kB 59.28 kB
oss-experimental/react-art/umd/react-art.development.js +0.40% 905.92 kB 909.57 kB +0.37% 190.75 kB 191.45 kB
react-native/implementations/ReactNativeRenderer-profiling.js +0.40% 342.85 kB 344.22 kB +0.32% 60.20 kB 60.39 kB
react-native/implementations/ReactFabric-dev.js +0.39% 846.90 kB 850.20 kB +0.43% 183.28 kB 184.05 kB
react-native/implementations/ReactNativeRenderer-dev.js +0.39% 859.60 kB 862.95 kB +0.44% 186.91 kB 187.72 kB
react-native/implementations/ReactFabric-profiling.fb.js +0.38% 354.94 kB 356.31 kB +0.35% 62.10 kB 62.32 kB
facebook-www/ReactART-prod.modern.js +0.38% 329.20 kB 330.45 kB +0.34% 55.84 kB 56.03 kB
facebook-www/ReactART-dev.modern.js +0.38% 883.29 kB 886.65 kB +0.39% 187.54 kB 188.27 kB
react-native/implementations/ReactNativeRenderer-profiling.fb.js +0.38% 361.42 kB 362.79 kB +0.37% 63.26 kB 63.49 kB
facebook-www/ReactART-dev.classic.js +0.38% 894.49 kB 897.84 kB +0.37% 189.84 kB 190.54 kB
react-native/implementations/ReactNativeRenderer-dev.fb.js +0.37% 896.42 kB 899.78 kB +0.38% 194.18 kB 194.92 kB
react-native/implementations/ReactFabric-dev.fb.js +0.37% 883.74 kB 887.05 kB +0.38% 190.59 kB 191.32 kB
facebook-www/ReactART-prod.classic.js +0.37% 340.18 kB 341.43 kB +0.33% 57.74 kB 57.93 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.min.js +0.37% 101.62 kB 101.99 kB +0.35% 31.11 kB 31.22 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.min.js +0.37% 101.67 kB 102.04 kB +0.34% 31.14 kB 31.24 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.production.min.js +0.37% 101.79 kB 102.16 kB +0.36% 31.17 kB 31.29 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.production.min.js +0.36% 102.19 kB 102.56 kB +0.47% 31.58 kB 31.73 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.production.min.js +0.36% 102.01 kB 102.38 kB +0.43% 31.52 kB 31.66 kB
oss-stable/react-test-renderer/umd/react-test-renderer.production.min.js +0.36% 102.06 kB 102.43 kB +0.43% 31.55 kB 31.69 kB
oss-stable-semver/react-dom/cjs/react-dom.development.js +0.32% 1,207.99 kB 1,211.83 kB +0.28% 269.07 kB 269.83 kB
oss-stable/react-dom/cjs/react-dom.development.js +0.32% 1,208.01 kB 1,211.86 kB +0.28% 269.10 kB 269.85 kB
oss-experimental/react-dom/cjs/react-dom.development.js +0.32% 1,218.07 kB 1,221.92 kB +0.28% 270.97 kB 271.73 kB
oss-stable-semver/react-dom/umd/react-dom.development.js +0.32% 1,266.00 kB 1,269.99 kB +0.27% 271.91 kB 272.63 kB
oss-stable/react-dom/umd/react-dom.development.js +0.32% 1,266.02 kB 1,270.02 kB +0.27% 271.93 kB 272.66 kB
oss-experimental/react-dom/umd/react-dom.development.js +0.31% 1,276.61 kB 1,280.61 kB +0.26% 273.82 kB 274.53 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.development.js +0.31% 1,236.18 kB 1,240.03 kB +0.27% 275.37 kB 276.12 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.production.min.js +0.30% 110.83 kB 111.16 kB +0.30% 33.64 kB 33.74 kB
oss-stable/react-reconciler/cjs/react-reconciler.production.min.js +0.30% 110.85 kB 111.19 kB +0.29% 33.66 kB 33.76 kB
oss-experimental/react-reconciler/cjs/react-reconciler.production.min.js +0.30% 112.35 kB 112.69 kB +0.29% 34.10 kB 34.20 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.profiling.min.js +0.29% 119.82 kB 120.16 kB +0.29% 35.82 kB 35.93 kB
oss-stable/react-reconciler/cjs/react-reconciler.profiling.min.js +0.29% 119.84 kB 120.19 kB +0.29% 35.84 kB 35.95 kB
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.min.js +0.28% 121.34 kB 121.68 kB +0.26% 36.31 kB 36.41 kB
facebook-www/ReactDOM-dev.modern.js +0.28% 1,338.17 kB 1,341.85 kB +0.26% 291.94 kB 292.69 kB
facebook-www/ReactDOMTesting-dev.modern.js +0.27% 1,356.57 kB 1,360.25 kB +0.25% 296.32 kB 297.06 kB
facebook-www/ReactDOM-dev.classic.js +0.27% 1,365.78 kB 1,369.46 kB +0.25% 297.21 kB 297.95 kB
facebook-www/ReactDOMTesting-dev.classic.js +0.27% 1,384.27 kB 1,387.95 kB +0.25% 301.38 kB 302.13 kB
oss-stable-semver/react-art/cjs/react-art.production.min.js +0.26% 93.71 kB 93.95 kB +0.34% 28.75 kB 28.85 kB
oss-stable/react-art/cjs/react-art.production.min.js +0.26% 93.75 kB 94.00 kB +0.34% 28.78 kB 28.87 kB
oss-experimental/react-art/cjs/react-art.production.min.js +0.26% 95.26 kB 95.51 kB +0.35% 29.21 kB 29.31 kB
facebook-www/ReactDOM-prod.modern.js +0.25% 526.47 kB 527.77 kB +0.19% 94.16 kB 94.33 kB
facebook-www/ReactDOM-prod.classic.js +0.24% 542.73 kB 544.06 kB +0.18% 96.62 kB 96.80 kB
facebook-www/ReactDOMTesting-prod.modern.js +0.24% 543.01 kB 544.31 kB +0.17% 98.19 kB 98.35 kB
facebook-www/ReactDOM-profiling.modern.js +0.24% 556.75 kB 558.06 kB +0.18% 98.67 kB 98.84 kB
facebook-www/ReactDOMTesting-prod.classic.js +0.23% 557.31 kB 558.62 kB +0.17% 100.14 kB 100.31 kB
facebook-www/ReactDOM-profiling.classic.js +0.23% 573.10 kB 574.41 kB +0.18% 101.15 kB 101.33 kB

Generated by 🚫 dangerJS against 3fcd918

@acdlite acdlite force-pushed the suspensey-commits-immediate-load branch from 7f8169b to 0cfbe6d Compare March 19, 2023 01:46
@acdlite acdlite marked this pull request as ready for review March 19, 2023 02:17
@acdlite acdlite requested a review from gnoff March 19, 2023 02:17
@acdlite acdlite force-pushed the suspensey-commits-immediate-load branch from 0cfbe6d to 9cc698b Compare March 19, 2023 03:46
When rendering a suspensey resource that we haven't seen before, it may
have loaded in the background while we were rendering. We should yield
to the main thread to see if the load event fires in an immediate task.

For example, if the resource for a link element has already loaded, its
load event will fire in a task right after React yields to the main
thread. Because the continuation task is not scheduled until right
before React yields, the load event will ping React before it resumes.

If this happens, we can resume rendering without showing a fallback.

I don't think this matters much for images, because the `completed`
property tells us whether the image has loaded, and we currently never
block the main thread for more than 5ms at a time (for now — we might
increase this in the future). It matters more for stylesheets because
the only way to check if it has loaded is by listening for the
load event.

This is essentially the same trick that `use` does for userspace
promises, but a bit simpler because we don't need to replay the host
component's begin phase; the work-in-progress fiber already completed,
so we can just continue onto the next sibling without any
additional work.

As part of this change, I split the `shouldSuspendCommit` host
config method into separate `maySuspendCommit` and `preloadInstance`
methods. Previously `shouldSuspendCommit` was used for both.

This raised a question of whether we should preload resources during
a synchronous render. My initial instinct was that we shouldn't,
because we're going to synchronously block the main thread until the
resource is inserted into the DOM, anyway. But I wonder if the browser
is able to initiate the preload even while the main thread is blocked.
It's probably a micro-optimization either way because most resources
will be loaded during transitions, not urgent renders.
@acdlite acdlite force-pushed the suspensey-commits-immediate-load branch from 9cc698b to 3fcd918 Compare March 20, 2023 05:06
Copy link
Collaborator

@gnoff gnoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one thing I'm unclear on is what causes the immediate resumption of the render? In the use case I thought that the thenable was set up to ping but there is nothing like that for the host version here. Maybe I misunderstood and the use case always immediately continues in another task but if the fullfilled value isn't present that communicates that the thenable did not resolve and a fresh stack is needed? Since this isn't integral to the changes you made and they make sense I'll approve

@acdlite
Copy link
Collaborator Author

acdlite commented Mar 20, 2023

It's basically the same as how you're describing except instead of checking fulfilled it calls preloadInstance again. The renderer is responsible for checking whatever its equivalent of a status field is:

const isReady = preloadInstance(type, props);
if (isReady) {
// The data resolved. Resume the work loop as if nothing
// suspended. Unlike when a user component suspends, we don't
// have to replay anything because the host fiber
// already completed.
workInProgressSuspendedReason = NotSuspended;
workInProgressThrownValue = null;
const sibling = hostFiber.sibling;
if (sibling !== null) {
workInProgress = sibling;
} else {
const returnFiber = hostFiber.return;
if (returnFiber !== null) {
workInProgress = returnFiber;
completeUnitOfWork(returnFiber);
} else {
workInProgress = null;
}
}
break resumeOrUnwind;
}
break;

@acdlite acdlite merged commit 0131d0c into facebook:main Mar 20, 2023
github-actions bot pushed a commit that referenced this pull request Mar 20, 2023
When rendering a suspensey resource that we haven't seen before, it may
have loaded in the background while we were rendering. We should yield
to the main thread to see if the load event fires in an immediate task.

For example, if the resource for a link element has already loaded, its
load event will fire in a task right after React yields to the main
thread. Because the continuation task is not scheduled until right
before React yields, the load event will ping React before it resumes.

If this happens, we can resume rendering without showing a fallback.

I don't think this matters much for images, because the `completed`
property tells us whether the image has loaded, and during a non-urgent
render, we never block the main thread for more than 5ms at a time (for
now — we might increase this in the future). It matters more for
stylesheets because the only way to check if it has loaded is by
listening for the load event.

This is essentially the same trick that `use` does for userspace
promises, but a bit simpler because we don't need to replay the host
component's begin phase; the work-in-progress fiber already completed,
so we can just continue onto the next sibling without any additional
work.

As part of this change, I split the `shouldSuspendCommit` host config
method into separate `maySuspendCommit` and `preloadInstance` methods.
Previously `shouldSuspendCommit` was used for both.

This raised a question of whether we should preload resources during a
synchronous render. My initial instinct was that we shouldn't, because
we're going to synchronously block the main thread until the resource is
inserted into the DOM, anyway. But I wonder if the browser is able to
initiate the preload even while the main thread is blocked. It's
probably a micro-optimization either way because most resources will be
loaded during transitions, not urgent renders.

DiffTrain build for [0131d0c](0131d0c)
kassens added a commit to kassens/react that referenced this pull request Mar 20, 2023
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Mar 29, 2023
Summary:
This sync includes the following changes:
- **[77ba1618a](facebook/react@77ba1618a )**: Bugfix: Remove extra render pass when reverting to client render ([#26445](facebook/react#26445)) //<Andrew Clark>//
- **[520f7f3ed](facebook/react@520f7f3ed )**: Refactor ReactDOMComponent to use flatter property operations ([#26433](facebook/react#26433)) //<Sebastian Markbåge>//
- **[0131d0cff](facebook/react@0131d0cff )**: Check if suspensey instance resolves in immediate task ([#26427](facebook/react#26427)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 3554c88...77ba161

jest_e2e[run_all_tests]

Reviewed By: poteto

Differential Revision: D44476026

fbshipit-source-id: c6935d760a068672b714722dee1fd24839c08c4b
jeongshin pushed a commit to jeongshin/react-native that referenced this pull request May 7, 2023
Summary:
This sync includes the following changes:
- **[77ba1618a](facebook/react@77ba1618a )**: Bugfix: Remove extra render pass when reverting to client render ([facebook#26445](facebook/react#26445)) //<Andrew Clark>//
- **[520f7f3ed](facebook/react@520f7f3ed )**: Refactor ReactDOMComponent to use flatter property operations ([facebook#26433](facebook/react#26433)) //<Sebastian Markbåge>//
- **[0131d0cff](facebook/react@0131d0cff )**: Check if suspensey instance resolves in immediate task ([facebook#26427](facebook/react#26427)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 3554c88...77ba161

jest_e2e[run_all_tests]

Reviewed By: poteto

Differential Revision: D44476026

fbshipit-source-id: c6935d760a068672b714722dee1fd24839c08c4b
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
This sync includes the following changes:
- **[77ba1618a](facebook/react@77ba1618a )**: Bugfix: Remove extra render pass when reverting to client render ([facebook#26445](facebook/react#26445)) //<Andrew Clark>//
- **[520f7f3ed](facebook/react@520f7f3ed )**: Refactor ReactDOMComponent to use flatter property operations ([facebook#26433](facebook/react#26433)) //<Sebastian Markbåge>//
- **[0131d0cff](facebook/react@0131d0cff )**: Check if suspensey instance resolves in immediate task ([facebook#26427](facebook/react#26427)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 3554c88...77ba161

jest_e2e[run_all_tests]

Reviewed By: poteto

Differential Revision: D44476026

fbshipit-source-id: c6935d760a068672b714722dee1fd24839c08c4b
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
When rendering a suspensey resource that we haven't seen before, it may
have loaded in the background while we were rendering. We should yield
to the main thread to see if the load event fires in an immediate task.

For example, if the resource for a link element has already loaded, its
load event will fire in a task right after React yields to the main
thread. Because the continuation task is not scheduled until right
before React yields, the load event will ping React before it resumes.

If this happens, we can resume rendering without showing a fallback.

I don't think this matters much for images, because the `completed`
property tells us whether the image has loaded, and during a non-urgent
render, we never block the main thread for more than 5ms at a time (for
now — we might increase this in the future). It matters more for
stylesheets because the only way to check if it has loaded is by
listening for the load event.

This is essentially the same trick that `use` does for userspace
promises, but a bit simpler because we don't need to replay the host
component's begin phase; the work-in-progress fiber already completed,
so we can just continue onto the next sibling without any additional
work.

As part of this change, I split the `shouldSuspendCommit` host config
method into separate `maySuspendCommit` and `preloadInstance` methods.
Previously `shouldSuspendCommit` was used for both.

This raised a question of whether we should preload resources during a
synchronous render. My initial instinct was that we shouldn't, because
we're going to synchronously block the main thread until the resource is
inserted into the DOM, anyway. But I wonder if the browser is able to
initiate the preload even while the main thread is blocked. It's
probably a micro-optimization either way because most resources will be
loaded during transitions, not urgent renders.

DiffTrain build for commit 0131d0c.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants