Skip to content

Protobuf support #7632

@rynop

Description

@rynop

Describe the solution you'd like

Protobuf based frameworks like gRPC and Twirp (made by Twitch) are very popular because of the efficiencies gained in front->backend handshake clarity, straightforward for teams of devs to understand and manage, and size of payload over the wire (extra appealing to mobile).

Ultimately the solution I'd like is to send protobuf (binary) from the NS HTTP Framework module and be able to receive a protobuf (binary) response.

My hope is the market trend towards protobuf based technologies will give further motivation to supporting sending and receiving these (small) binary payloads.

Describe alternatives you've considered

Writing protobuf to then filesystem then sending via nativescript-background-http in the background. Not only is this super messy, it is very error prone (and hard to recover from). Not good for the mission critical path of your app interfacing with backend.

Questions for starting discussion

I know there are a few outstanding issues (see below) around supporting binary, my hope is this issue can bring them together with a solid use case (Protobuf).

  1. Support to accept gzip (binary) incoming payloads was added here. Can this methodology be used to accept application/protobuf?
  2. protobuf.js is rock solid and works in node and browser. What are the specific technical road blocks preventing it from being used in NS? In searching and looking at code I can't tell what they are (I'm green to native dev).

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions