refute
protobuf-es
refute | protobuf-es | |
---|---|---|
3 | 7 | |
9 | 940 | |
- | 3.1% | |
5.9 | 9.2 | |
7 months ago | 5 days ago | |
TypeScript | TypeScript | |
MIT 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.
refute
-
Ramda: A practical functional library for JavaScript programmers
I find straight forward, dedicated combinators much more readable and practical to use ie. for iterables (context where it makes a lot of sense) [0] example [1], runtime assertions (through refutations, which are much faster than combinators over assertions) [2], parser combinators for smallish grammars [3] etc.
In many cases vanilla/imperative js is more readable and terse, no need to bring functional fanaticism everywhere, just in places where it gives true benefits and in form that can be understood by peers.
Functional code can be beautiful and can also be unreadable/undebugable. Same with imperative code. It's great in js/ts you can pick approach where the problem is expressed more naturally and mix it at will.
[0] https://github.com/preludejs/generator
[1] https://observablehq.com/@mirek/project-euler
[2] https://github.com/preludejs/refute
[3] https://github.com/preludejs/parser
-
Ask HN: Why isn't JSON-RPC more widely adopted?
We use jsonrpc over websockets in production for many years in trading services. It works very well. We use lightweight libraries that look like this [0] and this [1]. It's lightweight, fast, type safe, easy to maintain and debug etc.
[0] https://github.com/preludejs/jsonrpc
[1] https://github.com/preludejs/refute
-
An Inconsistent Truth: Next.js and Typesafety
Types can be asserted at runtime (parsed) at IO boundaries (reading http request or response, websocket message, parsing json file etc). Once they enter statically type system they don't need to be asserted again.
The difference it makes is illusion of type-safety vs type-safety this article touches on.
You can try to bind service with client somehow but in many cases this will fail in production as you can't guarantee paired versioning, due to normal situations by design of your architecture or temporary mid-deployment state or other team doing something they were not suppose to do etc. It's hard to avoid runtime parsing in general.
Functional combinators [0] or faster [1] with predicate/assert semantics work very well with typescript, which is very pleasant language to work with.
[0] https://github.com/appliedblockchain/assert-combinators
[1] https://github.com/preludejs/refute
protobuf-es
-
gut: convert golang structs to typescript interfaces
Yes, you can. You are mistaking protobuf with gRPC. See this for more information.
-
TypeScript type safety with GO
You can use this with connect: https://github.com/bufbuild/protobuf-es
-
Ask HN: Why isn't JSON-RPC more widely adopted?
Ah you should check out https://github.com/bufbuild/protobuf-es which feels great so far. Then there's connect by the same buf people but it has a grpc-web option https://connect.build/docs/web/getting-started/. The amount of code generated is also tiny, which I love.
-
Connect-Web: ergonomic Protobuf & gRPC for browsers
I'd recommend looking into protobuf-ts (Timo from Buf) or protobuf-es (Buf maintained).
-
Connect-Web: It's time for Protobuf/gRPC to be your first choice in the browser
Not sure if it is a magic bullet, but it was definitely written by TypeScript developers, for TypeScript developers.
The generated TypeScript code is already pretty minimal because all serialization ops are implemented with reflection instead of generated code (which is only marginally slower than generated code in JS).
But you can also switch to generating JavaScript + TypeScript declaration files, which is truly minimal: JavaScript is an entire dynamic language, so we actually only generated a small snippet of metadata in the .js output, and create a class at run time with a function call. The generated typings (.d.ts) give you type safety, autocompletion in the IDE, and so on.
You can see the output here: https://github.com/bufbuild/protobuf-es/blob/main/packages/p...
- Connect: A Better gRPC
What are some alternatives?
assert-combinators - Functional assertion combinators.
ts-proto - An idiomatic protobuf generator for TypeScript
next-rpc - makes exported functions from API routes accessible in the browser. Just import your API function and call it anywhere you want.
connect-go - Moved to https://github.com/connectrpc/connect-go
parser - String parser combinators
bloomrpc - Former GUI client for gRPC services. No longer maintained.
sick - Streams of Independent Constant Keys
protobuf-ts - Protobuf and RPC for TypeScript
gradual-typing-bib - A bibliography on Gradual Typing
grpcurl - Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers
connect-es - The TypeScript implementation of Connect: Protobuf RPC that works.
fetch - Fetch Standard