Commit b4546cd
authored
[enableInfiniteRenderLoopDetection] Warn about potential infinite loop, instead of interrupting (facebook#35999)
The `enableInfiniteRenderLoopDetection` feature flag is currently
disabled everywhere. When attempted to roll out this at Meta, we've
observed multiple false-positives, where counter-based approach would
interrupt the render that would've resolved at some later iteration.
This change gates the scenarios that are only discovered with the
instrumentation behind `enableInfiniteRenderLoopDetection` flag to warn
about potential infinite loop, instead of throwing an error and hitting
an error boundary. The main reason is to see if we can a signal on which
possible area of scenarios this new approach to infinite loops covers.
The gist of the approach is to ensure that we are still throwing error
and breaking the infinite loop, if we were doing this without
`enableInfiniteRenderLoopDetection` feature flag enabled.
This will log multiple errors if there is an infinite loop, but this
should be fine, and it also aligns with the pattern for warnings about
passive effects infinite loop.
I've validated that tests in `ReactUpdates-test.js` are passing
independently whether the feature flag is enabled or not.1 parent 3f0b9e6 commit b4546cd
File tree
2 files changed
+109
-53
lines changed- packages
- react-dom/src/__tests__
- react-reconciler/src
2 files changed
+109
-53
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1792 | 1792 | | |
1793 | 1793 | | |
1794 | 1794 | | |
1795 | | - | |
1796 | | - | |
| 1795 | + | |
| 1796 | + | |
1797 | 1797 | | |
1798 | 1798 | | |
1799 | 1799 | | |
| |||
1809 | 1809 | | |
1810 | 1810 | | |
1811 | 1811 | | |
1812 | | - | |
1813 | | - | |
1814 | | - | |
1815 | | - | |
1816 | | - | |
1817 | | - | |
1818 | | - | |
1819 | | - | |
1820 | | - | |
1821 | | - | |
1822 | | - | |
1823 | | - | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
1824 | 1831 | | |
1825 | 1832 | | |
1826 | | - | |
1827 | | - | |
| 1833 | + | |
| 1834 | + | |
1828 | 1835 | | |
1829 | 1836 | | |
1830 | 1837 | | |
| |||
1840 | 1847 | | |
1841 | 1848 | | |
1842 | 1849 | | |
1843 | | - | |
1844 | | - | |
1845 | | - | |
1846 | | - | |
1847 | | - | |
1848 | | - | |
1849 | | - | |
1850 | | - | |
1851 | | - | |
1852 | | - | |
1853 | | - | |
1854 | | - | |
1855 | | - | |
1856 | | - | |
1857 | | - | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
1858 | 1869 | | |
1859 | 1870 | | |
1860 | 1871 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
751 | 751 | | |
752 | 752 | | |
753 | 753 | | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
754 | 759 | | |
755 | 760 | | |
756 | 761 | | |
| |||
4313 | 4318 | | |
4314 | 4319 | | |
4315 | 4320 | | |
| 4321 | + | |
| 4322 | + | |
| 4323 | + | |
| 4324 | + | |
| 4325 | + | |
| 4326 | + | |
| 4327 | + | |
| 4328 | + | |
| 4329 | + | |
| 4330 | + | |
| 4331 | + | |
| 4332 | + | |
| 4333 | + | |
| 4334 | + | |
| 4335 | + | |
| 4336 | + | |
| 4337 | + | |
| 4338 | + | |
| 4339 | + | |
4316 | 4340 | | |
4317 | 4341 | | |
4318 | 4342 | | |
4319 | | - | |
4320 | | - | |
4321 | | - | |
4322 | | - | |
4323 | | - | |
4324 | | - | |
| 4343 | + | |
| 4344 | + | |
4325 | 4345 | | |
4326 | 4346 | | |
4327 | 4347 | | |
| |||
4335 | 4355 | | |
4336 | 4356 | | |
4337 | 4357 | | |
| 4358 | + | |
4338 | 4359 | | |
4339 | 4360 | | |
| 4361 | + | |
| 4362 | + | |
4340 | 4363 | | |
4341 | 4364 | | |
4342 | 4365 | | |
| |||
5152 | 5175 | | |
5153 | 5176 | | |
5154 | 5177 | | |
| 5178 | + | |
| 5179 | + | |
| 5180 | + | |
5155 | 5181 | | |
5156 | | - | |
5157 | | - | |
5158 | | - | |
5159 | | - | |
5160 | | - | |
5161 | | - | |
5162 | | - | |
5163 | | - | |
5164 | | - | |
| 5182 | + | |
| 5183 | + | |
| 5184 | + | |
| 5185 | + | |
| 5186 | + | |
| 5187 | + | |
| 5188 | + | |
| 5189 | + | |
| 5190 | + | |
| 5191 | + | |
| 5192 | + | |
| 5193 | + | |
| 5194 | + | |
| 5195 | + | |
| 5196 | + | |
| 5197 | + | |
| 5198 | + | |
| 5199 | + | |
| 5200 | + | |
| 5201 | + | |
| 5202 | + | |
| 5203 | + | |
| 5204 | + | |
| 5205 | + | |
| 5206 | + | |
| 5207 | + | |
| 5208 | + | |
| 5209 | + | |
5165 | 5210 | | |
| 5211 | + | |
| 5212 | + | |
| 5213 | + | |
| 5214 | + | |
| 5215 | + | |
| 5216 | + | |
| 5217 | + | |
5166 | 5218 | | |
5167 | | - | |
5168 | | - | |
5169 | | - | |
5170 | | - | |
5171 | | - | |
5172 | | - | |
5173 | | - | |
5174 | 5219 | | |
5175 | 5220 | | |
5176 | 5221 | | |
| |||
0 commit comments