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.4.1. #13088

Merged
merged 5 commits into from
Jun 22, 2018

Commits on Jun 21, 2018

  1. Fix crash during server render.

    setTimeout and clearTimeout may not be available in some server-render environments (such as ChakraCore in React.NET), and loading ReactScheduler.js will cause a crash unless the existence of the variables are checked via a typeof comparison.
    
    reactjs/React.NET#555
    
    The crash did not occur in 16.4.0, and the change appears to have been introduced here: https://github.com/facebook/react/pull/12931/files#diff-bbebc3357e1fb99ab13ad796e04b69a6L47
    
    I tested this by using yarn link and running it with a local copy of React.NET. I am unsure the best way to unit test this change, since assigning null to `setTimeout` causes an immediate crash within the Node REPL.
    Dustin Masters committed Jun 21, 2018
    Configuration menu
    Copy the full SHA
    a2cd55a View commit details
    Browse the repository at this point in the history
  2. Fix flow errors and log warning if setTimeout / clearTimeout are

    not defined / not a function.
    Dustin Masters committed Jun 21, 2018
    Configuration menu
    Copy the full SHA
    d29667a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    98afa72 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2018

  1. Remove use of invariant

    Dustin Masters committed Jun 22, 2018
    Configuration menu
    Copy the full SHA
    ffd89fd View commit details
    Browse the repository at this point in the history
  2. Explain

    gaearon committed Jun 22, 2018
    Configuration menu
    Copy the full SHA
    96881ff View commit details
    Browse the repository at this point in the history