π¨ #176: useActionState, React Compiler, Million Lint, TanStack, Generative UI, Vinxi, Remix i18n, Next.js security, Typesafe Router, Shopify RN perf, RCTRootViewFactory, iOS Live Activities, Uni Stack, TypeScript, Parcel...
Hi everyone!
This week is difficult to sum up, there's a lot of interesting news and I don't know which to highlight.
We notably have a sneak peek of a new React core hook replacing the confusing useFormState
, that even React Native devs will now be able to use now!
π‘ Check this newsletter on Twitter - visual format π¨
To support me:
- π Recommend the newsletter to your friends: it really helps!
- πΈ Sponsor the newsletter
- 𧡠Retweet the latest Twitter thread
Don't miss the next email!
πΈ Sponsorβ
Axiom - the best logging platform for Vercel apps
π΄ Sleep peacefully knowing that Axiomβs zero-config observability for Vercel projects has you covered.
- Use Axiom's pre-built dashboard for an overview across all your Vercel logs and vitals, drill down to specific projects and deployments, and get insight on how functions are performing with a single click.
- next-axiom allows you to send logs and events from any part of your Next.js projects - client, edge, or server-side - without any special configuration.
- Easily send structured logs directly from your code and analyze them together with Vercel logs.
Axiom efficiently captures 100% of your event data so youβll never have to worry about sampling or retention, and youβll never have to guess what your users are experiencing.
PS:Β I use it myself to monitor the newsletter signupsΒ π
βοΈ Reactβ
React Core PR - New useActionState hook
It turns out the useFormState hook was confusing, and not even meant to be solely used in forms. The React team is addressing this by introducing a new React core hook to replace it:
- Renames
useFormState
touseActionState
- Adds a pending state to the returned tuple
- Moves the hook to the
react
package
Moving it from react-dom
to react
also means that now, other renderers such as React Native can use it too. There are other benefits to look at, such as a βpartial progressive enhancementβ feature, but also new caveats documented in the PR.
- πΈ Secure your documents with PDF Redaction. Discover how to protect sensitive information in PDFs using React. Visit our blog to learn more.
- π¦ React 19 != React Compiler: The React Labs post is a bit ambiguous and misled many of us, so letβs clarify. The compiler will likely come after the React 19.0 release as a separate project, and thereβs a good chance it will initially be released as a Babel/TypeScript plugin. The internals are decoupled through, so it shouldnβt take long to adapt it it to Rust.
- π¦ TanStack Start preview: Tanner works on a TanStack Start full-stack framework based on Vinxi and TanStack Router. This preview shows heβs migrating his own TanStack site to it.
- π Vercel - Introducing AI SDK 3.0 with Generative UI support: With the AI SDK 3.0 and thanks to React Server Components, you can now stream UI components directly from LLMs. Super impressive demos!
- π Secure statically rendered paid content in Next.js (with the App Router): Shows that using Next.js layouts for authentication is not super secure, and the protected content can still leak through the RSC endpoint. Suggests using a middleware instead.
- π Internationalization with Remix: Goes back to i18n fundamentals, and then detail various i18n solutions you can set up within Remix. Optional route segments can help you use localized sub-directories.
- π Did you know you can write your own typesafe React router in 500 lines?: A great comprehensive article that might give you a better understanding of how existing routers work. Also great to learn about advanced TypeScript type-level programming techniques.
- π Streaming HTML out of order without JavaScript: This super interesting demo shows we donβt need JavaScript to stream out-of-order HTML chunks, and yet render them in the correct order. All you need is Declarative Shadow DOM and slots. It will be interesting to see if RSC streaming + Suspense could leverage that technique in the future instead of inlining JavaScript.
- π Simple RSC With Vinxi: The Vinxi SDK helps you create your own full-stack framework, and it even has a plugin for React Server Components support!
- π Million.js - Blocks with noSlot Mode: the Million compiler might wrap your components with
<slot>
elements, which might cause issues (styling). This introduces a new experimentalnoSlot
mode.. - π How to add Monaco to a Next.js app to enable custom user workflows: Interesting tutorial that also shows how to deploy untrusted user code to Deno.
- π Conceptual Model of React and RSC: Reflects around the UI=f(state) formula in interesting ways, and concludes RSC kind of breaks the original model.
- π Why React Server Components Are Breaking Builds to Win Tomorrow
- π The End Of My Gatsby Journey
- π React Admin March 2024 Update
- π¦ Million Lint - public beta: A VSCode extension that helps you keep your React code fast thanks to dynamic analysis. Much simpler to use than React Devtools flame graphs. There will be an additional AI-based Lint++ paid service built on top to suggest you possible performance improvements.
- π¦ react-unforget - A compiler for automatic optimization of React apps: After Forgetti, this is another new alternative React compiler coming from the community. See also π¦ Joe Savonaβs feedback.
- π¦ Remix 2.8 - Pass resolved viteConfig to buildEnd hook
- π¦ React Query 5.25 - skipToken, typesafe query disabling
- π¦ TanStack Router 1.18 - route groups
- π¦ Starlight 0.21 - New UI components: Steps, FileTree
- π¦ Storybook 8.0 RC - v8 is officially stable enough to be used in production
- π¦ Onborda - Onboarding wizard flow for Next.js powered by Framer Motion
- π¦ Input-OTP - One-time password input component for React
- π¦ Panda 0.33
- π¦ UVCanvas - React component library for beautifully shaded canvas
- π₯ Jack Herrington - Is Tanstack Router Better Than React-Router?
- π₯ Theo - How Shadcn/ui Actually Works
Don't miss the next email!
πΈ Sponsorβ
Need more than just a sign-in box?
Clerk streamlines React app authentication and user management, ensuring a quick setup for the modern web.
Experience the benefits of Clerk:
- π Pre-built UI components for sign-in, sign-up, user profiles, and organizations. Customize with any CSS library and deploy on your domain
- π¦ 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
Dive into Clerk's quickstarts and tutorials to kickstart your projectπ
π± React-Nativeβ
This section is now co-authored with Benedikt. Feel free to send us your comments by email or on Twitter!
Improving Shopify Appβs Performance
Shopify has been a proponent of React Native for a long time. But they did notice their app performance go down since they migrated to React Native. Instead of blaming the tech stack, they got to work and started optimizing for performance. The results speak for themselves: App launch is 44 % faster and screen load times were reduced by 59 %. Hereβs a quick summary of some of the measures they took (hint: FlashList plays a big role in some of these). For details, read their great summary post:
- Initially, only render whatβs visible on the screen (especially true for the home screen)
- Build all screens as lists (based on FlashList)
- Use inlineRequires
- Batch state changes
- Optimize caching
Very interesting insights and impressive results. I hope the Shopify team keeps sharing these details and maybe weβll even see some of the things they mentioned they built during this process ending up as Open Source?
- πΈ React Universe Conf combines the best of React Native EU with a new enhanced program. Get your ticket at the lowest price before March 7
- π PR - RCTRootViewFactory: Simplifies brownfield integrations on iOS and spares you from worrying about Old Arch/New Arch/Bridge/Bridgeless combinations.
- π¦ Drag and drop files from other apps in your RN app
- π visionOS docs - Integrating in existing projects
- π Expo - Orchestrate advanced workflows with custom builds: Custom builds allow you to run scripts (bash or JS) before or after Expo builds, for example to run E2E tests, send notifications to your team, β¦
- π iOS Live Activities and React Native - leveraging the latest iOS features to display your app's most current data without needing to open it: Way more apps should have Live Activities! There is a hurdle for RN devs though, because they need to be written in Swift. This 3-part series walks through all the steps required to add a Live Activity.
- π React Native Error Boundaries - Feature, Partial, and Server: Error boundaries remain an underutilized feature, and every React Native app should have at least one (but ideally more). This post explains why and how.
- π Increase Speed and Security With Native Crypto Libraries
- π Morrow's Summary of the State of React Native 2023 Report
- π¦ Intercom-react-native 6.5 - Now with Expo config plugin
- π¦ Uni Stack - React Native starter w/ Expo, Prisma, tRPC
- π¦ Expo-foreground-actions - Start actions that continue to run in the grace period after the user switches apps
- π¦ React Native 0.74.0 RC 2
- ποΈ RNR 290 - The State of React Native survey with BartΕomiej Bukowski
- ποΈ Rocket Ship 32 - From broke Teacher to Software Engineer with Zach Taylor
- π₯ Simon Grimm - uild a Kids Drawing App with React Native
- π₯ notJust Dev - Build Your Own Blog with React Native (for Web & Mobile)
- π Chain React Call for Speakers now open until May 3, 2024
- π React Universe Conf 2024 - Early bird ends today
π Otherβ
- π¬ TypeScript 5.5 Iteration Plan - new Set methods, config extension merging
- π Effective TypeScript - The Hidden Side of Type Predicates
- π Deno - Introducing JSR - the JavaScript Registry
- π OpenJS Launches New Collaboration to Improve Interoperability of JavaScript Package Metadata
- π Open Web Advocacy - Apple backs off killing web apps, but the fight continues
- π Top 8 Recent V8 in Node Updates
- π¦ WebKit Features in Safari 17.44 - CSS @scope, align-content
- π¦ Shiki-magic-move - Smoothly animated code blocks
- π¦ Parcel 2.12 - Macros defined with import attributes running at build times
- π¦ Playwright 1.42 - test tagging, skipped tests annotations
π€ Funβ
See ya! π
Don't miss the next email!