Originally published at deepu.tech.
Have you heard of Deno? If not you should check it out. Deno is a modern JavaScript/TypeScript runtime & s...
For further actions, you may consider blocking this person and/or reporting abuse
Been waiting for deno they said production on version 1 will be ready last january. hehe. just excited for this. anyway I have question about a npm package that is built purely in typescript. Can deno still used it as a library? thanks.
Well its Open source and as an open source maintainer I know first hand how schedules go. People are doing it on their free time so nothing is guaranteed.
It doesn't matter if a package is built in TS or JS, what matters is how the module is bundled. If its bundled as an ES module then it should work like the Lodash package I showed in sample. Also Deno is building a node compatibility module to support non ES npm modules
ohh. Its easy to migrate then by just changing tscofig. Thank you sir.
Anyway I watch the talk given by ryan dahl he said that "no, nodejs wont be compatible with deno" if he changed his mind this would be awesome. I can still use express.
I don't think its as easy as changing minds. NodeJs and Deno are built upon different architecture. The core module would be different and thus incompatible. Also, deno is supposed to use a different event-loop, with different kinds of stuff. Compatibility should be an issue here.
I don't think there is an issue with event loops, underneath its still V8 engine. The real issue is compatibility with existing nodeJS modules
Yup compatibility with node modules would be the issue. I was talking about event loops because the methods dependent on event loop in node might not be same as deno (of which I am not sure of) like process.nextTick or setImmediate. In that case compatibility might be issue. Basically if any underlying core packages change their API or its working its an compatibility issue.
After reading this, I feel I should definitely give it a try.
Try it, the experience is much nicer than Node
Unlike Coffescript, TS doesn't try to move sway from JS syntax and is backed by MS and Google who uses it extensively so its not gonna go away like CS. Also JS is taking inspiration from TS for features and since TS is syntax superset it would be easier to migrate to JS if required. Personally I don't think TS is going away any time soon.
There are no guarantees in life my friend, but I do know that coffeescript is so different from typescript. If you compare the syntax its much harder to start on coffeescript than typescript. I remembered when I was trying to learn both it took time to grasp coffeescript than typescript because of the way the syntax is implemented, while on typescript it was easy an hour of learning will get you going. I say this because I had the first hand experience on my onboarding at work we had to maintain a coffescript codebase it was a bit difficult.
Interesting to see how this pans out. I don't have enough experience with Node to form an opinion about this, but it's always nice to see different platforms moving the industry forward. Even if it doesn't end up being a success, it would definitely be great to see Node adopt the good parts of this.
That's what I like about TypeScript. Some of the really good things are being adopted by TC39 to go into the ES spec.
You are absolutely right
Thanks for sharing, well written. But I think that Deno is somthing to watch and try for now, but I won't bet on it, I would love to see it grow but it's risky, the sad part for me is "Migrating existing NodeJS apps will not be easy due to incompatible API".
I have a question on the url based module loading. If I would require to build a pure offline application how would I load the modules? Are they loaded at dev time and then bundled into a large js file? Would I have to store a local copy, which is then bundled? Or something totally different?
Deno team recommends creative a lib.ts file which imports all needed libs so that you can bundle it with the app and use it offline as well. See this deno.land/std/manual.md#linking-to...
Anything on editors/ide support ?
All typescript supported IDEs should work perfectly fine like VSCode, IntelliJ
I mean, when you do import from URLs (remote or local) does auto-completion works?
I don't think that works
For now yes, but they should come up with a way of loading definition files from the remote source especially in the VSCode plugin
For info, part of the Deno std library is a node polyfill which will allow npm modules to be run as part of deno. It's still in its infancy, but there is already support for some of the more common API functions in node. See more here: github.com/denoland/deno/tree/mast...
Yes and I hope it helps in Deno adoption
deno != node 😂
Indeed and I think the naming was intentional
Founder of Node == founder of Deno 😂
Excellent article! Thanks for sharing! :D
You are welcome and thank you
aaaand... Typescript team just shipped 3.8 with top level await
Cool
Very good article, thank you!! :)
You are welcome and thank you
Sweet! I've been waiting for this.
I hope Deno will succeed, thanks for the article.