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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transition to vanilla javascript / ES Modules #13964
Comments
Hey @jimmywarting! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite. |
Just to clarify: are you asking to rewrite our source code to remove TypeScript/Flow, or are you asking to create a Babel plugin that transform TS code to JS+JSDoc? |
yes
no |
Important to note that they only did that for their internals, the "Deno standard library" is still TypeScript
For their internals or in general? If its the latter, could you provide some sources for that? |
@jimmywarting We don't plan to move away from TS. In fact, we plan to expand TS usage in our codebase even more (to replace the files where we currently use Flow, since a Flow+TS codebase is definitely suboptimal).
That's not true. We currently have some files using Flow, some using TS and some using JavaScript. Since we introduced TypeScript, our development experience has improved because thanks to the real-time type checks we need to check way less often what a function must be used. We have a huge internal API, so type checks help a lot.
Since TypeScript 4.5, their compatibility with the Node.js ESM behavior has improved by a significant factor. TypeScript 4.5 is still in pre-release, so you might have missed it!
We currently support Node.js 6, and in the future we will support only Node.js 12+. Both support less language features than the last TypeScript version, so removing the build step will force us to use way older features than what we can currently use with TS. Also, TypeScript implements most JS features when they are still not part of JS but when they are only Stage 3, so TS is moving ahead of the language.
I really like that proposal! And there are also a few similar proposals in the same problem space. However, migrating from TS to those proposals will be way easier than migrating from untyped JS to those proposals.
Luckily we know how to avoid those integration problems! 馃槃
We don't use a build step just for TS. TS support is a detail in our build process. We also:
You can see our full Babel config at https://github.com/babel/babel/blob/main/babel.config.js. I have never seen an issue proposing to convert a project from TS to uncompiled JS. It looks like both in Octokit (octokit/octokit.js#2128) and in Deno it was a decision taken independently by the project maintainers. I'm curious: are you using Babel in a way that our TS usages affects you? Or is this more like a matter of principle against TypeScript or against build steps? Btw, this is Babel: if it wasn't for build steps our project wouldn't exist. You are probably trying to convince the wrong people that they are worthless 馃槄 |
It's just a mater of principle... and i like buildless setup too. But don't get me wrong i use typescript also in a sense. Types are grate and i'm in favor of it. I just don't like to have to compile all the time and i don't like the typescript syntax either + you can't just copy/paste and have it run in any other place, i don't know if you have tried it but there is a
I would like if this wasn't closed right of the bat so we could hear what other ppl think of this (better yet: move this into a discussion) |
The comment I wrote is the opinion of the team, so there isn't much to add 馃し |
馃捇
What problem are you trying to solve?
When writing the entire source code in TypeScript/Flow, types are checked throughout the entire code. That can be helpful at times, but more often than not it results in unneeded code complexity and build errors that slow down the development and maintenance of the Babels source code. I estimate that the introduction of TypeScript/Flow slows down code develepoment by some factor cuz of compile time and others factors. I don't believe it saves time, you will just spend it more upfront.
Beside, we now want ship stuff with ESM. TypeScript have had a long time to adapt to ESM ever since node 12.17 but haven't adapted it's extension-less philosophy that it should some how magically just rely on node's path resolver to fix the resolver.
ESM + typescript just simply don't work good together due this mess. Sure you can smash in a
.js
extension inside of a.ts
file but this will just confuse the remote http-import thinking there is a js file somewhere when there isn't anyone.TypeScript gets few things wrong and it don't always support the latest features, They will always stand in the shadow of JavaScript and will always be one or more steps behind. They are now buried in thousands of issues and seems to have a hard time to keep up? At some point TypeScript could become totally obsolete and unnecessary when/if optional typing becomes a thing that we can use.
I have been along for the ride in 12 years and see many "compile X to JavaScript" languages come and go.
TypeScript will never become natively supported by the browser. So i always bet on JavaScript (or wasm).
Where do you think TypeScript will be in 5 years?
Benefits of removing TypeScript and switch to JavaScript:
Describe the solution you'd like
Rewrite the TypeScript source files into native JavaScript and add JSDoc, then generate d.ts files for typing
Describe alternatives you've considered
--
Documentation, Adoption, Migration Strategy
Add allowJs = true, switch switch everything slowly and steady to javascript with jsdoc
when publishing: generate d.ts files
The text was updated successfully, but these errors were encountered: