This Week In React #162: Lit-React, Remix, Next.js, Fresh, next-safe-actions, Starlight, RN 0.73 RC, RCTText, canvaskit-js, vxrn, Rolldown, Vite, Japa

Search for a command to run...

No comments yet. Be the first to comment.
Hi everyone! Krzysztof and Tomasz from Software Mansion here ๐ It's been a fairly calm week for the React ecosystem, but not for the React Native world. Meta has made an exciting announcement about the release of React Native 0.80, where they've dec...

Hi everyone! This week is relatively calm in the React ecosystem, but we still have various interesting blog posts and releases. Maybe we'll soon get some exciting news from React Summit that's about on Friday! On the React Native side, all the devs ...

Hi everyone! I thought I was on schedule for today's issue, until I realized that Dan Abramov wrote 4 RSC blog posts this week ๐. We also get great releases, including Storybook, LiveStore, Base UI, and the Lingo Compiler is a quite exciting innovat...

Hi everyone! Cyril and Matthieu from Theodo Apps here ๐. This week, the Remix team announced some big news. Microsoft has also made it easier to try out TypeScript Go rewriting. In the React Native world, there were a few minor but interesting relea...

Hi everyone! This week, we're delighted to finally have a preview of React Server Components support in React Router. I've also found some very interesting PRs on the React repo, and give you a glimpse of what could be coming soon! The React Native e...

Hi everyone!
This week, I've been looking at the release of Lit 3.0 to see if the use of Web Components has become easier with React.
On the React-Native side, version 0.73 is in release candidate with a number of DX improvements. There's also interesting activity regarding the possible optimisation of the Text and View components. Canvaskit-js makes it possible to run Skia on the web for just 20kb!
There were some interesting announcements at ViteConf last week. Notably a Rust port of Rollup, and the usage of Vite with Remix and React-Native.
๐ก Subscribe to the official newsletter to receive an email every week!
highlight.io - The open-source, full-stack monitoring Platform
highlight.io is a truly open-source application monitoring solution. They support Session Replay, Error Monitoring, and Logging platform; a perfect solution for your next project.
Don't waste time trying to guess why a bug happens. Use highlight and get a clear picture of your browser and server-side application.
It is super easy to install in your favorite framework: React.js, Next.js, Remix, or anything else!
Google's Web Components framework Lit has just been released in v3.0. In addition to improvements to the framework (decorators, template compiler, Preact Signals), there is in particular the @lit/react integration package, which has graduated from the Lab, is now stable and in v1.0.
This integration facilitates the use of Web Components in a React app (or Preact) by creating a wrapper that maps React props to the properties of the custom element, manages event handlers and facilitates TypeScript typing. It fills certain gaps in React 18, which does not integrate easily with Web Components: props are mapped to attributes rather than properties. See the documentation for the React framework.
But can a modern React dev use all this easily? Lit offers experimental packages @lit-labs/ssr, @lit-labs/ssr-react and @lit-labs/nextjs but support is limited and won't work with Next.js App Router. The Declarative Shadow DOM, which allows SSR, is not yet implemented in Firefox, but a polyfill exists. In short, Lit should work well on a CRA app, but still feels a bit risky if you need SSR and SEO.
๐ Next.js PR - Document Server Actions .bind method: the Next.js doc now recommends using myAction.bind(null, myArg) to pass additional arguments to a Server Action. The returned function will then also be a Server Action.
๐ UI Composition - AKA taking a step back to take a step forward: article presenting an example of a Card component that has too much responsibility. Suggests splitting it and using composition to make it more maintainable.
๐ Server-side pagination with Remix: I found this implementation very interesting, with no onClick listener or JS to manipulate the query string. It relies solely on the native behaviour of forms and is therefore compatible with progressive enhancement. My reservation: impossible to open a page in a new tab ๐
.
๐ Access the Loader Data in Remix: presents different ways of using useLoaderData or useRouteLoaderData and their tradeoffs, depending on where they are used.
๐ Making React Apps Memory Efficient - Million.js Beyond Speed
๐ฆ Fresh v1.5 - Partials, client side navigation and more: the Preact framework implements client-side navigation based on "Partials", which permits to preserve some state during navigation. View Transitions support is on the way.
๐ฆ next-safe-action v4 - Typesafe Server Actions in your Next.js 13 app: input validation with Zod. Note: a similar project Zact is deprecated in favour of next-safe-action.
๐ฆ Astro Starlight v0.11: adds support for component overrides to customize docs.
๐ฆ React-Query 5.0.0 RC.10: the latest RCs bring significant improvements to ๐ฆ devtools and ๐ฆ TypeScript.
๐ ServerComponents.dev: a fun interactive resource to find out more about Server Components.
๐ React Jam - October 19-29th - React devs create and play games in 10 days
๐ฅ React Advanced (London ๐ฌ๐ง, Octobre 20-23) is offering us -10% - code "REACT10"
Drop-in Authentication & User Management for React
Clerk is the easiest way to add authentication and user management to your React app. Itโs purpose-built for the modern web and designed to get you up and running in minutes.
With Clerk you get:
๐ Pre-built UI components for sign-in, sign-up, user profiles, and organizations
๐ฆ SDKs for React, React Native, Next.js, Redwood, Remix, and other frameworks
โก Integrations with Firebase, Supabase, Convex, and other BaaS providers
๐ User management, social login, magic links, MFA, and more out of the box
Get started with Clerkโs quickstarts and tutorials ๐
Using RCTView & RCTText in React Native for Performance Gains
At the moment, React-Native devs are talking a lot on Twitter about the perf of the Text and View components, which are JS wrappers and add overhead compared to the respective native RCTText and RCTView elements. William Candillon had already ๐ฅ explained this problem in 2021, with the possibility of optimising Text rendering. It is possible to optimize as long as you don't need a few features like onPress listeners. This article presents a benchmark and measures the impact of using the native components instead of regular components, and reports a gain of around 15%, with variations depending on the platform and architecture.
Now that this trick became mainstream, React-Native devs are keen to take advantage of it. We can note the creation of react-native-fast-text, or the POC of a Babel plugin react-native-optimizer which would apply this optimisation automatically.
๐ธ Blitz - Build React Native Apps Faster for iOS, Android, and Web!
๐ฆ Expo docs updates - Bun, local dev, iOS capabilities...
๐ How to measure React Native performance with Flashlight: shows an example of using Flashlight to compare the scrolling performance of FlatList and Flashlist on Android. You can use ADB or Maestro commands to simulate scrolling.
๐ Remote controls for React TV apps: a declarative approach with react-tv-space-navigation 1.0!: details leading to the creation of react-tv-space-navigation, a cross-platform, agnostic spatial navigation solution that works on React TV apps, both web-based and native.
๐ฆ React-Native v0.73 RC.2: v0.73 has just been released in RC. You'll have to check out the ๐ฅ Keynote at React-Native-EU to see all the highlights. These include one-click debug flow and stable symlinks support!
๐ฆ vxrn - The magic of Vite, meet React Native: nouveau projet expรฉrimental qui propose d'utiliser Vite pour le dรฉveloppement cross-platform web/mobile, ร l'instar d'Expo qui mise sur Metro.
๐ฅ Back to the Web: William Candillon unveils an experimental polyfill for Skia canvaskit-js that lets you run React-Native-Skia on the web in just 20kb, instead of 3mb! Flutter demos already run pretty well with it. You can use it in a Create-React-App without depending on React-Native-Web.
๐ The React Native Show Podcast 28 - Improving Developer Experience with Expo
๐ฆ Evan You - "we are working on Rolldown, a rust port of Rollup"
๐ Speeding up the JavaScript ecosystem - The barrel file debacle
๐ Limit the reach of your selectors with the CSS @scope at-rule
๐ Write your own Zod
๐ This technique makes Valibotโs bundle size 10x smaller than Zodโs!
๐ฅ ViteConf 2023 Replay
See ya! ๐