HNHacker News
TopNewBestAskShowJobs

jamesgpearce

2,508 karma · joined March 11, 2009

Hacker, sailor, TinyBase. Previously Engineering Director at Meta: data infra, dev tools, open source, and platforms.

https://x.com/jamespearce https://tripleodeon.com

submissionscomments
jamesgpearce··on Muse – Meta’s personal AI agent
That was to be the voice control for the Portal smart speaker before we integrated Alexa.
jamesgpearce··on Nice Things with SVG
Perhaps a generous definition of "better"... but some of those genuinely made me laugh!
jamesgpearce··on Sqlite3 WebAssembly
Disclaimer: I'm the author. But you might be interested in TinyBase.
jamesgpearce··on Connecting TinyBase to PGlite and PostgreSQL
TinyBase author here if anyone has any questions or comments about this!
jamesgpearce··on "GitHub" Is Starting to Feel Like Legacy Software
A while back I started on an experiment to build a local-first GitHub client: https://github.com/tinyplex/tinyhub

It certainly _seems_ like the GitHub interface should feel more like an 'app', and less a 'site'. Or just me?

jamesgpearce··on TinyBase v5: CRDTs for the rest of us
It's just a way to get up and running with an app template. But this is the essence of the JS in question: https://github.com/tinyplex/vite-tinybase/blob/main/src/inde...
jamesgpearce··on TinyBase v5: CRDTs for the rest of us
The very first demo is React-less and so is this Vite template! Enjoy :)

https://github.com/tinyplex/vite-tinybase

jamesgpearce··on TinyBase v5: CRDTs for the rest of us
As the other commenter points out, the ui-react (and in turn ui-react-dom) modules are optional so you can run it with full ReactDom, with abstract React (eg React Native), or without React at all.

The way to do that would be to listen to data changes (eg addCellListener) and in the listener just manipulate the DOM directly. Probably a pretty slick approach, performance-wise.

For SQLite, a variety of flavors are supported including things like ElectricSQL, Turso, and PowerSync - which all let you sync back to a server. You might also consider running a ‘client’ on a server that can listen to changes coming through web sockets and persist itself to server storage - but I haven’t written that pattern up yet.

Hopefully you’ll get a chance to try it out in the meantime though!

jamesgpearce··on TinyBase v5: CRDTs for the rest of us
Author here if anyone would like to ask any questions or offer feedback!
jamesgpearce··on Meta Llama 3
That realtime `/imagine` prompt seems pretty great.
jamesgpearce··on Seven Agonizing Nights Aboard the Icon of the Seas, World's Largest Cruise Ship
Fantastic travel writing with a couple of real LOLs. The author plays the role of self-aware snob for all it's worth though, I assume hoping that his fellow passengers and Atlantic readers are disjoint sets.
jamesgpearce··on TinyRooms: a local-first app demo using TinyBase and PartyKit
It’s a proof of concept! But hopefully you can see how you could build an app that has content that is both cloud & local, private & shared - and that has users that are both anonymous & authenticated, online & offline.
jamesgpearce··on Local-First Web Development
Thanks! Yep, I think we need an about page, and maybe a few pull quotes from the articles. The first article from Ink & Switch is the canonical source of the name and the idea.

I think a lot of web consumer products (and dare I say SaaS too) are these days _not_ on your own computer like they were in the 90's or early 2000s. This isn't a call to return to those days, but it is a reminder that there have been trade offs in moving our productive lives entirely to other people's computers - both in terms of technical performance, but also conceptual ownership and the like. Can we rebalance a little?

So yes, the idea is exactly _not_ new. But a lot of products are built today without considering this tried-and-tested architecture as an option. This site & list of tools is just a friendly reminder that yes, there is another way.

jamesgpearce··on Local-First Web Development
Yes I know! I gave a talk about this, and it made me nostalgic in a way. https://tripleodeon.com/2022/11/closing-the-gap-between-your...
jamesgpearce··on Local-First Web Development
Nope, I'm not sure it's that. Brave crashes on tinybase.org pages without the glow. I wonder if it's the SVG favicon?
jamesgpearce··on Local-First Web Development
One of the authors here. Just catching up on the awesome feedback in this thread - thanks!

I just thought this was a fun list of links to put together (like it's 1994!) and TBH I was not expecting quite this degree of positive reception.

Happy to answer any questions!

jamesgpearce··on Local-First Web Development
Author here. This has got to be one of the simplest web pages on the planet :/

Logged with Brave support and as issue on the site’s repo.

jamesgpearce··on Local-First Web Development
Author here. I’ll try and fix this. I have a suspicion it’s the CSS glow behind the logo since everything else is the most stupid basic HTML you could imagine.
jamesgpearce··on Local-First Web Development
Author here! Happy to answer any questions about the site, community, or local-first app philosophies in general.
jamesgpearce··on TinyBase v2.0: reactive data store for local-first apps
Thanks but I do feel a bit guilty :)
jamesgpearce··on TinyBase v2.0: reactive data store for local-first apps
Yep, I guess I should be thankful if that's the main complaint! And thanks for the spec for the 'basic typography' toggle option :)
jamesgpearce··on TinyBase v2.0: reactive data store for local-first apps
No, there are no dependencies. It has its own in-memory data structure, and ways to serialize it to other, more persistent, formats. I could imagine an option for more fully fledged RDBMSs being those persistence layers though.
jamesgpearce··on TinyBase v2.0: reactive data store for local-first apps
Yes, one imminent idea I have is to codegen a .d.ts from an explicit schema (or even implied, from populated data). One might even be able to produce typed functions like `setPetsPrice(petId, price: number)` instead of `setCell('pets', petId, 'price', value: any)`.

Sort of an ORM trope, but hey, why not!

jamesgpearce··on TinyBase v2.0: reactive data store for local-first apps
By "reactive" I mean... if the data changes, the UI does (or at least, an event is fired, and then you can drive a React render, for example, from that). In contrast, you expect to have to poll an RDBMS for updates. An MIT team recently wrote an awesome essay on the same concept (https://riffle.systems/essays/prelude/), wrapping SQLite for the purpose.

With "data store", rather than "database", I'll admit I am hedging my bets. Through one lens, this library can look more like an app-level store in a classic React sort of way. Through another (most notably the table/row/cell structure), it looks like an RDBMS. I'm not ready to go all-in and declare it's a database yet. Such nomenclature comes with Assumptions™.

jamesgpearce··on TinyBase v2.0: reactive data store for local-first apps
Is it bad to admit... I don't really know... much about PouchDB?

But you've sold me on the concept. I have plenty of prior art to read up on, it seems!

jamesgpearce··on TinyBase v2.0: reactive data store for local-first apps
I do not want to take on CRDT lightly, since I want to make sure it doesn't balloon the library - it'd probably be an optional module. I feel like that's one of the next big things to tackle, so does v3.0 sound good? :)

In the meantime try opening up the drawing demo (https://tinybase.org/demos/drawing/) in two or more (of the same) browser windows and move things around. This is just via local storage but imagine how cool it would be to have that across broader collaboration...

jamesgpearce··on TinyBase v2.0: reactive data store for local-first apps
Correct. I think this could be done, but I would need to think a little about how best to. Thank you for the idea!
jamesgpearce··on TinyBase v2.0: reactive data store for local-first apps
It could be made to be. The current persistence implementations are all batch but I believe they could be row, or even cell-level, theoretically. Nice idea.
jamesgpearce··on TinyBase v2.0: reactive data store for local-first apps
The data is in memory, and the persistence strategy is kind of up to you. So it would scale reasonably if you put the sync/persist on a different schedule to the UI - perhaps when the browser is idle.

BUT of course, this is not a library to be used with data sets of billions of rows! I'd recommend a proper RDBMS for that ;)

jamesgpearce··on TinyBase v2.0: reactive data store for local-first apps
Yeah, I see your point. I've been assuming that local-first doesn't mean local-only. Even if it's just you, you could easily be polling something else to get data updates, as you suggest. (One original use case was a personal GitHub dashboard app that polled for new activity but provided local analytics).

A couple of great essays I've enjoyed in this space are https://www.inkandswitch.com/local-first & https://riffle.systems/essays/prelude/

I feel it should be possible to build certain types of apps that can view, query, and manipulate denormalized data without even being online. (Perhaps I shouldn't over-glamorize those days when one used to jam Access databases into Windows apps, but hopefully you get the point.) Reactivity just serves as a nice binding paradigm.

Page 1 of 4Next →