pbf
protoc-gen-validate
Our great sponsors
pbf | protoc-gen-validate | |
---|---|---|
4 | 6 | |
763 | 3,642 | |
0.9% | 1.3% | |
0.0 | 8.0 | |
over 1 year ago | 4 days ago | |
JavaScript | Go | |
BSD 3-clause "New" or "Revised" License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pbf
-
Parquet-WASM: Rust-based WebAssembly bindings to read and write Parquet data
it's been about 3 years, but in Grafana at the time we were using something like ArrowJS + Arrow Flight + protobuf.js and then render the datasets into dashboards on Canvas, especially for streaming at ~20hz.
when i benchmarked the fastest lib to simply convert the protobuf decode (https://github.com/mapbox/pbf), it was 5x slower than native JSON parsing in browsers for dataframe-like structures (e.g. a few dozen 2k-long arrays of floats).
-
Outperform Protobuf.js with fixed-size encoding
does it beat https://github.com/mapbox/pbf ?
-
Protobuf-ES: The Protocol Buffers TypeScript/JavaScript runtime we all deserve
at least in the frontend (without WASM), it depends.
i tested https://github.com/mapbox/pbf and while it was faster for deep/complex structs vs an unoptimized/repetative JSON blob, it was slower at shallow structs and flat arrays of stuff. if you spend a bit of time encode stuff as flat arrays to avoid mem alloc, JSON parsing wins by a lot since it goes through highly optimized C or assembly, while decoding protobuf in the JIT does not.
-
A standalone protobuf to typescript(for deno) code generator
The runtime is taken from mapbox/pbf (with basic type definitions)
protoc-gen-validate
- Protobuf Schema Validation
-
Protobuf-ES: The Protocol Buffers TypeScript/JavaScript runtime we all deserve
My understanding is that the powers that be within Google have decided that validating messages is outside the scope of schemas and serialization. protoc-gen-validate provides a portable way to perform validation: https://github.com/bufbuild/protoc-gen-validate
The problem with required fields is it kicks the can down the road when you want to deprecate a field. Keeping everything optional is much, much better for everyone in the long run.
-
Why isn't gRPC used more for browser to api transport over REST / graphql?
I built a (go) very rough draft to support 3.1 + a json pointer pkg to support a refactor that was in progress before I bailed on the idea. The amount of effort to get a conventional API was dwarfing that of grpc, especially with protoc-gen-validate.
- Protoc-Gen-Validate (PGV)
-
is there any package to generate validation code for struct instead of using reflect (tags)?
Yes, I am currently using this. I prefer something like this https://github.com/envoyproxy/protoc-gen-validate
-
sneak peak: code generation extensions to prost (protobuf code generator)
We've been using Rust with protobuf, but had to write lots of conversions from protobuf struct to actual DTO, since prost generates Options for nested types, and does not really support custom types. So I extended prost with the options that we needed. I might aim to also support protoc-gen-validate.
What are some alternatives?
protobuf - Protocol Buffers for JavaScript (& TypeScript).
buf - The best way of working with Protocol Buffers.
sia - Sia - Binary serialisation and deserialisation
prototool - Your Swiss Army Knife for Protocol Buffers
deno-pbf - Deno pbf port of https://github.com/mapbox/pbf
prost - PROST! a Protocol Buffers implementation for the Rust Language
osm - Open Service Mesh (OSM) is a lightweight, extensible, cloud native service mesh that allows users to uniformly manage, secure, and get out-of-the-box observability features for highly dynamic microservice environments.
ozzo-validation - An idiomatic Go (golang) validation package. Supports configurable and extensible validation rules (validators) using normal language constructs instead of error-prone struct tags.
fast-encoding - Fast, cross-platform, small and easy-to-use base64 and hex encoding.
grpc-web - gRPC Web implementation for Golang and TypeScript
img-encode - Encode an image to sound and view it as a spectrogram - turn your images into music
protolock - Protocol Buffer companion tool. Track your .proto files and prevent changes to messages and services which impact API compatibility.