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

Fix crash during server render in React 16.6.0 #14103

Merged

Conversation

tnunes
Copy link
Contributor

@tnunes tnunes commented Nov 5, 2018

This fixes a bug introduced in React 16.6.0, which was not present in 16.5.2.

Runtimes without setTimeout and clearTimeout (e.g. ClearScript for .NET) are now crashing just by importing react-dom.

This replicates the fix for scheduler introduced in #13088 for react-dom, by checking for existence of setTimeout and clearTimeout in the runtime before using them.

Check for existence of `setTimeout` and `clearTimeout` in the runtime
before using them, to ensure runtimes without them (like .NET ClearScript)
do not crash just by importing `react-dom`.
@sizebot
Copy link

sizebot commented Nov 5, 2018

ReactDOM: size: 🔺+0.1%, gzip: 0.0%

Details of bundled changes.

Comparing: ce90ffd...461eb5a

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js 0.0% +0.1% 704.66 KB 704.94 KB 163.29 KB 163.39 KB UMD_DEV
react-dom.production.min.js 🔺+0.1% 0.0% 102.61 KB 102.68 KB 33.57 KB 33.58 KB UMD_PROD
react-dom.development.js 0.0% +0.1% 699.97 KB 700.25 KB 161.92 KB 162.01 KB NODE_DEV
react-dom.production.min.js 🔺+0.1% 0.0% 102.7 KB 102.77 KB 33.11 KB 33.12 KB NODE_PROD
ReactDOM-dev.js 0.0% +0.1% 718.45 KB 718.73 KB 162.77 KB 162.87 KB FB_WWW_DEV
ReactDOM-prod.js 0.0% 0.0% 310.69 KB 310.78 KB 57.39 KB 57.4 KB FB_WWW_PROD
react-dom.profiling.min.js +0.1% 0.0% 105.06 KB 105.13 KB 33.41 KB 33.43 KB NODE_PROFILING
ReactDOM-profiling.js 0.0% 0.0% 314.97 KB 315.06 KB 58.28 KB 58.29 KB FB_WWW_PROFILING
react-dom.profiling.min.js +0.1% +0.1% 104.93 KB 105 KB 33.9 KB 33.93 KB UMD_PROFILING

scheduler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
scheduler.development.js n/a n/a 0 B 19.17 KB 0 B 5.74 KB UMD_DEV
scheduler.production.min.js n/a n/a 0 B 3.16 KB 0 B 1.53 KB UMD_PROD

Generated by 🚫 dangerJS

@gaearon gaearon merged commit b305c4e into facebook:master Nov 5, 2018
@gaearon
Copy link
Collaborator

gaearon commented Nov 5, 2018

Thanks

@tnunes
Copy link
Contributor Author

tnunes commented Nov 6, 2018

Thank you @gaearon. Any ETA on when 16.6.1 (and the next 16.7 alpha) will be released?

@gaearon
Copy link
Collaborator

gaearon commented Nov 6, 2018

Soon-ish

jetoneza pushed a commit to jetoneza/react that referenced this pull request Jan 23, 2019
Check for existence of `setTimeout` and `clearTimeout` in the runtime
before using them, to ensure runtimes without them (like .NET ClearScript)
do not crash just by importing `react-dom`.
n8schloss pushed a commit to n8schloss/react that referenced this pull request Jan 31, 2019
Check for existence of `setTimeout` and `clearTimeout` in the runtime
before using them, to ensure runtimes without them (like .NET ClearScript)
do not crash just by importing `react-dom`.
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.

None yet

4 participants