-
Notifications
You must be signed in to change notification settings - Fork 3
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
should we use typescript in more modules ? #7
Comments
There are some existing TS modules such as https://github.com/PrismarineJS/mineflayer-collectblock though |
Let's vote here. Should we try to convert some modules to typescript, for example prismarine-block and prismarine-item ? |
The only point I've seen against TS is the following:
This isn't true. You can use any package structure that JS can. TS is just a superset of JS features that, when compiled, is compatible with JS.
This. This. And this. If you haven't tried TS yet and have been using only vanilla JS, spend a day using it. It changes nothing, yet it changes everything. I would wax lyrical for hours about how much better TS is than JS, but I don't think that's particularly productive in this context. But yea. Compile-time errors are just better than runtime errors. And it's not hard to use TS. And it's hard not to use TS. |
Please send one project using typescript that does not look like a java project |
How is that an argument against TS? Having a well-structured project hardly seems like a negative to me. But if you insist: |
We are doing a project structure in PrismarineJS that is very different from the java style. That is on purpose and has been working pretty well. This is important to take into account when choosing technology for PrismarineJS |
https://github.com/ethereum/eip-review-bot looks ok but it has no doc nor example so it cannot be used as is |
Oh, you mean that. That's entirely possible with TS, but is just not the way it's usually done. There's no reason why it can't be done.
I'd be very surprised if any of the code from that project of mine would make it into PrismarineJS. |
Does that full TS flying squid fork look like Java project? Also p web client along with the p viewer inside is using ts efficiently. It wasn't big effort to add it to p viewer since ts plays nice with classes but allowed me to catch many bugs |
That makes sense. I was just commenting on the fact that this may not be the best example of a TS project |
This one is a direct translation to TS so no, the structure seems fine. |
FWIW I'm currently converting prismarine-auth to typescript. In the process of converting, typescript threw an error that directly pointed to a bug, which I was able to immediately fix. This has happened twice so far. If the project had been TS from the beginning, those bugs wouldn't have ever existed!!!! |
I just saw the following points. I'd like to quickly discuss:
The point of TS is that it doesn't affect the code at all.
This could be considered to be true for inexperienced contributors unfamilliar with TS syntax. However, it significantly decreases complexity for downstream users AND decreases complexity for more experienced contributors. |
so why make it harder for new contributors to help with the project. Having yet another layer of learning Typescript isn’t going to help. The only different will be that some users who know typescript will have a bit better contribution experience. This doesn’t say i hate typescript, in fact i like it and uses it regularly. I don’t think its good to have 2 types of languages for 1 “project”. Using more typescript will eventually split the project in 2. Typescript can be a good option but only if we fully switch to it in all repository’s |
Sorry to be terse, but -- did you actually read my comment? I explicitly said: "However, it significantly decreases complexity for downstream users AND decreases complexity for more experienced contributors."
I agree in one sense - I would rather that prismarine use 100% typescript. However, I disagree that this will cause fragmentation. TS and JS are interoperable. |
I agree that typescript is better and probably better for documentation but having 2 different languages is still weird. I know that JS and TS can be used together but I think a 100% or 0% is better. https://youtu.be/5ChkQKUzDCs?si=Kb2Nd8KoulTGVGlS I think this video explains it better than i do |
I've seen that video. But the crucial thing is that turbo is still keeping its |
@rom1504 what do you think about this? |
This has been discussed many times and the consensus is NO:
The text was updated successfully, but these errors were encountered: