react-conf-2018

React Conf 2018 Source Code for "Moving to Suspense" Demo

Github星跟踪图

Moving to React Suspense

By Jared Palmer at React Conf 2018.


This is the source code to the application I demo'd at React Conf 2018. It is a small slice of Spotify called Suspensify. It's built with create react app, reach router, and good ol' setState.

It's separated into 3 folders:

  • before-suspense is the initial state of the application.
  • conf-talk-progress is where we end up--the final state of my talk--so you can follow along.
  • after-suspsense is a version where every single thing that can be moved to suspense, has been moved to suspense. I did not get this far in my talk, but it's there for completeness / reference.

Running locally

cd conf-talk-progress
yarn start

Note the Ken Wheeler and Wale routes do not work. I didn't bother making fake data for them. Sorry. Only the Drake and Big Sean routes work (first 2 results).

In the patches directory, there is a patched version of CRA's config/webpackDevServer.config.js that adds a little express middleware that will delay the high-res images from loading for demo purposes. It sniffs any requests including with -hd.jpeg and waits for the value of delay query parameter. The <Debugger /> request latency slider is used to set this query parameter's value for all images.

What's it look like?

kapture 2018-10-29 at 15 50 42

主要指标

概览
名称与所有者jaredpalmer/react-conf-2018
主编程语言JavaScript
编程语言JavaScript (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2018-10-24 23:13:56
推送于2019-03-01 03:27:44
最后一次提交2019-02-28 22:27:25
发布数0
用户参与
星数227
关注者数4
派生数29
提交数89
已启用问题?
问题数1
打开的问题数0
拉请求数3
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?