Closed jchris closed 6 months ago
make a message format to send to partykit https://github.com/fireproof-storage/fireproof/blob/main/packages/connect-partykit/src/connect-partykit.ts#L74
probably like
const partyMessage = {
data: base64String,
car: carFile.cid.toString(),
}
we could do something like this and pass cars in realtime, but we also need a rest loader. https://github.com/fireproof-storage/fireproof/blob/a4321d1a14c8899cd3c47ce822071224957d44d6/packages/fireproof/src/loader.ts#L305
const remoteCar = await remote.load(cid)
if (remoteCar) {
// todo test for this
await local.save(remoteCar)
if you start with the rest loader it will just work, and we can do the message delivery someday/never
the rest support probably looks like adding http to server.ts https://docs.partykit.io/guides/responding-to-http-requests/
in that case we might not need to do anything like
partyMessage = {
data: base64String,
car: carFile.cid.toString(),
}
instead we can just PUT and GET from the rest endpoint. Let's do that, it's simpler and more cacheable.
That's how Netlify data store works: https://github.com/fireproof-storage/fireproof/blob/main/packages/connect-netlify/src/server.ts
thank you! I'll add more as I think of it
was merged in https://github.com/fireproof-storage/fireproof/pull/50 thanks @valorant-dhruv
Currently the partykit connector is metadata only, but it could handle storage easily. This would simplify development b/c you can deploy partykit only apps, instead of needing s3 or netlify in addition.