Lurker News
Hey HN, I'm Nate, the creator of Tamagui.

One is a React framework that does two things differently in hopes of simplifying how we build websites and apps:
1. It unifies React Native and React web with typed file system routing by making Vite able to serve RN. This lets you share (or diverge) your code in a simpler way for cross-platform apps.
2. We've partnered with Zero (https://zerosync.dev) to make local-first work well. We've been building a solution in One that makes Zero supporting server rendering, without waterfalls, and with seamless server/client handoff.
---
Honestly - I'm a bit hesitant to post One here.
HN has really soured on frontend/frameworks. And I get it. We've collectively complicated the hell out of things.
That's why I decided to build One. I loved Rails, it made me as a young developer able to finally realize way more ambitious projects than I'd ever done before. I also liked the promise (not implementation) of Meteor - it felt like the clear future, I guess just a bit too early (and a bit too scope-creeped).
I worked at Uniswap and built Tamagui and so spent a lot of time building cross-platform apps that share code. Uniswap is built on Tamagui and I think proves you can make really high quality UX while sharing a lot of code - but it's insanely hard and requires a huge team. My goal with One is to make what is now possible but hard dramatically easier.
And I think the path to there goes through local-first, because it makes building super responsive apps much, much simpler, and Zero is the first library to actually pull it off in a way that doesn't bloat your bundle or have very limiting constraints.
I happened to live down the street from Aaron, one of the founders of Zero, in our tiny town in Hawaii. We talked a lot about Zero over the last couple years, and I found it really admirable how he consistently chose the "harder but better" path in building it. It really shaped into something incredible, and that convinced me to actually launch One, which at the time was more of an experiment.
I can see a lot of potential criticism - do we need yet another framework, this is too shiny and vaporware-y, this is just more complexity and abstraction, etc. Happy to respond to those comments if they come.
I'm just building out something that I've been wanting for a long time. Opinionated enough to let me move fast like Rails, but leaning on the great work of team Zero so that we don't end up with the scope creep of Meteor. And honestly, it's just really fun to hack on.

Comments (254) 60 threads

Earlier comments
novoreorx1 reply#
Zero seems like a promising approach for developing local-first applications. However, if I want to develop a SPA in the traditional way—using fetch or react-query to communicate with the server—will I need to configure anything special to separate Zero from One? In other words, I hope One is not tightly coupled with Zero. It should be a data-solution-agnostic framework, focusing on the UI for various needs. We really need something to fill the gap after CRA is replaced by Next.js, as Next.js does not provide a mature SPA solution (and neither does Remix).
nwienert1 reply#
They are not tightly coupled. We just want to be able to build some great tooling for those who do opt in.

But it will always be opt-in to Zero.
I think it’s an amazing alternative to CRA - it’s got the lightness of Vite, but you get all three rendering modes on a per page basis!

novoreorx#
It must be! You can’t imagine how desperate I was when I found the main stream UI framework in React nowadays didn’t think SPA is a thing, I just want a file-based routing SPA framework, but people keep talking about SSR and Next. With the release of One, I finally don’t feel alone.
gorbypark1 reply#
As a react native dev I’d love to hear some of the implementation details!

First, is this a whole new router? Is it based on expo-router, or is it sitting on top of react-navigation? Maybe all new with react-native-screens as a foundation?
As far as Vite goes, I assume this is only on the web? Metro is still be used on the native side? If true any reason why you’re not using metro on the web as well (I’m kinda partial to having all platforms as similar as possible, tooling wise)?
I suppose I should also ask how expo fits into this all…meta framework on top of expo or something “all new” on stock react native?

nwienert1 reply#
It started as a fork of expo router to test if we could get it to work on Vite. Over time we did diverge a few things and added other features.

It’s actually fully Vite on native. We wrote an entire custom bundling step and hot reloading. This was no small feat, quite hard. That was the motivation though - simple tooling and the same bundler for everything.
Expo is great for Expo Go and EAS. It’s a good complement!

gorbypark1 reply#
From my limited understanding of Vite, it serves es modules directly on the fly during dev but uses Rollup to bundle in production. Did you swap out Rollup for Metro in production, or have you somehow ported all that byte code generation stuff to Rollup as well? Pretty wild either way!
nwienert#
We use Rollup to build for native, SWC so we can compile class away (RN doesn't support classes, shockingly).

Then we actually build out our own custom bundle using the Rollup output because we need to hot reload it, so we built our own little hot reload pipeline on top of Vite. It's not too complex actually - websocket, listen to vite, transpile it to CJS/ES5, analyze and re-write imports to match bundle, and then send it over.
But yea, it was a lot of work. Going to have to make some content around this as I assume a lot of people thing it's just Vite on top of Metro.

recroad1 reply#
I just started a react native/expo project and saw this. I’m wondering if this is mature enough for me to adopt, and more importantly, how easy will it be to migrate react native/expo project to this in the future. I just don’t feel this thing is stable enough as the guides themselves state, especially for iOS.

I’m also not really sure what problem this is solving. We already have the ability to create android and iOS apps based on one source code to react native. So what’s the additional benefit here?

nwienert1 reply#
What are you using currently to shared code?

One generally has better web features/performance. Our tree shaking/bundle splitting is better, SWC for everything so it's faster, and Vite is a joy to use in many ways compared to Metro.
The routing modes are also neat and novel, you can globally choose a strategy - SSR, SPA, SSG, but then also choose on a per-page basis. This is huge for having performant marketing pages, but not burden yourself with having to server render everything.
Our dev mode is also robust - it will fully SSR render with CSS extracted in dev mode, identical to production. This is pretty huge, even Next doesn't do this (as of a few months ago), you'd have flickers or inconsistencies.
Other advantages include link-hover-preloading, a much slimmer initial bundle size, 0 waterfalls of all assets loaded on first render. Loaders are another, no universal framework does it. Also, we build to production fully for you including a server to serve it, and it works with all your stuff - loaders, API routes, etc - also not true of comparables.

recroad#
Thank you. I’ll give it a shot. Gotta experiment.
catchmeifyoucan1 reply#
This looks really awesome! Can't wait to try it out. I've worked with React-Native-Web and Nativebase in the past, and it was always fragmented. I'm glad you're working on this. Zero was mentioned a lot in the demo and it seems impressive.

Love this the most:
> almost all features can be built completely client-side, with no need for new server-side APIs
Any thoughts on a desktop target for this (e.g Electron/or Webview Desktop target)?

nwienert#
It should “just work” for electron, but we probably need to make it easier to build target them. Happy to collab and help there if you join the discord and send us any issues you run into.

Load more comments