Show HN: One – A new React framework unifying web, native and local-first (opens in a new tab)onestack.dev
506 pointsOne 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
In the end, after all that journey, I settled into Laravel Backend and Vue3. Every app I create now is just a copy-and-paste of what I've done before. The tech stack disappears into the background and I try to actually build the features that I want to build.
I'm definitely old because I see this great work called "one" and I look at the video and I get immediatey turned off by so many "new things". It's me - definitely me. It's maybe for a different generation of devs.
I really like vue. Laravel I don’t so much, but I appreciate how boring yet well designed it is.
I often wish the js ecosystem had real counterparts to laravel. We have too many ways to do things.
Continue this thread — 2 replies
It's fast, it's secure, i implement everything myself -> it's flexible.
It's great that vite does the bundling, but it's the only job it does.
My page is now down to 2 ms response time, i don't see a reason to go back to the symfony/laravel days.
To whoever posted the video accelerated: don't do that. It's very difficult to understand what the man in the video says unless the YT speed is down to 0.75. What is the point of that ?
Simply put, stuff gets much more much quicker compared to 5, 10, 15 years ago.
Not being quite able to keep up with any and all frameworks popping up and being overloaded with the size and speed of current web ecosystem is a struggle for younger peers aswell, and the days of "you even COULD check out every other new framework" are long, long gone
The problems themselves are way more interesting to me now. I get very upset when the tech gets in the way. I'll happily pay for licenses, fees, royalties, etc to clear the path.
It wasn't always this way though. The first decade of my career I didn't really care for the problems I was working on, so theorycrafting the tools all day was a nice respite. Coming up with principled clean architectures is a lot easier when you don't have to answer directly to the customer.
Doing stuff for actual customers is seen as grunt work. Their interests aren't ours, and we can't share what we learn with our peers.
So we end up reinventing the wheel just because it's more fun. And it is fun, and that's ok. Sometimes it's even useful. You just have to figure out what your real goal is, and not spend your whole life polishing your craft for its own sake.
I'm trying to work to ensure that doesn't happen to me. What I've realized is that I need to take breaks - of at least months or even years - and come back with fresh eyes to the things I know well.
And I need find new things to be a beginner at so that I don't forget what that's like. I'm trying and mostly failing to learn guitar over the past year. I've taken up resistance training in a semi-serious manner in the last few months, and that's going much better than the guitar.
If it’s still around 5 years down the line, it might be worth investigating.
Continue this thread — 1 reply
Last few weeks I've been writing a software 3D renderer from scratch not because there isn't countless of great engines out there ready to use, but because I need to understand the base principles of 3D rendering much better than I did before I tackle the technologies that have presumptions and bias towards specific problems baked in.
For my intended use case, my own 3D software blitter in JS is probably going to be good enough, but if it isn't, at least I know why it didn't work for me and I can make a much more informed choice.
This is how I approach programming as a senior developer at my job as well. And I find that asking the right questions and reframing problems before looking for technologies to solve them is one of the key benefits of age and experience. It's also why the last few places have hired me, specifically because I reframe questions and break down assumptions before I start typing away at the keyboard.
It's 10× faster than in any modern approach, there's no build step, I can sync it to any server and it just runs, the code is simple, the end result is snappy, it loads immediately, it has great UX, and I don't need to scale to a million users anyway.
You don't see the same bs in other areas of computer science.
It's not like databases haven't been reinvented every time there's a new fancy startup.
MySQL the OG "but web scale" DB (even with InnoDB because consistency level set to - you guessed it - "web scale"), then all the NoSQL kids because of course "web scale", then SSD/NAND write-amplification and LSM and LevelDB and whatnot and nowadays RocksDB. And there's the memcached/Redis/Valkey.
It's not like networking is not doing the same. HTTP2, HTTP3. DNS over HTTPS, how amazing it is to establish a TLS connection just to send a base64 encoded DNS question. WTF. And there's a myriad things in eBPF land, all the kubernetes-related CNI providers, and during the OpenStack years we had new overlay networks every year (VXLAN, Geneve, and I forgot the name of the other stuff), and if you go a bit closer to datacenter networking and peek into the firehose of 802.1 of new protocols you'll drown from the constant buzz over which variation of the same thing is the obviously best one! (I still remember when people started to realize that maybe there's a better and cheaper way to avoid VLAN and spanning tree problems than "just buy Cisco forever and don't forget to enable rapid STP (802.1w)" ... and then for a while there was MSTP (802.1s), TRILL, and SPB (802.1aq) and now it's managed networks all the way down, I guess)
Maybe Google instead should have used their politucsl clout to push for Http over SCTP. But it is not like there was a suitable predecessor to HTTP3.
Continue this thread — 1 reply
Is it really an age thing or actually an experience thing? I see the same sentiment in a lot (though not all) of the replies here and I think the fatigue that people feel from announcements of new tools is really down to having seen the same promises of 'simpler' and 'better' before in hundreds of other tools, with none of them ever really playing out or lasting.
The simple answer as to why these tools don't last is that everything builds on and improves on everything else, but genuine 'improvement' is hard to quantify here and what we really have is changing abstractions, with the underlying contraints (browser environment) not changing as quickly due to the need for standardisation.
Web/cloud in particular is particular bad for churn in 'tools'. It seems surprising, as open source projects with no expectation for monetisation don't have a financial incentive to succeed, only the personal satisfaction of tool development and perhaps (cynically) a sort of online celebrity type of success that comes with being a known creator and maintainer of a well-used project.
For people that feel excited to learn new tools and techniques, when they stop feeling excited at this week's new shiny tool, I don't believe that's because the excitement of learning has gone, but the realisation that the new shiny is another thing operating at the same level of abstraction. Personally, new frameworks operating at the same level bores me, but deeping my understanding of the layers below is still exciting, and I personally think should have more emphasis on importance.
This doesn't mean people should feel discouraged from exploring new ideas and approaches, but it's important to realise that the cost to a creator of releasing anything into the web is virtually zero (essentially just development time), while the cost of adoption is high for every person that needs to learn yet another idea of how to structure their application and the abstractions that someone else came up with.
Web and cloud in particular seems to have a 'tools' problem, where every 'problem' that could be solved by simplifying or reducing (as general approaches) ends up just getting more tech 'solutions', but more tech to solve tech problems only serves to bury complexity.
Unfortunately it always ends up as the easier option to simply build new tools or build on top of what exists instead of developing a deeper understanding of the problem. It's also genuinely incredibly difficult to make sigificant changes to browsers as a target environment, so naturally all the tooling falls to things that can be done at development time or on-request.
Just my 2p.
Continue this thread — 2 replies
Continue this thread — 2 more replies
Don’t get me wrong, that’s super cool - but if you’re going to claim it’s local first software, I want to see the principles of local first software at play. And I don’t think Zero delivers that - at least as I understand it from its website.
Like, “the network is optional” and “the long now” and “you (the user) retains ultimate control”. It just looks like an excellent server sync system with client side caching. What if the data I need isn’t in the cache? What happens when I edit things offline then come online later? What happens if the company shuts down and the server gets turned off permanently? Will the app still work?
Local first software can handle these cases too.
[1] https://www.inkandswitch.com/local-first/
Final note on the user-stuff: that's always up to the person writing the app anyway. You could make a "download the IndexedDB" button with a couple lines of code, but it's more than that, it's really a whole bunch of decisions you have to make as an app-developer to commit to it. And tbh I think the general understanding of local-first has settled on client-side + optimistic + offline - for the better.
That's not even close to what "local first software" means.
Can apps work without the server? Like, if the server goes down, will the app still work?
Can I collaboratively edit my data without the origin server? (Or at all?) Normally replication built on raw postgres queries relies on atomic row level locks on the server, while processing transactions. What happens if two people edit the same data at the same time?
Does it support end-to-end encryption, so my data isn't readable by the server at all?
Can I back up the app & my data together, and open it back up in 5 years and have the app still work?
All this stuff is talked about in the local first paper. Putting a sync engine in front of postgres (as described by the zerosync website) doesn't do any of this stuff. (Or maybe some of it? Its hard to tell without more information, and I can't find a link to the source code.)
It reminds me when Zoom advertised E2E encryption on zoom's website because the CTO clearly didn't know what "end to end encryption" actually means. It looks like an excellent product - so why exaggerate its capabilities?
"Local first" doesn't mean "edits are applied speculatively in the client before they hit the server". It also doesn't mean "caching part of the centralized postgres database in the client".
Go read the paper. The details matter. https://www.inkandswitch.com/local-first/
> What if the data I need isn’t in the cache?
The developer can arrange for all the data to be in the cache if the want that part of the app to be fully offline capable.
> What happens when I edit things offline then come online later?
Zero won't support offline mutation at launch, but there's nothing preventing it from working. It is built on [Replicache](https://replicache.dev) which does support offline mutation.
I think almost no software that claims to be local-first actually supports robust offline editing and merging. The only people I've seen really go for this is the I&S folks with their branching stuff and that was just an experiment.
I'm excited to do this right, but most of our users care more about the ux and dx improvements while online, so we'll do it later.
> What happens if the company shuts down and the server gets turned off permanently? Will the app still work?
Developers can self-host Zero. In advance of any standards for sync, this is about the best you're going to get with any local-first software today, except maybe stuff that syncs to Dropbox (which is cool!).
> Can apps work without the server? Like, if the server goes down, will the app still work?
Yes. Read-only at alpha, and later read-write.
> Can I collaboratively edit my data without the origin server? (Or at all?) Normally replication built on raw postgres queries relies on atomic row level locks on the server, while processing transactions. What happens if two people edit the same data at the same time?
Yes. Zero uses server reconciliation, like our previous products Replicache and Reflect. You can read more here:
https://rocicorp.dev/blog/ready-player-two
(how could you even do realtime collaboration with postgres locks? that doesn't really make sense)
> Does it support end-to-end encryption, so my data isn't readable by the server at all?
Sure. That's up to the developer in how they design their database schema, but of course it's possible.
> Can I back up the app & my data together, and open it back up in 5 years and have the app still work?
I mean I guess so? If you had it in an electron app you just snapshot the data directory? An app developer could arrange for this to happen if it was important to them.
Does this all count as local-first? I think it's about as local-first as most other software claiming the title. But again, I kind of prefer to focus on what our product does and for that reason I try to avoid claiming we're local-first.
Continue this thread — 1 reply
On the other hand, this is still tethered to the server, so likely more commercially viable than a true local-first design.
I don’t think anyone wants or expects all software to be local first.
What would it even mean to "locally first" turn the lights in my house on and off, check the weather, or play a multiplayer-only video game?
Local first makes a lot of sense for some use cases - like personal / creative work (eg Apple Notes). But not for others.
Continue this thread — 6 replies
There is a lot of debate about this in the community. People like pvh, adam wiggins, and johannes have all said they consider Replicache and Zero part of the local-first movement [1] and that they would be sad if we and other things like us weren't in it. I was even invited to speak at local-first conf, where we announced Zero last May. [2]
I think in practice delivering on the local-first ideals is ultimately up to the app developer not the library. Like in practice every yjs app talks to its server over some bespoke protocol and is loaded over a URL. If that server goes away your yjs app is a brick. No less a brick than if your zero server goes away.
Similarly although everyone likes to claim Linear as a local-first app, if the Linear server goes away your Linear app is a brick. Yeah you can export the data from IDB or whatever but you could do the same for Zero or any of these systems.
That all said, for our part, we have recently tried to avoid claiming Zero and Replicache as local-first on our own sites to avoid this controversy [3].
I think we're building something really valuable that a lot of people are excited about. And I think we're making the right tradeoffs for the majority of software that most people use every day. So I don't really care too much if it qualifies as local-first (except insofar as I like hanging out with the local-first folks and would be sad to not get invited to the parties).
I forgot to mention this to Nate when he showed me these mocks for One because honestly almost everyone else (not us) refers to Replicache and Zero as local-first and it's easy to forget. I'll leave it to him to decide what to do with his own product, but it seems easy enough to me to soften the language.
[1] https://youtu.be/cgTIsTWoNkM?si=6bYAAunqd5kdl-UL&t=2692
[2] https://www.youtube.com/watch?v=rqOUgqsWvbw
[3] https://zerosync.dev/, https://replicache.dev/
I agree! I wanted live server sync like this for years. And I built ShareDB years ago along those lines, many years before the term “local first” came into being.
But I see a pretty big difference between “server based app with sync” and “local first software”, party invitations aside. I wish we made a term for server based sync - I think it’s marvellous, and it’s important for all sorts of use cases. I think it’s ridiculous modern databases don’t have live queries built in as a standard part of sql. You’re doing great work here.
But all that said, I personally actively avoid calling sharedb local first because I don’t think it is. One big difference is authentication - who has permission to edit the database? And when? With sharedb (and I assume zero), it’s possible to add logic on the server to reject edits. It’s not possible to do this in the same way when clients can write to Yjs or automerge, connect to one another directly and broadcast their changes without the server in the loop.
That’s a pretty big difference - at least to me. I can’t speak for pvh, since I don’t get invited to those parties. But I want language to differentiate those two kinds of software. I’ve been writing software that straddles that line for over a decade, and that difference of how authoritative the root server is really important. It really changes a lot of things about how we build software.
I think the situation is like if we didn’t have a good term for client-server encryption so everyone just calls their software E2E encrypted even when it’s just using tls and encrypting data in transit.
I don’t think you should stop going to local first events. But I don’t think being invited to super cool parties tells us anything about your code. That makes you, personally, a member of a community. But the local first software question is, as I see it, a technical distinction. Not a social one.
The zerosync website says this:
> But where Zero really shines is “local-first” style applications like Linear and Superhuman.
Personally, I find that a pretty confusing claim. “Seamless online / offline support”? Sure. Rad as f? Absolutely. Local first? Eeehhh. It looks like a modern sharedb with a Postgres backend, better caching, maybe cleaner client side api and no collaborative editing. Definitely cool, but very, very different how local first software is described in the paper. That or I should start claiming sharedb is local first too, and muddy the waters forever. Gmail offline mode? Local first everyone. You're welcome!
As for websites that support offline data but can’t be loaded without a server, why not? App manifests can solve a lot of that. (Though nobody ever tries actually opening websites when they’re offline, so maybe there’s no point setting it up).
Personally, I’ve never heard of Linear. And I’ve never heard “everyone say” it’s local first. But if it’s a brick without the server, sorry, but I think everyone is wrong.
>> But where Zero really shines is “local-first” style applications like Linear and Superhuman.
It is a difficult thing to communicate since the vast majority of people interested in Zero are coming looking for "local-first". And for better or worse what they have in mind is Linear (it's a very popular and widely respected bug tracker that calls itself local-first) not Apple Notes.
https://www.youtube.com/watch?v=XTMyOtvBJ_g
I'll think about how to reword.
I'm officially (waves hands in proclamation) inviting you to the next local-first conf. It's crazy fun. Tons of smart people working on all things sync.
https://www.localfirstconf.com/
Continue this thread — 7 replies
* Overall, not bad. Using React Native is far better than trying to mimic platform UI in the web, which is always terrible. * When tapping on an item on the “Feed”, the transition is made to the details _and then_ the navigation bar has a sudden title transition. This is weird. * The button in the upper left to switch between light and dark mode is nice but it should default to the system setting. It did not for me. * The Notifications tab content isn’t scrollable at all on my phone. Seems like a bug. * If you tap on an item in Notifications you navigate deeper in, but when you hit back you are back on the Feed tab.
Coming from native app development, it has the normal uncanny valley feeling that React Native gives off but for normal users they may not notice it as much.
How do you know?
Continue this thread — 3 replies
Continue this thread — 4 replies
All comments shown.
Couldn't load more comments. Check your connection and try again.