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

[FEATURE] Rewrite this client in TypeScript #269

Open
dblock opened this issue Jul 27, 2022 · 5 comments
Open

[FEATURE] Rewrite this client in TypeScript #269

dblock opened this issue Jul 27, 2022 · 5 comments

Comments

@dblock
Copy link
Member

dblock commented Jul 27, 2022

Is your feature request related to a problem?

Coming from #266 (comment), TypeScript bindings are maintained by hand. Development in pure JS is slower, potentially more error prone.

What solution would you like?

Rewrite the client in TypeScript, get rid of pure JS code.

@nhtruong
Copy link
Collaborator

nhtruong commented Jul 19, 2023

To assure that the rewrite does not affect existing users of the JS client, while capturing all features of this JS client in the TS client, I propose the following steps:

  1. Convert the current JS client into a TS client with minimal changes to the client code itself:
  • Create a dev branch called typescript-conversion from main. All PRs into main from there on must also be reflected in the typescript-conversion branch (This can't be done via backporting since, as you can see in the next steps, the file names and locations will diverge from main greatly).
  • Add a Typescript workflow to compile TS into JS
  • Rename all .js files to .ts files
  • Update Node JS release logic
  • Update Github Workflows if necessary
  • Finally merge typescript-conversion into main.
  1. Convert JS syntax into TS syntax for non-API functions/files

  2. Write a generator for API functions (We can manually convert a few API functions to TS first to have a better idea of what the generated functions would look like)

  3. Refactor the client to take full advantage of TS features (Note that the changes in step 2 are limited to the scope of each TS file that was previously renamed from JS)

@dblock @AMoo-Miki I'd love to have your input on this.

@nhtruong
Copy link
Collaborator

@timursaurus has already started the rewrote effort on his own repo. It gives us an idea of what the final product would look like. @timursaurus can also port a lot of his work from that repo into this, while other contributors can also make PRs to contribute to this effort.

@dblock
Copy link
Member Author

dblock commented Jul 20, 2023

@nhtruong This LGTM. I'd call the branch feature/typescript-conversion per convention with other repos.

@RealZacharyFowler
Copy link

Hello is someone currently working on this? It looks like there but I saw there is no one assigned to it.

@nhtruong
Copy link
Collaborator

nhtruong commented Oct 4, 2023

@RealZacharyFowler you're absolutely welcomed to chip in. No one has made any PR just yet. Though do note that this is a rewrite of the entire client. We're not just doing a 1-to-1 translation to TS. We're looking to make big improvements to get rid of glaring issues in the current JS clients WHILE maintaining backward compatibility (meaning users should not have to make next to no major changes on their applications when switching over to our new TS client). This means we will have to thoroughly study the current JS client to be able to rewrite it in TS.

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