Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/facebook/react.git. Pull mirroring updated .
  1. Jan 04, 2021
  2. Dec 23, 2020
  3. Dec 21, 2020
  4. Dec 19, 2020
  5. Dec 18, 2020
  6. Dec 17, 2020
    • Luna Ruan's avatar
      clone json obj in react native flight client host config parser (#20474) · 9f338e5d
      Luna Ruan authored
      As per Seb's comment in #20465, we need to do the same thing in React Native as we do in Relay.
      
      When `parseModel` suspends because of missing dependencies, it will exit and retry to parse later. However, in the relay implementation, the model is an object that we modify in place when we parse it, so when we we retry, part of the model might be parsed already into React elements, which will error because the parsing code expect a Flight model. This diff clones instead of mutating the original model, which fixes this error.
      9f338e5d
  7. Dec 16, 2020
    • Luna Ruan's avatar
      clone json obj in relay flight client host config parser (#20465) · 4e62fd27
      Luna Ruan authored
      When `parseModel` suspends because of missing dependencies, it will exit and retry to parse later. However, in the relay implementation, the model is an object that we modify in place when we parse it, so when we we retry, part of the model might be parsed already into React elements, which will error because the parsing code expect a Flight model. This diff clones instead of mutating the original model, which fixes this error.
      4e62fd27
  8. Dec 15, 2020
  9. Dec 14, 2020
  10. Dec 12, 2020
    • Dan Abramov's avatar
    • Andrew Clark's avatar
      Regression test: SuspenseList causes lost unmount (#20433) · 3f9205c3
      Andrew Clark authored
      @sebmarkbage reminded me that the complete phase of SuspenseList
      will sometimes enter the begin phase of the children without calling
      `createWorkInProgress` again, instead calling `resetWorkInProgress`.
      
      This was raised in the context of considering whether #20398 might
      have accidentally caused a SuspenseList bug. (I did look at this code
      at the time, but considering how complicated SuspenseList is it's not
      hard to imagine that I made a mistake.)
      
      Anyway, I think that PR is fine; however, reviewing it again did lead me
      to find a different bug. This new bug is actually a variant of the bug
      fixed by #20398.
      
      `resetWorkInProgress` clears a fiber's static flags. That's wrong, since
      static flags -- like PassiveStatic -- are meant to last the lifetime of
      the component.
      
      In more practical terms, what happens is that if a direct child of
      SuspenseList contains a `useEffect`, then SuspenseList will cause the
      child to "forget" that it contains passive effects. When the child
      is deleted, its unmount effects are not fired :O
      
      This is the second of this type of bug I've found, which indicates to me
      that it's too easy to accidentally clear static flags.
      
      Maybe we should only update the `flags` field using helper functions,
      like we do with `lanes`.
      
      Or perhaps we add an internal warning somewhere that detects when a
      fiber has different static flags than its alternate.
      3f9205c3
  11. Dec 10, 2020
  12. Dec 09, 2020
  13. Dec 08, 2020