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

Migrate code base to typescript #686

Closed
owenpearson opened this issue Oct 5, 2020 · 5 comments · Fixed by #762
Closed

Migrate code base to typescript #686

owenpearson opened this issue Oct 5, 2020 · 5 comments · Fixed by #762
Assignees
Labels
enhancement New feature or improved functionality.

Comments

@owenpearson
Copy link
Member

owenpearson commented Oct 5, 2020

Using typescript with strict type-checking will allow us to enforce better type safety in the project and will allow us to emit type definition files as part of the compile process rather than having to maintain them ourselves.

┆Issue is synchronized with this Jira Story by Unito

@owenpearson owenpearson added the enhancement New feature or improved functionality. label Oct 5, 2020
@sacOO7
Copy link
Collaborator

sacOO7 commented Oct 6, 2020

I think the ts-node should allow transpilation of typescript along with ES6 code to browser compliant es5 code. Maybe it internally uses a build tool ( like babel ). We might not have to explicitly specify the tool (#687). tsc wiill take care of build ( might have to provide config file in cases of advanced build)

@owenpearson
Copy link
Member Author

@sacOO7 That makes sense to me. I don't think I've ever used Typescript as a transpiler (I'm used to working in React projects where Babel is necessary to transform JSX anyway) but if we can get by without depending on Babel at all then I'm all for it 👍

@sacOO7
Copy link
Collaborator

sacOO7 commented Oct 9, 2020

Yes, we might not have to rely on babel.
Btw, let me know once the team is up for discussion regarding the transition to typescript. I would like to share some of my views ( maybe I can post it async over chat). Typescript is a very widely discussed topic among the community and I know some of the folks who recommend and don't recommend it ( All depends on the project context and requirement haha)

Personally, I would always go with +1 for typescript. It works like charm in single-threaded env. like browser 🥇

@owenpearson owenpearson mentioned this issue Nov 16, 2020
@ably-sync-bot ably-sync-bot changed the title Use typescript Migrate code base to typescript Apr 13, 2021
@ably-sync-bot
Copy link

➤ Owen Pearson commented:

Issue split into:

SDK-694Set up initial typescript toolchain

@jimmywarting
Copy link

jimmywarting commented Nov 9, 2021

please don't migrate to typescript. It's possible to have strict type checking without the need of typescript syntax and extra compile overhead if you just use JSDoc. Beside ESM and typescript don't work well together right now...

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

Successfully merging a pull request may close this issue.

4 participants