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

Converting pbf to typescript - Both the compiler and the output. #122

Closed
vicb opened this issue Jun 29, 2020 · 2 comments
Closed

Converting pbf to typescript - Both the compiler and the output. #122

vicb opened this issue Jun 29, 2020 · 2 comments

Comments

@vicb
Copy link

vicb commented Jun 29, 2020

I am interested in #107 that adds support for generating es6/typescript.

Also it seems like this repository would benefit from updates.

I would love to see the following happen:

  1. Convert the current pbf code to Typescript (same functionality),
  2. Update the compiler to generate Typescript code ONLY,
  3. Call the Typescript compiler programmatically to convert to ES6, common-js, ...

What do you think ?

/cc @mourner

@til-schneider
Copy link

  1. Convert the current pbf code to Typescript (same functionality)

This would certainly be a good idea.

  1. Update the compiler to generate Typescript code ONLY,
  2. Call the Typescript compiler programmatically to convert to ES6, common-js, ...

I don't think this is really necessary. In my pull request it only needs a few if statements around the parts which would add the type information into the generated code.

I would propose to keep it this way for the following reasons:

  • faster at runtime
  • less complexity as having to generate a temp file which is transpiled by TypeScript afterwards
  • less runtime dependencies (since TypeScript would only be a dev dependency)

@mourner
Copy link
Member

mourner commented Jun 30, 2020

  1. Convert the current pbf code to Typescript (same functionality)

Sorry but definitely not.

I am interested in #107 that adds support for generating es6/typescript.

Definitely planning on bringing that in though — let's keep the discussion there.

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

No branches or pull requests

3 participants