We carry a patch-package patch against tldraw purely to add an assets prop to TldrawImage:
- const store = useTLStore({ snapshot: props.snapshot, shapeUtils: shapeUtilsWithDefaults })
+ const store = useTLStore({ assets: props.assets, snapshot: props.snapshot, shapeUtils: shapeUtilsWithDefaults })
Without it TldrawImage falls back to the inline base64 asset store, so drawings we render read-only (embeds and previews) can't resolve media stored in the user's vault.
That change is now open upstream as tldraw/tldraw#9697, which closes tldraw/tldraw#4603 — the original request, filed here by @jon-dez in 2024 with a working implementation, which the stale bot closed without it being picked up.
We're deliberately keeping the patch for now rather than blocking on the SDK review.
- Bump
tldraw in package.json to the first release containing the prop.
- Delete
patches/tldraw+5.2.5.patch.
- It's our only patch, so also drop
"postinstall": "patch-package" and the patch-package devDependency.
- Check the
assets prop is still passed wherever we render TldrawImage — upstream it is optional, so if it silently stops being forwarded, images just quietly disappear rather than erroring.
- Verify an embedded drawing that references a vault-stored image still renders it.
Step 5 is the one worth doing by hand. The e2e suite doesn't cover asset resolution, so nothing will fail if this regresses.
Depends on #212, which bumps tldraw to 5.2.5 and regenerates the patch under its current filename.
We carry a
patch-packagepatch against tldraw purely to add anassetsprop toTldrawImage:Without it
TldrawImagefalls back to the inline base64 asset store, so drawings we render read-only (embeds and previews) can't resolve media stored in the user's vault.That change is now open upstream as tldraw/tldraw#9697, which closes tldraw/tldraw#4603 — the original request, filed here by @jon-dez in 2024 with a working implementation, which the stale bot closed without it being picked up.
We're deliberately keeping the patch for now rather than blocking on the SDK review.
What to do once tldraw/tldraw#9697 is released
tldrawinpackage.jsonto the first release containing the prop.patches/tldraw+5.2.5.patch."postinstall": "patch-package"and thepatch-packagedevDependency.assetsprop is still passed wherever we renderTldrawImage— upstream it is optional, so if it silently stops being forwarded, images just quietly disappear rather than erroring.Step 5 is the one worth doing by hand. The e2e suite doesn't cover asset resolution, so nothing will fail if this regresses.
Depends on #212, which bumps tldraw to 5.2.5 and regenerates the patch under its current filename.