This Week In React #190: Suspense, Internals Explorer, DevTools, RSC + Vite, Codemod, Astro, INP, composition, Reassure...
Sebastien Lorber
Posted on June 28, 2024
Hi everyone!
This week it looks like we are finally entering the summer/holiday season and the pace of major React announcements is slowing down. We will also be taking a short summer break, skip 2 issues, and be back on July 17.
On the React side, we continue to have interesting content related to the Suspense drama from last week. A new React Router feature permits you to code split your route tree.
On the React Native side, it looks like the team is trying to release v0.75 as RC, and encountering some roadblocks, but itโll probably be out soon.
The most exciting news to me is the TypeScript 5.5 stable release: itโs a great one, notably for predicate type inference! The State of JS survey results are also out if you want to explore JS trends.
๐ก Subscribe to the official newsletter to receive an email every week!
๐ธ Sponsor
The Category-Defining React Grid for Your Enterprise
Data grids are complex components of web applications, but current solutions are inefficient, require a lot of maintenance, and perform poorly. Graphite Grid transforms the landscape with two key features: retargetable rendering and reactive signal state.
Graphite Grid separates grid state from view logic, allowing a single unified state model to support a variety of render targets, declaratively or imperatively. It includes a DOM and Canvas renderer, giving developers flexible, high-performance options ๐.
Graphite Grid is declarative and consistent, leveraging state signals to ensure seamless integration with your application. Designed with React in mind, it is the only JavaScript data grid built with React's state management primitives. Try it now!
โ๏ธ React
๐ฆ React-Router 6.24 - Lazy Route Discovery
This React Router release includes a new unstable_patchRoutesOnMiss
hook that will be called when React Router canโt match any existing route. It permits you to load additional routes and implement code splitting for your routes instead of keeping them all in a single monolithic module. A welcome feature for large apps with thousands of routes, that now donโt need to load all of them upfront, delaying hydration.
Remix was supposed to take a nap, but apparently not yet! ๐ฆ Remix 2.10 is out and already leverages that new React Router feature by exposing it through a convenient โFog of Warโ feature that you can enable with a simple future.unstable_fogOfWar
flag. An early discovery optimization has also been implemented to avoid waterfalls.
- ๐ธ Meilisearch โ Build fast, typo-tolerant search with React
- ๐ React.dev PR - Add branding context menu: Right-click the website navbar logo to access the official svgs and brand colors of React.
- ๐ Next.js PR draft -
nextConfig.requiredEnv
- ๐ Next.js PR draft - type check for
env
- ๐ฆ Joe Savona - "Some thoughts on the suspense changes from 19 RC": To avoid situations such as past weekโs Suspense drama, the React team is working on changes to get feedback earlier (working groups, RFC, canaryโฆ).
- ๐ฆ Lee Robinsin - "Here's where we're headed with caching in Next.js": โOur goal is to make all async operations (like doing a
fetch
) opt into dynamic renderingโ, โWe believe Partial Prerendering will become the defaultโ. - ๐๏ธ React Rally - ๐บ๐ธUtah - 12-13, August - Get a 10% discount with code "TWIR". Thereโs a React Server Components workshop with Kent C. Dodds
- ๐จ ECMAScript News - Discover our partners' newsletter to keep up to date with ES, TC39, JS tooling, and runtimes
- ๐ Component, colocation, composition: A note on the state of React: The recent Suspense drama highlights the gap between Reactโs component-oriented vision and its current limitations.
- ๐ From markdown to video - Animated code walkthroughs with Code Hike and Remotion: If you have seen recent code animation videos of Matt Pocock or Delba, hereโs a great article and demos to understand how it works.
- ๐ Understanding React Compiler: Explains how the React compiler work, starting from the basics (transpiler, AST, memoization), then analyzing the compiler output of a concrete example.
- ๐ Wait for pending: A (not great) alternative Suspense algorithm: Explores the possibility of a different algorithm for Suspense, with different tradeoffs.
- ๐ How to make draggable Framer Motion elements snap to breakpoints: Interactive article implementation snap points on top of Framer Motion, including inertia/velocity support.
- ๐ Mobx Memoizes Components (You don't need React Compiler): Takes an existing demo using the React compiler and turns it into an optimized Mobx app with minimal changes. MobX prevents re-renders by auto-tracking dependencies. Note this Mobx issue explains why Mobx (based on proxies) is not compatible with the compiler, and lib creator also confirms itโs already optimized.
- ๐ Web Workers, Comlink, Vite and TanStack Query: React Query being an โasync state managerโ, it also works well to offload expensive work from the main thread.
- ๐ Storybook - Visual testing: The greatest trick in UI development: I agree that too many devs miss out on visual regression testing. It has a really great ROI, considering how easy it is to add to an existing Storybook. As this article shows, covering the same component with React Testing Library requires more work.
- ๐ Communication Between Client Components in Next.js: With RSCs, new challenges emerged to make 2 client components communicate, and you might not be able to lift the state up unless the parent is also a client component. This article proposes 3 solutions: using a Provider, search params, and server state.
- ๐ How to Validate Form in Remix with clientAction: Using the new Remix
clientAction
export can nicely complete the serveraction
validation and progressively enhance your form with local errors. - ๐ Type-safe TanStack Query with OpenAPI: Shows how to create generic React Query hooks (
useGetQuery
,usePostMutation
...) that are fully typed according to an OpenAPI specification. - ๐ How To Use Google Sheets as a Database With React via Next.js
- ๐ Is it ok to pass setState as a prop in React?
- ๐ฆ StyleX 0.7 - CLI (experimental), Literal names for CSS variables: New CLI transforms an entire folder and can be an alternative to the bundler integration.
- ๐ฆ Next-Safe-Action 7.0 - Type safe and validated Server Actions: See also the v6 to v7 migration guide.
- ๐ฆ Astro 4.11 - 500 page improvements,
<Code>
component Shiki transformer - ๐ฆ React-Admin 5.0 - Improves on UI, DX, app init, Data Providers, formsโฆ
- ๐ฆ Shopify Hydrogen Update - Visual Editor, Optimistic Cart, Vite stable, RichText component, SEO meta exportโฆ
- ๐ฆ stan-js - Minimalistic state management library
- ๐ฅ Jack Herrington - React 19's useOptimistic: everything you need to know
- ๐ฅ Theo - I Used To Hate Next.jsโฆ
- ๐ฅ Dave Gray - Nextjs Server Actions Just Got Better (using next-safe-action)
- ๐ฅ Ryan Carniato - Facing Frontend's Existential Crisis, React Summit 2024
- ๐๏ธ Syntax - Whatโs Next for NextJS with Tim Neutkens
๐ธ Sponsor
WorkOS: Modern Identity Platform for B2B SaaS
With WorkOS you can start selling to enterprises with just a few lines of code.
๐ WorkOS supports a complete User Management solution along with SSO, SCIM, RBAC, & FGA.
๐๏ธ The APIs are flexible, easy-to-use, and modular. Pick and choose what you need and integrate in minutes.
๐จ Design and user experience are everything. From the quality of our documentation to how your users onboard, we remove all the unnecessary complexity for developers.
โจ User Management is free up to 1 million MAUs and includes bot protection, impersonation, MFA, & more.
๐ค WorkOS is trusted by hundreds of leading startups like Perplexity, Vercel, & Webflow.
Future-proof your auth stack with WorkOS ๐
๐ฑ React-Native
This section is authored by Benedikt.
- ๐ธ WithFrame - Ready to Use React Native Components
- ๐ฆ Marc Rousavy on how to get relevant log or crash information in RN for creating issues in open source libs
- ๐๏ธ The Geek Conf - ๐ฉ๐ช Berlin - 18 & 25 July - Get a 10% discount with code "TWIR". Mo Khazali โ Head of Mobile at Theodo UK, Matteo Collina โ CTO of Platformatic.dev, and Siddharth Kshetrapal โStaff software engineer at GitHub, will speak !
- ๐ Chain React Conf - ๐บ๐ธ Portland, OR - July 17-19. The U.S. React Native Conference is back with engaging talks and hands-on workshops! Get 15% off your ticket with code โTWIRโ
- ๐ Revert "Make the New Architecture the default": it looks like turning the New Arch on by default might be postponed and will finally not be part of v0.75?
- ๐ Shopify FlashList PR - New architecture support merged (but not released yet)
- ๐ Fishjam Cloud - New project by Software Mansion to bring video streaming to React Native
- ๐ expo-router-native-intent-demo - Using +native-intent API in Expo Router to support "Copy to app" functionality on iOS
- ๐ Client guide to React Native modules: Oscar greatly explains the differences, pros, and cons of the different ways to expose native modules to React Native, and helps us choose the best solution depending on context.
- ๐ Bridging React Native and Rust via JSI: An article by Ditto, a data sync engine written in Rust, on how they bridged their core logic (in Rust) to RN via JSI.
- ๐ On-device AI/ML in React Native: This is fascinating stuff, which wouldโve been inconceivable only a short while ago. Building real-time camera filters with on-device AI in RN.
- ๐ From web to native with React Native and Expo: Describes the journey of a web dev who built their first mobile app using RN/Expo.
- ๐ Just as Google, BAM believes in Kotlin Multiplatform: The mostly RN-focused company BAM finds CMP/KMP a compelling choice among the available cross-platform solutions and explains the advantages/limitations.
- ๐ Expo - FCM v1 Migration Deadline Changed to July 20th
- ๐ฅ Simon Grimm - TV Apps with React Native
- ๐ฅ JavaScript Mastery - Free 4,5h React Native Course for Beginners in 2024
๐ Other
- ๐ State of JavaScript 2023 - Survey Results
- ๐ How JavaScript Is Finally Improving the Module Experience
- ๐ Inline conditionals in CSS, now?
- ๐ GitHub Copilot Extensions are all you need
- ๐ MDN - New JavaScript Set methods
- ๐ฆ TypeScript 5.5 - Inferred type predicates, narrowing for indexed access, JSDoc @import
- ๐ฆ farm - Extremely fast Vite-compatible web build tool written in Rust
- ๐ฆ Node 20.15 - Test plans, โinspect-await
- ๐ฆ node-swift - Create Node modules in Swift
- ๐ฅ Matt Pocock TypeScript 5.5 is a banger
๐คญ Fun
See ya! ๐
Posted on June 28, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 28, 2024
November 18, 2024