-
-
Notifications
You must be signed in to change notification settings - Fork 913
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
TypeScript rewrite? #334
Comments
It should be noted that the reason for this is to simplify support of ES modules in browsers and Node, not because TS is particularly well-suited to generating UUIDs per se. I'm typically not a fan of Typescript for OpenSource projects. It complicates the toolchain and makes projects less approachable. |
(opinion) type information has made my development more pleasant and proficient - but I also understand not wanting to take on the additional build step or barrier for other developers. Typescript has let me use one toolchain to build rather than collecting a bunch of babel plugins like I would need to do before. The API surface is the uuid module is sufficiently small and often "obvious" in a way that it itself won't benefit all that much. Like with most things - it is just preference. I've found that where I use to favor plain JS and no build step - that with new tooling the build "step" doesn't get in the way of my iteration. Practically - I don't consider my comment of porting to TS as something that would actually happen but threw it out there anyway - hopefully without it becoming a distraction to your work. |
Thanks! I still think that, given the broad adoption of TypeScript especially in application development, offering useful type definitions through For TypeScript users this should hopefully already provide most of the benefits. |
As a TypeScript user who uses the I'm also a big fan of using the TypeScript compiler in lieu of Babel even in pure JavaScript projects. TypeScript's inference is pretty great, so it can catch some errors even without any types. You can improve the quality of the checks by adding JSDoc formatted comments. |
Yes, having types included would be great. Also an important request - please make sure that |
Let's close this - I think this is covered by #328 |
OK, we'll first make sure to get the typings in order, see #328. Should not matter if the uuid code base itself is written in TypeScript or not as long as we provide useful typings. |
I know this was closed almost 2 years ago, but I wanted to see if there had been any change in thoughts around the TS rewrite? I think it would be an awesome step forward for developer experience using this library, as mentioned above. |
I personally love TypeScript, but still doesn't think that it's the right fit for this project. Since the codebase is so simple, I don't think that there is that much to be gained by switching to TS. If anything, I think that we should consider dropping both Babel & Rollup and only ship an ESM version in the next major version. All the currently supported versions of Node.js now supports ESM, and not having any build step at all I think is something that makes the setup even more simple, which makes the project more approachable for contributors! 🚀 |
Agree. |
I would caution against this since the ecosystem hasn't caught up to ESM, and publishing an ESM-only package as low-level as uuid can cause significant breakage in applications (in fact, you're unable to synchronously import ESM-only packages in CJS environments like node). If uuid does decide to move to ESM-only, I'd strongly recommend maintaining the current major version with features/bug fixes until ESM support is more wide spread. |
This may be true for nodejs.org's support matrix, but at this time we ( It's important to remember that the webpack and rollup builds were added to allow for CI testing (in both node and in the browser) which was one of the more important improvements to the stability and quality of this project. |
Yes, my comment was a bit off since we don't actually use rollup to produce the build, my bad. However, we currently ship three builds in the final package: CommonJS, ESM for Node, ESM for browsers. My proposal is to drop the CommonJS build, since e.g. IE 11 doesn't support CommonJS either. Not saying that there is any stress in doing this, just that it would be nice to do it the next time we release a major release/drop support for older versions of Node.js |
Coming exactly for this reason here. Personally, I don't see any disadvantage in using TypeScript, especially for relatively small projects. Incremental builds and webpack 5 caching are great for DX. I hope the time will come and all runtimes would support ts natively.
Well, then you support a very bad practice. You support data breaches. You delay support of ESM, because... ? This is the way. I hope you will change your mind. |
If that happens some day, that will be a really sad day. Future is optional types inside Javascript, when that day arrives, Typescript will be dead. |
Well, you would be happy with a mediocre subset re-implementation of great superset? Because ...? It's like IndexedDB instead of sqllite. That put people into depression. That produce wars. That kills kittens. That truly hurts. |
I've used both IndexedDB and SQLite, they serve for different purposses. Please learn to use a tool and why it works that way before critizise it without knowing, and go to troll elsewhere. |
This issue is closed because the current maintainers are not pursuing or entertaining this effort at this time. If someone wants to come along and move @types/uuid into this module via a PR or propose a typescript version that is up to them to consider contributing and then making the case for their new version over the status quo. |
@defunctzombie suggested in this comment that the node-uuid module could be re-written in TypeScript.
What would be the benefits of such a rewrite over modern JavaScript?
The text was updated successfully, but these errors were encountered: