Giter Site home page Giter Site logo

Comments (6)

stephenh avatar stephenh commented on May 22, 2024

Wow @linarkou sorry for taking awhile to get back to you, but I'd heard not about this. This seems like a huge deal. proto3 missing optional was a huge complaint I had with it...

I'm still reading the impl details, i.e. about the synthetic oneof approach, but, yes, I think its really reasonable for ts-proto to support this "new" :-) optional.

from ts-proto.

stephenh avatar stephenh commented on May 22, 2024

@linarkou let me know if you're interesting in hacking on this, would be great to have a PR. Otherwise it's a great feature, so I'll get around to hacking on it at some point.

from ts-proto.

linarkou avatar linarkou commented on May 22, 2024

@stephenh I'm new in typescript, so I think I can't help you, sorry(

from ts-proto.

cliedeman avatar cliedeman commented on May 22, 2024

This probably needs protobufjs support. protobufjs/protobuf.js#1406

from ts-proto.

stephenh avatar stephenh commented on May 22, 2024

@cliedeman I could be wrong, but fwiw I don't think so. ts-proto calls the lower-level reader/write APIs in protobuf.js's Reader/Writer classes but otherwise drives the encode/decode process itself, and from my initial read of the spec where "field presence is something something oneofs" (...would have to read it again...) I'm ~80% sure just some changes to ts-proto's generated encode/decode methods could handle this.

from ts-proto.

stephenh avatar stephenh commented on May 22, 2024

@linarkou @cliedeman I've added supported for this in v1.32.0; I haven't updated the readme yet, but you'll have to use the protoc experimental flag mentioned in their docs. Please report any bugs if you try it and find anything wrong. Thanks!

from ts-proto.

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.