Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] There is no "real" documentation for how to use Bebop on JS/TS #329

Closed
castarco opened this issue Apr 27, 2024 · 4 comments
Closed
Labels
enhancement New feature or request

Comments

@castarco
Copy link

castarco commented Apr 27, 2024

Is your feature request related to a problem? Please describe.

The current documentation for JS/TS/NodeJS only tells us how to install a couple of packages and compile Bebop definitions... but not how to integrate the generated code.

I guess there is a strong assumption that Bebop will be used only via Tempo, but there are other potential use cases, such as serializing/unserializing messages that go through "queues" such as Kafka.

Describe the solution you'd like

It would be nice having either a specification for the exposed objects & interfaces, or a short guide telling:

  • How to serialize a JS/TS object with Bebop
  • How to unserialize a Bebop bytes stream into a JS/TS object.

Describe alternatives you've considered

None, I really believe that the documentation is missing crucial information.

I also think that this might be one of the main reasons why Bebop usage is so low in the NodeJS ecosystem (the value proposition seems quite appealing, but very few people rely on it for JS/TS projects).

@castarco castarco added the enhancement New feature or request label Apr 27, 2024
@andrewmd5
Copy link
Contributor

andrewmd5 commented Apr 27, 2024

Thank you for opening this issue. Bebop is definitely meant to be used standalone, Tempo is mostly sugar.

In TS land it should be as simple as importing the generated class, then:

const data = new Person({
    name: "Spike Spiegel",
    age: 27
}).encode();


const person = Person.decode(data);

If you don't mind contributing, you can flesh out the documentation here. I can see the benefit of showing how to work with the various data types in TypeScript, such as showing how to determine what is inside a union via generated helpers. .

I'm currently in the hospital so I'm unable to do much work for the time being.

@castarco
Copy link
Author

Thank you @andrewmd5 , take care. I'll have a look into the documentation source code to see if I can push a PR.

Cheers.

@andrewmd5
Copy link
Contributor

@castarco first pass at this

894e720

@andrewmd5
Copy link
Contributor

This is implemented now https://docs.bebop.sh/guide/getting-started-typescript/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants