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

Migrating to Typescript #24

Open
alvitoraidhy opened this issue Mar 25, 2023 · 5 comments
Open

Migrating to Typescript #24

alvitoraidhy opened this issue Mar 25, 2023 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@alvitoraidhy
Copy link

Any plan or interest in migrating the codebase to Typescript? I think it would be more manageable in the long run compared to managing separate d.ts files.

@atoppi
Copy link
Member

atoppi commented Mar 27, 2023

What are the benefits of migrating to TS in your opinion?

Basically I'm concerned about the absence of native support in node, so code will need compiling.
I use compiled languages a lot, so I know that leads to:

  • more difficult debugging
  • difference between what is written and what is executed
  • the dependency on a build-chain
    etc.

@alvitoraidhy
Copy link
Author

alvitoraidhy commented Mar 28, 2023

With Typescript the package from npm would come with typings (*.d.ts files) without having to maintain them separately. Moreover you won't really need to type using jsdoc if you use Typescript and the TS compiler will ensure the source code is free from syntax errors.

While I do understand the cons that you described, I have only experienced point 3 out of all of them in my time of using TS for development.

@atoppi
Copy link
Member

atoppi commented Mar 29, 2023

I am still not convinced, but I have to admit I've never managed a TS project before.
Pinging @augustblack (author of #5) since he might have something to add to the discussion here.

@augustblack
Copy link
Contributor

Hi,

I understand some of the concerns you mention @atoppi . Adding an extra step in the build chain can be adding another place of failure, another source of friction for initial onboarding, etc.

I'm not sure why you think it is more difficult debugging. Perhaps one main benefit is the addition of types to help narrow down potential bugs.

Personally, I moved to TS years ago since I find the advantages outweigh the disadvantages. Newer runtimes like bun and deno can also ingest TS directly.

I'd also prefer janode in TS.

@atoppi
Copy link
Member

atoppi commented Apr 3, 2023

I'm not sure why you think it is more difficult debugging. Perhaps one main benefit is the addition of types to help narrow down potential bugs

I am not referring to static analysis.
As far as I understand TS will not help at runtime and I am referring exactly to those kind of issues.
A crash might happen on an instance, then the mapping files will point to the TS section that made the code crash, but since the code is transpiled from TS to JS, we don't know what the actual executed JS was.
The specific env of the compiler might trigger a problem that in other scenarios is not occurring since the transpiled JS could not be the same.

Maybe I am worrying too much and that is a false problem, I don't know, as I said I don't have experience in managing TS projects.

Anyway I have understood that users really care about type definitions and I will definitely tackle this sooner or later, maybe by working on #5 or migrating the whole project to TS.
Honestly, according to my personal roadmap, a VideoRoom plugin fully supporting multistream has the highest priority now, so I guess that will definetely come first.

@atoppi atoppi added the help wanted Extra attention is needed label Jan 31, 2024
@augustblack augustblack mentioned this issue Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants