Set didPerformSomeWork after performing work
Overview
Not sure if this fix is correct, but wanted to open to discuss.
performSyncWorkOnRoot can immediately throw 'Should not already be working.' without doing any work. When this happens, we catch the error and continue in the loop, which will throw again, and we're in an infinite loop.
Moving the check to after the work is complete will break the loop, but probably miss some work.
@yungsters and I found the loop when syncing the enableCache flag to RN. Turns out, RN internally is using mismatching versions of the renderer (main) and react (npm), so it's a busted setup that needs fixed, but exposed this hang.
Comparing: 64f354cf27a17c4e5b0dfcd908e47940cf947771...d7792699a89fdf7aeecd82c7120ecffbe2b35dd7
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 | = | 177.10 kB | 177.10 kB | = | 55.20 kB | 55.20 kB |
| oss-experimental/react-dom/cjs/react-dom.production.min.js | = | 177.64 kB | 177.64 kB | = | 55.53 kB | 55.53 kB |
| facebook-www/ReactDOM-prod.classic.js | = | 594.34 kB | 594.34 kB | = | 104.96 kB | 104.96 kB |
| facebook-www/ReactDOM-prod.modern.js | = | 577.60 kB | 577.60 kB | = | 102.02 kB | 102.02 kB |
| test_utils/ReactAllWarnings.js | Deleted | 66.60 kB | 0.00 kB | Deleted | 16.28 kB | 0.00 kB |
Significant size changes
Includes any change greater than 0.2%:
Expand to show
| Name | +/- | Base | Current | +/- gzip | Base gzip | Current gzip |
|---|---|---|---|---|---|---|
| test_utils/ReactAllWarnings.js | Deleted | 66.60 kB | 0.00 kB | Deleted | 16.28 kB | 0.00 kB |
Generated by :no_entry_sign: dangerJS against d7792699a89fdf7aeecd82c7120ecffbe2b35dd7
I think this is basically the same as this: https://github.com/facebook/react/pull/26746