Twitter | Search | |
Andrew Clark
How to Code Split with React Suspense Coming soon to open source. We're already shipping a version of this to Facebook employees. The code is sooo much nicer than before.
Reply Retweet Like More
Andrew Clark 13 Jun 18
Replying to @acdlite
Fun fact: the same API works in sync mode, too. The difference is that we have to fallback to the spinner immediately, as if `delayMs={0}`. But you still get the nicer programming model.
Reply Retweet Like
Andrew Clark 13 Jun 18
Replying to @acdlite
Another fun fact: zero component state is required to make this work. No lifecycle methods either. None. Nada. Not even as an implementation detail.
Reply Retweet Like
Andrew Clark 14 Jun 18
Replying to @acdlite
The key idea here is to block the transition until the whole tree is complete. That way everything updates at once, without lots of flickering and relayouts. This is incredibly hard to do right with existing tools. For an example of what *not* to do, see:
Reply Retweet Like
Federico Zivolo 14 Jun 18
Replying to @acdlite
How is it different from react-loadable? I mean, apart the API.
Reply Retweet Like
Federico Zivolo 14 Jun 18
Replying to @acdlite
(even react-loadable allows to show a spinner only if it takes more than X ms to load)
Reply Retweet Like
Andrew Clark 13 Jun 18
Reply Retweet Like
Kevin Jones​ 👨🏼‍💻 @ GroupValley 17 Aug 18
Replying to @acdlite
In the case of a connection failure, does the spinner just show up forever? Or is that dependent on the packager's (e.g. webpack's) behavior?
Reply Retweet Like
Andrew Clark 17 Aug 18
Replying to @EmpireJones
Yeah. Not much we can do to control that without tighter control over the module runtime. But Webpack et al could implement their own version. It's not hard to do in user space. This is the whole thing:
Reply Retweet Like
Mateusz Zatorski 13 Jun 18
Replying to @acdlite
This is awesome! Off topic Andrew, how do you communicate with the rest of the people at FB the new features that you'd like to be tested. How do you encourage them etc?
Reply Retweet Like
Andrew Clark 13 Jun 18
Replying to @matzatorski
We use Workplace. It’s exactly like Facebook, but for work. I publish a post in the appropriate group.
Reply Retweet Like