Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode and decode protobuf messages #160

Open
bajtos opened this issue Mar 29, 2023 · 1 comment
Open

Encode and decode protobuf messages #160

bajtos opened this issue Mar 29, 2023 · 1 comment
Assignees
Labels
feature New feature or request

Comments

@bajtos
Copy link
Member

bajtos commented Mar 29, 2023

Many peer-to-peer protocols serialise request and response payload using Protocol Buffers (https://protobuf.dev), for example libp2p Identify.

Zinnia should provide a recommended best practice for creating requests and parsing responses in protobuf format.

We can recommend one of the existing JS/TS implementations like protobuf.js or protobuf-ts.

Note that Zinnia does not support ES Modules yet, see #43, so module builders would have to use a bundler like esbuild to bundle their module code + all dependencies into a single JS file for Zinnia.

Another option is to provide custom Zinnia API for encoding & decoding Protobuf messages. We can start with a low-level API to encode/decode raw messages with no .proto definitions needed and then build on top of that.

Considering our limited capacity, I think it's better to leverage an existing 3rd-party implementation and focus our effort on optimising DX of using those libraries in Zinnia.

@bajtos bajtos added the feature New feature or request label Mar 29, 2023
@juliangruber
Copy link
Member

+1 for recommending protobuf.js + bundler for now, and not making it a platform feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: 🧊 icebox
Development

No branches or pull requests

2 participants