Skip to content

Remove the TldrawImage assets patch once the SDK ships the prop #213

Description

@frolic

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.

What to do once tldraw/tldraw#9697 is released

  1. Bump tldraw in package.json to the first release containing the prop.
  2. Delete patches/tldraw+5.2.5.patch.
  3. It's our only patch, so also drop "postinstall": "patch-package" and the patch-package devDependency.
  4. 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.
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions