Repository navigation
feat: serializer behaviour and vsn 2.0.0 binary framing - #43
Merged
Merged
Conversation
zoedsoupe
force-pushed
the
feat/rt-serializer-vsn2
branch
from
October 16, 2026 22:04
6377106 to
bcdd8e1
Compare
zoedsoupe
force-pushed
the
feat/rt-serializer-vsn2
branch
from
October 16, 2026 22:22
fd23c5a to
7e25b4a
Compare
Merged
zoedsoupe
added a commit
that referenced
this pull request
Oct 19, 2026
🚀 Want to release this? --- ## [0.6.0](v0.5.0...v0.6.0) (2026-10-16) ### Features * filter builder, select, heartbeat telemetry and presence fixes ([#44](#44)) ([6fa0dae](6fa0dae)) * rejoin backoff, duplicate binding dedup and aligned binding ids ([#46](#46)) ([ce458d9](ce458d9)) * serializer behaviour and vsn 2.0.0 binary framing ([#43](#43)) ([3aec1d6](3aec1d6)) ### Bug Fixes * realtime protocol correctness (join, ack, heartbeat, tls) ([#42](#42)) ([73548ac](73548ac)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Message serialization was hardcoded:
vsnwas fixed at1.0.0and every frame was JSON. There was no seam to override encode/decode, and no support for vsn 2.0.0, which the server and realtime-js use (array JSON plus a binary framing for user broadcasts that saves bandwidth).Solution
Add a
Supabase.Realtime.Serializerbehaviour with two implementations:V1(JSON objects, the default) andV2(array JSON plus kind-3/kind-4 binary user-broadcast framing). The Connection resolves the serializer at init, puts the negotiatedvsnin the websocket query string (authoritative over:params), and routes both text and binary frames through it. A custom module can be supplied with:serializer.Rationale
The behaviour is the extension point the gap list asked for: any module implementing it replaces both encode and decode, so no separate hook options are needed.
V2matches the realtime-jsserializer.tsand the server'sV2Serializerbyte for byte, including UTF-8 byte-length prefixes and the 255-byte field guards. The default stays1.0.0so existing users see no change;2.0.0is opt-in.