Things to look forward to in React Native
React Native has been developing rapidly in the last two years, though an exact roadmap from here has not yet been spelled out. Here I try to join the dots and speculate where we might be headed, by analysing the activities of a few key stakeholders.
Expo
Expo has made waves with Expo Router, which aims to further narrow the gap between web dev and mobile dev. Bringing together file-system based routing, unified navigation, static rendering (on web) and deeplinking (on native), it promises to tame the challenge of code-sharing better than ever before.
They've also come out with Expo Application Services (EAS), a set of SaaS solutions for every part of the app development lifecycle, spanning building, deploying, updating, and analytics. By spanning the whole vertical, they can offer a first-class dev experience that is impossible to match with piecemeal solutions. As their first outwardly profit-generating activity after years of open-source altruism, a lot is riding on it.
Software Mansion
Software Mansion is always up to a few things, but what's caught my eye is their work with/for Expo on Expo Modules.
For years, community members have complained about JSI being inaccessible due to its basis on C++, but to no avail. With little support and basic documentation missing for years, it gives the impression that it was a tool created by Meta, for Meta (and perhaps Microsoft), and reflects in the many community native modules still stuck on the old architecture.
What I was not expecting in answer to this, was rebellion. The Expo Modules API rejects the idea of having to write C++ entirely and delivers us JavaScript developers back into the relatively cosy worlds of Swift and Kotlin. The boilerplate is also very well considered, greatly reducing the pain of context-switching.
Callstack
I have a less clear picture of what Callstack have been up to. React Navigation, of course, may have made some changes for the benefit of Expo Router. And React Native EU 2023 is around the corner, which may bring a few new announcements with Łukasz Chludziński's keynote.
But Szymon Rybczak has certainly been busy, working on support for Async components and React Server Components, suggesting that the server is going to have an increased role in UI rendering on React Native (and, as competing mobile frameworks haven't stepped up to the plate, may become a killer feature for it).
Meta
Meta exhibit a mixture of behaviours. Sometimes they work loudly in the open, getting the community involved (see Lean Core) and other times they work relatively quietly, merging features bit-by-bit from their internal fork (see the gradual work on Fabric).
Lately there have been some exciting loud initiatives, such as the long march towards Web conformance. This initiative has been led by Nicolas Gallagher, the creator of React Native Web, evidently having had enough of making compromises when mapping React Native APIs to the Web platform. His recent outline shows a decisive plan to move any mountains necessary to reverse the power balance and make React Native bend to the Web, to the extent of refactoring core internals to adopt EventTarget and even proposing to support DOM traversal.
This fever also extends to CSS. Meta have, to great reception, put resources back into Yoga development, and have opened up to feature requests. This led to particularly productive discussions[1] [2] with Nico Burns, the main contributor to Taffy (a fork of Stretch, the Rust-based spiritual successor to Yoga, created by the original Yoga team lead). As Taffy already implements additional Web layouts such as Grid and Block, there was talk as to whether and how Yoga could do the same. Whether we'll see anything big result from this, I don't know, but it's good that the discussion has happened.
Beyond React Native, key figures in the React team such as Sebastian Markbåge and Andrew Clark have moved to Vercel, where they tell Vercel what to do. So again, we can probably expect ever more focus on what the server can do for us.
There's Hermes, too. React Native EU will bring Tzvetan Mikov's talk on "Static Hermes: the Next Generation of Hermes", which promises better access to native types and APIs and support for annotating explicit code with types to improve the compilation output. With Hermes also (briefly – it'll be back!) making it into Microsoft Office, it shows increased buy-in from Microsoft. Speaking of whom...
Microsoft
The React Native Windows fork of Hermes is special in that it supports Node-API (and in fact re-implements JSI on top of it, for purposes of ABI stability). This opens up a whole new avenue for accessing native code, not least from the existing npm ecosystem. Excitingly, it would allow for native modules to be developed in Node.js (or, in fact, Deno or Bun, which also implement Node-API) and thus avoid ever having to spin up a simulator or scaffold out an example app when developing non-UI code.
There's a lot more to say on what Node-API could mean for the future of React Native, but that's all I'll touch upon for this article!
Summary
Server-side rendering is coming to React Native, as surely as it came to React DOM. It promises improved user experience, though at the expense of potentially complicating things for developers. Expo, with their penchant for taming chaos, aim to replicate Vercel's success in this domain through Expo Router.
Whether or not you use Expo Router, it is becoming ever more compelling to use Expo over bare React Native, through Expo Application Services and Expo Modules. As Mathew Pregasen put it, "Today, the question is more 'Why not Expo?'". With nobody else in the game, and React Native continuing to recommend them by default in the startup docs, the situation doesn't seem set to change anytime soon.
In other news, the Web was right after all, and React Native is now making a concerted effort to backtrack on the various ways in which it originally diverged (in all fairness, to simplify implementation). Apart from making the platform more intuitive to web developers, it should give us a lot more expressiveness in all aspects of app development.
And it's not just conformance with the Web platform to enjoy. If Node-API makes it into Hermes, we can look forward to improved interop with the npm ecosystem, and a whole new way to write native modules.
Speaking of Hermes, its upcoming features for native code access and build-time optimisation, and adoption into Microsoft Office, show that it's anything but slowing down. It may not fit the bill for a Node.js alternative, but I wouldn't be surprised if in future we saw it finding novel use-cases outside of React Native.
All in all, the future is bright for React Native. React looks set to become the first framework to implement first-class server-side rendering both on Web and native, and the most intuitive (non-webview) solution for web developers to write native apps with. Increasingly, more code written for other JS engines will become available to React Native, and targeting multiple platforms will continue to reduce in cost.
If you thought this was a jolly good read, then the excellent news is that there is a mechanism below for obtaining more of it. With any luck, see you in the next issue where again, I'll talk about Whatever.