Skip to content

Infer blob lexicon type as BlobRef instead of browser Blob#103

Merged
tylersayshi merged 1 commit into
tylersayshi:mainfrom
jphastings:blobs
Apr 25, 2026
Merged

Infer blob lexicon type as BlobRef instead of browser Blob#103
tylersayshi merged 1 commit into
tylersayshi:mainfrom
jphastings:blobs

Conversation

@jphastings

Copy link
Copy Markdown
Contributor

Hey @tylersayshi — I noticed that prototypey uses the browser's Blob type for blobs, which means that well-structured records with blobs don't meet the inferred type ({ $type, ref, mimeType, size } doesn't meet Blob).

This change replaces Blob type with a BlobRef type added (with @see references) which mirrors the type from @atproto/api/@atproto/lex-data (and, given how simple it is, I'd imagine elsewhere too).

I've called this a breaking change, but I'm not sure that the previous inference would have been useful to anyone.

Replaces the browser's `Blob` type with the correct type for Blob references over atproto.
I've defined a local `BlobRef` type (`{ $type, ref, mimeType, size }`) which mirrors the type from `@atproto/api`/`@atproto/lex-data`, without
adding either as a dependency.

@tylersayshi tylersayshi left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the fix! this lgtm 👍

@tylersayshi tylersayshi merged commit 8bf9b2b into tylersayshi:main Apr 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants