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

Show all comments

Showing thread 2 of 60

josephg2 replies#
Wonderful work, but this doesn’t look like local first software to me. It looks like server first software with live updates and caching.

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/

nwienert2 replies#
I think this is fair, as they haven't committed to offline - though they've said they want to do it, they just want to wait to do it right. That said, they do work fully client-side, so I wouldn't say it's server-first, it's more of a hybrid. I will try and clear this up in our wording.

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.

josephg2 replies#
> I wouldn't say it's server-first because the mutations are happening locally first and every feature works fully client-side.

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/

aboodman#
[Moved up thread]
aboodman1 reply#
To answer your specific questions:

> 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

hosh1 reply#
That is a disappointing interpretation of “local-first”, and would not suit the kind of applications I want to write.

On the other hand, this is still tethered to the server, so likely more commercially viable than a true local-first design.

josephg6 replies#
> That is a disappointing interpretation of “local-first”, and would not suit the kind of applications I want to write.

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

aboodman1 reply#
Hi Joseph,

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/

josephg1 reply#
> 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.

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.

aboodman4 replies#
> The zerosync website says this:

>> 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/

josephg#
Hah I'll watch the video when I have a chance. Thanks for the invite - I'll have to wait and see when the time & place are announced. Maybe I'll see you there!
Aeolun1 reply#
I don’t get it. Why would you call something that needs a server to work local-first :?

My app that stores its state on my local disk with optional sync to a server is local-first. If the server goes away, the app continues working flawlessly, you just won’t be able to sync any more (unless you host your own server).
I find it hard to imagine people think of Linear when they hear local first.

Continue this thread — 1 reply

andrewingram2 replies#
I think there are two valid interpretations of the words “local-first”.

1) The outcome of all interactions can be seen locally first, but are sent to a server too. Optimistic updates on steroids, largely done to make software seem faster. Linear is the notable example.
2) The app is built so that it’s fully functional and useful without any kind of internet connectivity. But if network _is_ available, there are some augmented capabilities. Think note-taking apps like the one built into MacOS and iOS, or Bear

Continue this thread — 2 replies

_shibru_#
Exactly this, "local-first" here mostly is a marketing term rather than a technical one.

I'll tell you a funny(real) story. where i live there is a popular valley, well let's call it X-Valley. the name is very popular and gets a lot of tourism to the valley, so much so that all the surrounding valleys now advertise them as X-Valleys on the internet. and they get a lot of (re: majority of) their tourism business from doing that.
Second is the people's understanding of the term "local-first", I doubt many truly understand the real one from ink&switch. what a good chunk of them are really looking for is offline-first or even optimistic-ui based sync system.