This Week In React #95: onRecoverableError, Next.js, Remix, ReactNode, Fabric, Flipper, Expo, React-Runner, State Of JS...

This Week In React #95: onRecoverableError, Next.js, Remix, ReactNode, Fabric, Flipper, Expo, React-Runner, State Of JS...

Hi everyone!

I found this week particularly interesting! Impossible to read and comment on everything.

We really feel that things are moving on the React 18 side, with a new RC1 coming soon, and support in Next.js progressing. Nice releases for both Next.js and Remix.

On the React-Native side, we also see Fabric pointing the tip of its nose in the next release 0.68. It will take some additional work for the ecosystem to be ready, but we already have some great demos. Flipper could become a more universal tool?

🙏 Support the newsletter:

React

React 18: onRecoverableError

A React 18 RC1 should be released this week, announced by Andrew Clark: "Small update on React 18: we're planning another RC for next week that includes improvements to error reporting"

It ships with a new API onRecoverableError. The idea is to be able to log/report (via reportError) the "recoverable errors" that might happen in React, notably during the hydration process when there are some mismatches between SSR and CSR.

Next.js 12.1

Nice release including one of the most highly anticipated feature: on-demand Incremental Static Regeneration (ISR). A new API unstable_revalidate("/static-page-url") should significantly help for CMS integration: as you can now get an immediate update on CMS publish.

On SWC side: 6 new Babel plugins ported to Rust (including Styled-Components and Relay), SWC minify in release-candidate and a better zero-config integration with Jest

There's also some notable progress on React 18 and Server Components support, but it's still in alpha.

See also the introduction video from Lee or the on-demand ISR demo from Delba.

Remix 1.2

An interesting release on the deployment part: new serverBuildTarget option to configure the build (directory, module format), possibility to build the server in a single output file, and a new experimental adapter to deploy on Deno.

The React.ReactNode type is a black hole

Widely known problem for a long time, the TypeScript type for ReactNode is too loose and does not permit to catch some errors at compile time. Kevin suggests to create a StrictReactNode type and provides an ESLint rule to forbid the usage of ReactNode. Similar article.

Extras:

React-Native

Introducing Fabric to react-native-screens

With React-Native 0.68, we can easily activate the new Fabric renderer! But it will only work if all your libs are compatible.

Software Mansion announces its commitment to making its libs compatible with Fabric (starting with React-Native-Screens).

They encourage us to do the same and give us some leads (process and PRs). The idea: create libs that work as well with both the new and the old architecture at the same time, to allow an incremental migration, but without duplicating too much code.

This is very exciting, and the community provides some feedback:

Note that React-Navigation already works under Fabric with react-native-screens!

Flipper is coming to your web and Node.js apps

Flipper is initially a desktop DevTool for React-Native, permitting you to inspect logs, network requests... Andrey introduces js-flipper: a package that permits to integrate Flipper with web or Node.js apps (React example). He shares various use-cases at Meta: mobile, web, Node.js, Desktop, Oculus Quest... there are also app-specific business use-cases such as a plugin providing a "log as user X" feature.

Flipper seems to be an ideal platform to build a universal DevTool, provided the ecosystem follows, so Andrey invites us all to create plugins.

Extras:

Other

State Of JS 2021

Unsurprisingly, React remains very popular this year, but it is surpassed by Svelte and Solid in terms of satisfaction. Next.js and Remix both at 91% satisfaction. Read in particular Swyx's conclusion. A livestream is taking place today.

Remember this survey is not without bias, but it remains interesting to explore trends. Sacha Grief is of goodwill to improve and addresses the criticisms on Dev.

Extras:

Did you find this article valuable?

Support Sébastien Lorber by becoming a sponsor. Any amount is appreciated!