TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Big changes ahead for Deno

443 pointsby 0xedbalmost 3 years ago

36 comments

hjanssenalmost 3 years ago
Not sure if Bun has had an influence on this, these features must have been in development for a long time, but the timing surely is impeccable.<p>npm compatibility is <i>huge</i> for Deno. It is basically the one major drawback to Deno, which gets hopefully fixed with this feature. It also looks like this compatibility layer is implemented transparently in the existing module management, which is a big bonus. Nobody wants to deal with node_modules anymore when working with Deno for an extended period, just love to see this.
评论 #32469267 未加载
评论 #32471642 未加载
评论 #32469542 未加载
评论 #32469413 未加载
评论 #32472324 未加载
评论 #32471306 未加载
评论 #32471677 未加载
评论 #32471621 未加载
评论 #32469115 未加载
评论 #32472390 未加载
评论 #32472091 未加载
评论 #32469716 未加载
评论 #32472585 未加载
afavouralmost 3 years ago
I&#x27;m actually a little disappointed by NPM compatibility. Or at least conflicted. Deno has felt like an opportunity to reboot the server-side JS ecosystem into something far more sensible than it currently is. Not that anyone is to blame for what it is, really, but you learn lessons and move forward. Sometimes making breaking changes.<p>This seems like an acceptance that moving on simply won&#x27;t happen. The existing ecosystem is too big and too powerful to be ignored. If I were a particularly cynical person I&#x27;d also point to Deno taking on millions in VC funding - once you&#x27;ve done that you can&#x27;t be content to create a perfect, gleaming sandbox. You have to bring in money.
评论 #32470723 未加载
评论 #32470689 未加载
评论 #32471273 未加载
chrismorganalmost 3 years ago
As a non-user of Deno, I’m curious, how do people tend to manage dependency version centralisation in Deno? I suppose this will apply to existing Deno as well as npm imports. I can just see you ending up having to change “import express from &quot;npm:express@5&quot;;” from 5 to 6 in lots of places when the next major version comes out.<p>When contemplating how <i>I</i> might do it, I came up with centralised reexport, a file deps.ts containing:<p><pre><code> export express from &quot;npm:express@5&quot;; </code></pre> This would basically stand in for the dependencies object in package.json.<p>So then I looked up the docs and found <a href="https:&#x2F;&#x2F;deno.land&#x2F;manual&#x2F;linking_to_external_code#it-seems-unwieldy-to-import-urls-everywhere" rel="nofollow">https:&#x2F;&#x2F;deno.land&#x2F;manual&#x2F;linking_to_external_code#it-seems-u...</a> and was amused to find the same solution, even down to the file name “deps.ts”!<p>Is this how people tend to work with Deno?<p>I see it also supports import maps, <a href="https:&#x2F;&#x2F;deno.land&#x2F;manual&#x2F;linking_to_external_code&#x2F;import_maps" rel="nofollow">https:&#x2F;&#x2F;deno.land&#x2F;manual&#x2F;linking_to_external_code&#x2F;import_map...</a>, which could readily solve the problem too. Do people use that?
评论 #32469280 未加载
评论 #32469131 未加载
hardwaregeekalmost 3 years ago
This isn&#x27;t entirely fair to Deno but it always amazes me how people start out with &quot;we don&#x27;t need packages! Just do direct imports&quot; and eventually end up with &quot;okay fine fine here&#x27;s a package manager&quot;. Packages are great! Don&#x27;t dismiss them just because in edgecases they&#x27;re bad.<p>In fairness, the two examples, Deno and Go, are successful projects, so maybe it&#x27;s not a bad initial strategy.
评论 #32472552 未加载
评论 #32472130 未加载
评论 #32472499 未加载
valtismalmost 3 years ago
Wow, very interested in an npm compatible Deno! I think that will remove a huge barrier to entry for Deno and could mark a huge shift towards usage in production.<p>I&#x27;m very interested in how packages will manage runtime support in the future. Right now we are seeing an explosion of JavaScript runtimes from Cloudflare Workers to Bun, all with sightly different APIs. I wonder if there will be an easy way to get cross-runtime support without it being much extra work for library authors.<p>Right now, there has already been conflict with some packages being browser-only and some being node-only. I feel like there needs to be a better solution than the one we have now.
评论 #32473942 未加载
评论 #32468881 未加载
评论 #32469246 未加载
maxpertalmost 3 years ago
So we&#x27;ve come full circle. From the talk of author on how &quot;NPM was a big mistake&quot;, to &quot;Nobody is adopting it, we will die without the NPM ecosystem&quot;. I was hoping that Deno will spin off into something that can be compiled due to type system hints into something more optimized than JS, but seems like I was just living in dystopian utopia.
评论 #32483494 未加载
评论 #32471337 未加载
wokwokwokalmost 3 years ago
&gt; import express from &quot;npm:express@5&quot;;<p>&gt; There will be no node_modules folder, no npm install; the packages will be automatically downloaded in the Deno cache.<p>My understanding of deno&#x27;s package system (see <a href="https:&#x2F;&#x2F;deno.land&#x2F;manual&#x2F;linking_to_external_code#it-seems-unwieldy-to-import-urls-everywhere" rel="nofollow">https:&#x2F;&#x2F;deno.land&#x2F;manual&#x2F;linking_to_external_code#it-seems-u...</a>), is that basically, at compile time it will go and fetch external URLs and cache those files locally. So this change basically makes it so your import:<p>&gt; import { assert } from &quot;<a href="https:&#x2F;&#x2F;deno.land&#x2F;std@0.152.0&#x2F;testing&#x2F;asserts.ts&quot;;" rel="nofollow">https:&#x2F;&#x2F;deno.land&#x2F;std@0.152.0&#x2F;testing&#x2F;asserts.ts&quot;;</a><p>Is magically generated from npm when you do this instead:<p>&gt; import { assert } from &quot;npm:testing@2.0.1&quot;;<p>Ok cool. Whatever.<p>...surely this isn&#x27;t the actual problem?<p>There seem to be certain pretty fundamental problems:<p>- not all npm packages are typescript<p>- a package is not just an &#x27;assert.ts&#x27; file, it&#x27;s often an amalgamation (eg. using rollup)<p>- a package often has many dependencies<p>- a package may use the node API, that deno doesn&#x27;t have (it has a more-or-less compatibility mode, see &#x27;differences that cannot be overcome&#x27; -&gt; <a href="https:&#x2F;&#x2F;deno.land&#x2F;manual&#x2F;node" rel="nofollow">https:&#x2F;&#x2F;deno.land&#x2F;manual&#x2F;node</a>)<p>So bluntly, how on earth is this going to work?<p>I mean, I&#x27;m a fan, the folk working on Deno are smart and motivated, and if it works, I&#x27;m more &#x27;wow&#x27; than &#x27;I don&#x27;t believe it&#x27;... but I&#x27;m very surprised to see:<p>&gt; the vast majority of npm packages work in Deno within the next three months<p>That seems... ambitious.<p>I can&#x27;t see how the approach is really sustainable, given that basically, it means &#x27;anything node supports we have to support to&#x27;; doesn&#x27;t that mean you&#x27;re forever playing catchup and &#x27;doesn&#x27;t quite work&#x27;?<p>How is vendoring going to work <i>without</i> a package lock file? Doesn&#x27;t this just mean you&#x27;ve reimplemented npm and you&#x27;ll forever be playing catchup to the various npm features that are required to make packages work?
评论 #32471929 未加载
评论 #32470569 未加载
评论 #32472643 未加载
brundolfalmost 3 years ago
The NPM thing is a huuuuge deal. This has been by far the biggest thing holding Deno back, but it was tough because one of Deno&#x27;s most exciting <i>benefits</i> was standardizing the module system and ditching NPM. It looks like they may have found a best-of-both-worlds solution for shoehorning NPM&#x27;s massive ecosystem into Deno while it&#x27;s still building out its own. Big changes indeed.<p>That, and the emphasis on speed (esp quotes like &quot;We aren&#x27;t optimizing for a handful of edge cases, but for overall real world performance&quot;) makes me wonder if Bun is lighting a fire under them a bit. It&#x27;s still a long way from catching up, but it&#x27;s been closing the gap at a blistering pace and getting enormous amounts of hype. The more competition the better.<p>Exciting times
timmgalmost 3 years ago
This might sound odd, but: one thing I&#x27;ve wanted to do is use the Typescript compiler without using NPM. (I&#x27;m not smart enough to know why I hate NPM. I just want a tool that compiles TS.)<p>It almost sounds like I could write a self-contained deno command-line &quot;app&quot; that does this. Does that seem right (for those that know better)?
评论 #32470276 未加载
评论 #32469216 未加载
评论 #32471324 未加载
AbraKdabraalmost 3 years ago
I&#x27;ve been using Deno in production at work for a while, and NPM compatibility is the one thing dragging me back to Node, some packages like Elasticsearch simply won&#x27;t work in Deno, if they solve that I&#x27;ll be throwing a party for all HN where we collectively remove Node from all my development workspaces.
andrew_almost 3 years ago
&gt; We&#x27;ve been working on some updates that will allow Deno to easily import npm packages and make the vast majority of npm packages work in Deno within the next three months.<p>This is really huge and will be a huge boost to the Deno ecosystem. On the other hand, I quite enjoyed that it wasn&#x27;t jacked into NPM. There were reasonable alternatives like <a href="https:&#x2F;&#x2F;jspm.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jspm.org&#x2F;</a>. This is a big swing at Node and I&#x27;ll be watching with maximum curiosity.<p>As an aside, the only thing preventing me from adopting Deno as my daily driver has been the lack of AWS Lambda support (requiring a lambda layer, slowing down cold starts). Would be great if they could leverage connections and advocate for native AWS support.
评论 #32469697 未加载
lukevpalmost 3 years ago
Demo is awesome, and the npm compatibility is a game changer. Isn’t this the 3rd http server rewrite in less than a year though? They didn’t mention it being backwards compatible. I guess they needed to change the underlying server to support features in Fresh. This is one downside of the team making the core platform as well as many of the main components of the ecosystem… they can evolve the runtime to suit their vision even if it affects competitor’s implementations.
评论 #32470811 未加载
buzzwordsalmost 3 years ago
I have a limited experience using NodeJs. My first interaction with Node was unpleasant. The whole npm world seemed very insecure and very wide wide west like, thinking back I can&#x27;t remember why I felt that now. I know the article said some would like to get away from the npm. For those who still would like to use npm with Deno, I would love to know why. (I&#x27;m genuinely curious, not looking to start a flame war)
nitskyalmost 3 years ago
Will Deno’s approach to NPM compatibility support peer dependencies? <a href="https:&#x2F;&#x2F;nodejs.org&#x2F;en&#x2F;blog&#x2F;npm&#x2F;peer-dependencies&#x2F;" rel="nofollow">https:&#x2F;&#x2F;nodejs.org&#x2F;en&#x2F;blog&#x2F;npm&#x2F;peer-dependencies&#x2F;</a><p>Furthermore, will it support unifying transitive dependency versions to minimize bundle sizes?
评论 #32469015 未加载
ricardobeatalmost 3 years ago
I hope we figure out a better way to deal with the mountain of dead (and just plain bad) packages on NPM. Not carrying this legacy always sounded like a plus to me, but I haven&#x27;t used Deno in production yet.<p>It&#x27;s also interesting to note how the tone changes after receiving funding. May just be a coincidence, but this looks like a reactionary jab back at Bun, which is barely out of the gate.
评论 #32472727 未加载
评论 #32470454 未加载
paulgbalmost 3 years ago
&gt; import express from &quot;npm:express@5&quot;;<p>I&#x27;m excited to see this, and I&#x27;m sure they&#x27;ll work this out, but I sure hope I don&#x27;t have to keep dependency versions in sync across all of my import statements. I don&#x27;t have much love for package.json and node_modules, but it is nice to have one source-of-truth for all the dependencies of a project.
评论 #32469162 未加载
评论 #32469207 未加载
andrewmcwattersalmost 3 years ago
It would be nice if they included a compat flag for importing without this special syntax. As it stands, there is no clear drop-in replacement path for Deno, and as a result, I have no interest in using it.<p>I&#x27;m not rewriting my work so someone can have fun playing with VC money and abandon mature software.
评论 #32470023 未加载
alvisalmost 3 years ago
I wish there is more clarity about package dependency will be resolved from Deno?<p>Supporting npm is one big step forward, but without a package-lock.json that locks all child dependencies, it’d be a nightmare using the new compatibility in production
评论 #32472567 未加载
radiojasperalmost 3 years ago
That Bun pressure though!
mattlondonalmost 3 years ago
This is pleasing to see - no node_modules, no npm install. Just a special import format.<p>They are not clear if you need to have npm <i>installed</i> or not for this to work. I sincerely hope not - if it requires a locally-installed npm then they&#x27;ve shat the bed I think... that would be a major turn-off for me.<p>Can&#x27;t say I&#x27;ve ever been concerned by the performance of Deno, but looking forward to seeing this playout anyway since faster is always nice to have.
评论 #32469028 未加载
评论 #32475442 未加载
999900000999almost 3 years ago
&gt;Deno to easily import npm packages and make 80-90% of npm packages work in Deno within the next three months.<p>I get it, I understand it, but it is depressing to know that we&#x27;re going to be dealing with horribly ridden legacy NPM code for the next 800 years.<p>A lot of the code on NPM is just bad. And now we&#x27;re going to keep this legacy of just, bad JavaScript .<p>This is why I prefer dart and flutter for making mobile apps. Over react native.
评论 #32471169 未加载
评论 #32475710 未加载
评论 #32471304 未加载
pier25almost 3 years ago
People ITT mention Bun but I&#x27;m sure performance was always in the mind of Ryan et al. They were probably too busy with other stuff though.
up6w6almost 3 years ago
&gt; We know there&#x27;s been a lot of chatter recently about runtime speed.<p>For reference: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32457587" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32457587</a><p>Btw, I like where it&#x27;s going but I find it quite sad that there is no official linux ARM64 support yet - which means I can&#x27;t try to use it on AWS lambda for example.
评论 #32469308 未加载
评论 #32469295 未加载
评论 #32469059 未加载
substation13almost 3 years ago
If we really care about performance, then this split between the runtime and user code is not ideal. What we should be trying to do is bake the user code into the runtime and apply total program optimization. This can be done today with C, C++ and Rust. However, <i>in principle</i> JavaScript code could be transpiled to Zig and then baked into Deno.
评论 #32469946 未加载
danschumannalmost 3 years ago
Deno + Coffeescript? I mean it runs Typescript natively, so why not my favorite flavor of javascript, too? <a href="https:&#x2F;&#x2F;github.com&#x2F;jashkenas&#x2F;coffeescript&#x2F;issues&#x2F;5150" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jashkenas&#x2F;coffeescript&#x2F;issues&#x2F;5150</a>
stoicjumbotronalmost 3 years ago
Does something like patch-package: <a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;patch-package" rel="nofollow">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;patch-package</a> exists for Deno? If yes&#x2F;no how does it work&#x2F;would work?
评论 #32472533 未加载
AtNightWeCodealmost 3 years ago
&gt; ...make 80-90% of npm packages work in Deno...<p>Can this really be right? What is the number for Nodejs?
SomeCallMeTimalmost 3 years ago
This chips away at one of the showstoppers for Deno for me, which is good.<p>But while &quot;the vast majority&quot; of npm packages don&#x27;t require a gyp build step for native addons, some of those modules are pretty important, and I see no indication in the announcement that they&#x27;re also going to be implementing the Node C API or the gyp build process.<p>Right now I&#x27;m working with a machine learning project, and XGBoost [0] is a direct Node.js extension [1] through the binary interface.<p>So this does bring things a step closer to being generally usable, but there are still significant roadblocks.<p>A WebAssembly build of XGBoost could work with Deno, but aside from some guy&#x27;s unsupported side project&#x2F;proof-of-concept for use in a browser, I&#x27;m not seeing an XGBoost WebAssembly build. And generally when deploying something like a machine learning model I&#x27;d rather use well-supported tools than to need to dive into the rabbit hole of maintaining my own.<p>And yes, XGBoost will likely eventually have that kind of support for Deno, but then the next bleeding-edge project will come along and only support Node.<p>Even assuming Deno eventually hits a tipping point in popularity where everyone wants to release Node _and_ Deno support in their bleeding-edge projects, there are still things that I miss from package.json that don&#x27;t seem to exist in the Deno ecosystem.<p>Things like the &quot;scripts&quot; block: A nice centralized place to find all of the things that need to be done to a project, plus auto-run script entries that can trigger when a project is installed. And inheritable, overridable dependency maps (see the yarn &quot;resolutions&quot; block).<p>I&#x27;d love to jump into Deno, but I think there has been far too much &quot;baby thrown out with the bathwater&quot; to its design. It&#x27;s the classic development problem of looking at a system and seeing a ton of complexity, but not really understanding that all of that complexity was there for a reason. Maybe when it re-evolves 80% of Node&#x27;s and npm&#x27;s features I&#x27;ll be convinced to make the jump. I&#x27;m a huge TypeScript fan after all. But it still strikes me as a violation of &quot;As simple as possible, but no simpler.&quot;<p>[0] XGBoost is a _very_ promising approach to machine learning, training models much faster and with much more accuracy than traditional approaches.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;nuanio&#x2F;xgboost-node" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nuanio&#x2F;xgboost-node</a>
junonalmost 3 years ago
And both Deno and Bun still rely on HTTPS imports which is a nonstarter. It&#x27;s a security and availability minefield.<p>I still don&#x27;t understand why they have this feature and still consider themselves security focused.
markhaslamalmost 3 years ago
&gt; “… will allow Deno to easily import npm packages and make 80-90% of npm packages …”<p>Do we know what will differentiate the 10-20% of packages that won’t work?
评论 #32486941 未加载
resoluteteethalmost 3 years ago
NPM compatibility is probably the most important thing currently holding up people from adopting deno so this is pretty significant
qwertyuiop_almost 3 years ago
Looks like Deno took notice of Bun <a href="https:&#x2F;&#x2F;bun.sh&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bun.sh&#x2F;</a>
jerrygoyalalmost 3 years ago
&gt; 80-90% of npm packages work in Deno within the next three months.<p>curious what kind of npm packages won&#x27;t be supported in Deno
评论 #32470341 未加载
glutamatealmost 3 years ago
AsyncLocalStorage support (<a href="https:&#x2F;&#x2F;github.com&#x2F;denoland&#x2F;deno&#x2F;issues&#x2F;7010;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;denoland&#x2F;deno&#x2F;issues&#x2F;7010;</a> essentially thread local storage) pretty pretty please?
stall84almost 3 years ago
awwwwhhhh snap! this can really open the runtime up
评论 #32469738 未加载
brrrrrmalmost 3 years ago
&gt; the next release of Deno will include a new HTTP server. It is the fastest JavaScript web server ever built.<p>I feel unease reading untestable claims (with no numbers) about future releases. I&#x27;m made more uneasy by the fact that this is the second bullet point of the main tl;dr. It makes me wonder, what are the organizational incentives driving such a publication?
评论 #32470790 未加载