tldraw / tldraw

SDK for creating whiteboards and canvas experiences on the web.
https://tldraw.dev
Other
33.86k stars 2.03k forks source link

proof of concept: assets as references to blobs in indexedDB, not directly as base64 in store #3745

Closed mimecuvalo closed 2 weeks ago

mimecuvalo commented 1 month ago

As I look at LOD holistically and whether we have multiple sources when working locally, I learned that our system used base64 encoding of assets directly. Issue https://github.com/tldraw/tldraw/issues/3728

assetstore

The motivations and benefits are:

The benefit here is clear! I created an AssetBlobObjectStore which probably needs some thought (again, this is proof-of-concept), so if we decide to move forward, let's discuss how best to integrate that part.

Todo:

Change Type

Test Plan

  1. Test the shit out of uploading/downloading video/image assets, locally+multiplayer.

Release Notes

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
examples ❌ Failed (Inspect) May 13, 2024 8:32am
1 Ignored Deployment | Name | Status | Preview | Updated (UTC) | | :--- | :----- | :------ | :------ | | **tldraw-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/tldraw/tldraw-docs/Eu23A7aSxsVFx5WGdNB4Y6ZxfXt2)) | | May 13, 2024 8:32am |
SomeHats commented 3 weeks ago

left some other thoughts on this here: https://github.com/tldraw/tldraw/pull/3764#issuecomment-2122516560

my take on this is that I like what we're doing with this, but i'm not sure it belongs quite so core as this makes it. i think blob storage is quite niche - it's really only relevant if you have an editor saving locally in the browser, whereas most people either have a multiplayer room or some sort of other saving mechanism. i certainly don't think it should be the default as this PR makes it.

instead, i would love to see a slightly more general system for making asset storage/retrieval more flexible. what would it look like for this to be build entirely in userland on your asset rewriting hook from #3764, for example?

mimecuvalo commented 3 weeks ago

my take on this is that I like what we're doing with this, but i'm not sure it belongs quite so core as this makes it. i think blob storage is quite niche - it's really only relevant if you have an editor saving locally in the browser, whereas most people either have a multiplayer room or some sort of other saving mechanism. i certainly don't think it should be the default as this PR makes it.

yeah, totally fair to not make it core, definitely would make sense more as a sidecar kind of option.

instead, i would love to see a slightly more general system for making asset storage/retrieval more flexible. what would it look like for this to be build entirely in userland on your asset rewriting hook from https://github.com/tldraw/tldraw/pull/3764, for example?

i see the overlap for sure, but i think in my head they're quite different (as far as storage vs. dynamic retrieval). i'd avoid making a system that tries to address them both perhaps because they're trying to address two different problems. (it's maybe a coincidence that I'm working on both at the same time heh)

let's discuss more tomorrow!

mimecuvalo commented 2 weeks ago

(closed in favor of https://github.com/tldraw/tldraw/pull/3836)