React Labs - What We've Been Working On - June 2022 - React Blog
React Labs - What We've Been Working On - June 2022 - React Blog
Working On – June
React Conf 2021 Recap
The Plan for React 18
2022
Introducing Zero-Bundle-Size
React Server Components
React v17.0
June 15, 2022 by Andrew Clark, Dan Abramov, Jan Kassens, Joseph Savona, Josh Introducing the New JSX Transform
Story, Lauren Tan, Luna Ruan, Mengdi Chen, Rick Hanlon, Robert Zhang, Sathya React v17.0 Release Candidate: No
New Features
Gunasekaran, Sebastian Markbåge, and Xuan Huang
React v16.13.0
All posts ...
depending on what we learn. Instead, we want to share with you the React v17.0
problem spaces we’re actively thinking about, and what we’ve learned so Introducing the New JSX Transform
Server Components
In particular, we’re abandoning the idea of having forked I/O libraries (eg
react-fetch), and instead adopting an async/await model for better
compatibility. This doesn’t technically block RSC’s release because you can
also use routers for data fetching. Another change is that we’re also
moving away from the file extension approach in favor of annotating
boundaries.
React Labs: What We've Been
Working On – June 2022
We’re working together with Vercel and Shopify to unify bundler support React v18.0
for shared semantics in both Webpack and Vite. Before launch, we want to How to Upgrade to React 18
make sure that the semantics of RSCs are the same across the whole React React Conf 2021 Recap
ecosystem. This is the major blocker for reaching stable. The Plan for React 18
Introducing Zero-Bundle-Size
React Server Components
React v17.0
Today, if you want to hide and show a component, you have two options. React v17.0 Release Candidate: No
New Features
One is to add or remove it from the tree completely. The problem with this
React v16.13.0
approach is that the state of your UI is lost each time you unmount,
All posts ...
including state stored in the DOM, like scroll position.
The other option is to keep the component mounted and toggle the
appearance visually using CSS. This preserves the state of your UI, but it
comes at a performance cost, because React must keep rendering the
hidden component and all of its children whenever it receives new
updates.
Offscreen introduces a third option: hide the UI visually, but deprioritize its
content. The idea is similar in spirit to the content-visibility CSS
property: when content is hidden, it doesn’t need to stay in sync with the
rest of the UI. React can defer the rendering work until the rest of the app
is idle, or until the content becomes visible again.
React Labs: What We've Been
Working On – June 2022
Offscreen is a low level capability that unlocks high level features. Similar React v18.0
to React’s other concurrent features like startTransition , in most cases How to Upgrade to React 18
you won’t interact with the Offscreen API directly, but instead via an React Conf 2021 Recap
opinionated framework to implement patterns like: The Plan for React 18
Introducing Zero-Bundle-Size
Instant transitions. Some routing frameworks already prefetch data to React Server Components
speed up subsequent navigations, like when hovering over a link. With
React v17.0
Offscreen, they’ll also be able to prerender the next screen in the
Introducing the New JSX Transform
background.
React v17.0 Release Candidate: No
Reusable state. Similarly, when navigating between routes or tabs, you can New Features
use Offscreen to preserve the state of the previous screen so you can switch React v16.13.0
back and pick up where you left off.
All posts ...
Virtualized list rendering. When displaying large lists of items, virtualized
list frameworks will prerender more rows than are currently visible. You can
use Offscreen to prerender the hidden rows at a lower priority than the
visible items in the list.
Backgrounded content. We’re also exploring a related feature for
deprioritizing content in the background without hiding it, like when
displaying a modal overlay.
Transition Tracing
Currently, React has two profiling tools. The original Profiler shows an React Labs: What We've Been
Working On – June 2022
overview of all the commits in a profiling session. For each commit, it also
React v18.0
shows all components that rendered and the amount of time it took for
How to Upgrade to React 18
them to render. We also have a beta version of a Timeline Profiler
React Conf 2021 Recap
introduced in React 18 that shows when components schedule updates
The Plan for React 18
and when React works on these updates. Both of these profilers help
Introducing Zero-Bundle-Size
developers identify performance problems in their code. React Server Components
React v17.0
We’ve realized that developers don’t find knowing about individual slow Introducing the New JSX Transform
commits or components out of context that useful. It’s more useful to React v17.0 Release Candidate: No
know about what actually causes the slow commits. And that developers New Features
want to be able to track specific interactions (eg a button click, an initial React v16.13.0
load, or a page navigation) to watch for performance regressions and to All posts ...
understand why an interaction was slow and how to fix it.
challenges. We took a break from that work to focus on the React 18 React v17.0
release, but now that React 18 is out, we’re actively working to finish and Introducing the New JSX Transform