Git Product home page Git Product logo

Comments (5)

timosaikkonen avatar timosaikkonen commented on August 26, 2024 2

@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

from protobuf.js.

alexander-fenster avatar alexander-fenster commented on August 26, 2024 2

@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.

from protobuf.js.

alexander-fenster avatar alexander-fenster commented on August 26, 2024 1

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.

from protobuf.js.

jolting avatar jolting commented on August 26, 2024

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.

from protobuf.js.

alexander-fenster avatar alexander-fenster commented on August 26, 2024

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]

from protobuf.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.