protobufjs/protobuf.js

Project health?

timosaikkonen opened this issue · 5 comments

There are 507 open issues and 127 PRs and the last commit in master is from August. Looks like issues and PRs have gone without attention from the maintainers since then. I'm certainly no stranger to having no time to do, well, anything, so no judgment here. Would just like to hear if the maintainers are still alive and if there are any plans for the future of this project.

Hi @timosaikkonen! The owner of the project is @dcodeIO so please direct all ownership related questions to him.

@bcoe and I work for Google Cloud client libraries (which use protobuf.js) and we spend some time maintaining the repository, sending some fixes or features. We try to keep up on project health in terms of fixing critical problems and making sure that all reported vulnerabilities are fixed soon enough, but I cannot commit more than just a few hours per month on doing it - so doing whatever I can here.

If there's anything that you (or anyone else) need to get merged and it's a small fix (non-breaking and not a huge refactor), I'll be happy to spend my Friday afternoon reviewing and merging it. For anything that requires immediate attention, don't hesitate to ping me by email (my last name at google dot com). I'm not great in responding to GitHub notifications, which I do receive a lot (well illustrated by the 3 weeks response time to this issue :) ) so sorry if you feel there's no one here - we are here, just not fulltime.

@alexander-fenster Thanks for responding!

Totally understand the situation and the pain of competing priorities.

I think the major issue for me and many other is the lack of support for well-known types such as StringValue, Struct etc. There's quite a few issues and PRs open with a lot of comments and pings (#1042, #839, #677, #1271, #929, ...) some dating back to 2017. So as far as my specific concerns go, it would be nice to have some kind of plan to sort that out.

CC: @dcodeIO @bcoe

@timosaikkonen For well-known types support, take a look at proto3-json-serializer NPM module that I wrote a couple years ago after figuring out that supporting spec-compliant proto3 JSON is probably easier to implement externally rather than by making big changes here. The serializer library will convert from a valid JSON to your schema and back, including the wrapper types (google.protobuf.Struct and its descendants). The price you pay for that is a recursive traversing of your object, but we use it in our (Google Cloud) libraries without problems so far.

I was concerned about this projects health, so I was seeking an alternative to protobufjs. I stumbled upon protobuf-ts.
https://www.npmjs.com/package/@protobuf-ts/plugin

Some advantages that I discovered are....

  1. It uses protoc, so it supports more proto3 features (e.g. proto3 optional fields)
  2. It is fairly easy to get started because the author maintains an install script for protoc.
  3. The typescript is a bit more verbose, but generates much safer and more idiomatic typescript type definitions. These diverge somewhat from the protobuf JSON representation, but that was necessary for type safety and you can still convert protobuf JSON into a protobuf-ts object if necessary.

I also was having issues with protobufjs enums. I didn't have to hack the files to get enums to work in typescript.

I hope this is useful to someone like me looking for an alternative.

Speaking about well supported alternatives, for a new project not concerned about compatibility with the existing code base, I would suggest looking at https://buf.build. Those folks support TypeScript natively and the project is alive. They have their own idea of how to represent various protobuf features (such as oneofs, enums, and bytes fields) internally, which will make it very hard to migrate if you decide to do so, but it should not be a concern for new projects.

[disclaimer: I'm not affiliated with their project in any way, this is the result of my own investigation of the area]