Deno 2.9

(deno.com)

113 points | by enz 2 hours ago ago

42 comments

  • phaser 40 minutes ago

    I am the freaky outlier that's actually excited about this.

    My city builder game, Microlandia[1], runs on Deno. The game's graphics and UI is a Three.js/React app, but the guts of the game are in a "sidecar" process that is a `deno compile` typescript executable.

    On Mac, there's a Tauri shell that runs both client and server, and for Linux and Windows we use Electron, (Tauri proved to be quite problematic except when in macOS)

    Why on earth did I choose this cursed stack instead of a "proper" game engine? Well,

    Turns out developing the simulation in typescript with a performant sqlite driver hot reloads very fast and with a light code editor and my browser open on a second window I see the stuff updating live as I make it.

    Deno has a good VSCode extension with test helpers and a fast language server. WebGPU is good enough for me to write any cool shader I can think of and I don't miss any capability of a game engine.

    More importantly, not using Unity/Unreal brought back to me the joy of game development that I had lost due to and horrendous UI-driven workflow that takes me back to Macromedia Flash (yes, I am that old). Oh, and the licensing.

    And I know I could switch to Bun with small changes in code but Deno has never got in my way. Maybe it's because I avoid using libraries at all costs (and don't need much).

    Also, Typescript/React is such an amazing language for building a complex tycoon/simulation type of game that deals with a lot of data and displays it. Anyone who's worked on Unity knows it's the dark ages for UI over there.

    I'm unsure if i'll port the game to Deno Desktop anytime soon but if I start a game again I will use this stack again, as my game engine, this time without Electron or Tauri.

    1. https://microlandia.city

  • mmastrac an hour ago

    One of the most fascinating things to fall out of the AI apocalypse is seeing how abundant AI access amplifies the qualities of a company.

    IMO, Deno has always been more methodical, more focused (maybe too focused?) on standards. But now the Deno team is on the right track: using Claude extensively to improve the node.js compat which was absolutely herculean if not impossible before AI. [+]

    On the other hand, Bun has always played a bit fast and loose, chasing metrics at the cost of stability. Access to abundant AI has sent that project off the rails.

    Disclaimer: Former Deno engineer - I'm obviously going to have some biases. All IMO of course, but if you ask me I'd still bet on Deno in the long term, and I personally still use it for any .ts projects.

    [+] There might be a dozen people in the world that know how sensitive and subtle the timing and ordering in the JS event loop is and how meticulous just this single part needs to be for major node.js projects not to completely crap themselves.

  • catapart 2 hours ago

    EDIT: This was my fault. My machine did not take the update well and I did not confirm that the update worked before complaining about it (burned once before, so I was biased). After testing on a secondary machine and then forcing the upgrade on the initial machine, both machines ran both projects just fine. Great job by the devs! Sorry for the misinformation here.

    Original message: --------------------------------

    I just tried to migrate using their `deno install` -> `deno task dev` instructions, and I got an error about vite needing a newer version of Node.

    I'm not pathologizing deno, and I have (and will continue to) consistently tried to migrate my projects to deno, first from npm, then from pnpm, and now from bun. But every single time I've tried, there has been some kind of stupid "edge case", "simple fix" issue like this that stops me in my tracks. It's not a huge deal, but the simple fact is, when I run the project using bun, it runs. When I try it using deno, it doesn't. That has been a consistent pattern every single time I've tried. Last time, deno blew up because it wasn't able to work out the IndexedDB api calls I was using without some kind of bridge/shim/environment config. These are terribly minor issues, but it's the lack of care for the details that really sours me on this stuff.

    Obviously, deno should have used the version of vite that bun did which would have worked with the version of node on this machine. But even barring that, they could have dropped a little note around the instructions that says "if some packages need updates, you can run X command to do that". Even that would have allowed me to just move on, instead of forcing me to query the solution and hope for the best. Like I said, none of this is damning. It's just the exact kind of friction that prevents immediate adoption. At least for me.

    • bartlomieju 2 hours ago

      Gee, sorry to hear that. It's Bartek from the Deno team here. This is really a whack-a-mole. We currently present the latest stable Node.js version (26.3.0) so the error is not correct - I bet it's probing for something stupid like no of arguments a certain function supports. Is your project open source so I can take a look myself?

      • catapart an hour ago

        unfortunately, while the project is in the public domain, it's pre-alpha so I haven't made the repo public yet.

        but the project is structured the same as another public domain project I've built, and I just checked to make sure it has the same issue. I've gone ahead and made that project public so you can give it a try[0].

        but, just to be clear, I don't think the message is wrong? The Node version on this machine is out of date. And when comparing the deno.lock file to the bun.lock file, I can see that the deno.lock has a slightly newer version (8.1 vs 8.0) of vite. So I think the message could be correct and is just telling me to update my version of Node, which is perfectly reasonable. It's just the discrepancy between not needing the newer version of vite/node on bun while invoking an error using deno. Feels like I should have either gotten perfectly matching versions, or error messages (with commands) to update node.

        in any case, if you're still interested in seeing the error yourself, my steps were: 1. clone the repo 2. run deno install 3. run deno task dev

        [0] https://gitlab.com/cynic-devs/magnitce-code-example

        • nwhit an hour ago

          What node version do you have installed? I cannot reproduce the issue on that repo, I've tried with node versions all the way back to node 12.

          • catapart 44 minutes ago

            here's a dump of the console:

            ```

            catapart@snake:~/Development/magnitce-code-example$ deno install

            Warning The following packages are deprecated:

            ┖─ npm:boolean@3.2.0 (Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.)

            catapart@snake:~/Development/magnitce-code-example$ deno task dev

            Task dev vite

            You are using Node.js 20.11.1. Vite requires Node.js version 20.19+ or 22.12+. Please upgrade your Node.js version. error: Uncaught (in promise) SyntaxError: The requested module 'node:util' does not provide an export named 'parseEnv' at file:///home/catapart/Development/magnitce-code-example/node_modules/.deno/vite@8.1.0/node_modules/vite/dist/node/chunks/node.js:11:46

                at async CAC.<anonymous> (file:///home/catapart/Development/magnitce-code-example/node_modules/.deno/vite@8.1.0/node_modules/vite/dist/node/cli.js:706:27)
            
            ```

            also: I'm using Linux Mint, if it matters.

            • bartlomieju 18 minutes ago

              Okay I traced it, the problem is in `node_modules/vite/dist/node/cli.js`:

              ``` function checkNodeVersion(nodeVersion) { const major = parseInt(nodeVersion.split(".")[0], 10); const minor = parseInt(nodeVersion.split(".")[1], 10); return (major === 20 && minor >= 19) || (major === 22 && minor >= 12) || major > 22; } if (!checkNodeVersion(process.versions.node)) console.warn(`You are using Node.js ${process.versions.node}. Vite requires Node.js version 20.19+ or 22.12+. Please upgrade your Node.js version.`); ```

              And that error should be thrown only in Deno < 2.2 which presented `process.version` as `20.11.1`.

              Are you 100% sure this is not running some old version of Deno on your system?

              • catapart 7 minutes ago

                you nailed it! I tried it on a different machine, just to be sure, and it worked without a problem. So then I did a full restart on the mint machine and I got a whole new error that was talking about missing files. So I uninstalled deno and reinstalled it, and it worked exactly like it did on the other machine.

                I actually started this after another user said they couldn't reproduce the issue, but you figured it out before I finished reporting back.

                Thanks for straightening me out on this! As I said a few days ago on the Deno Desktop HN Topic, I'm looking forward to this newest version!

        • WorldMaker 29 minutes ago

          The release notes here indicate that if a script shells out to node and you have a node installed Deno lets the installed node run instead of its own shim.

      • pixel_popping an hour ago

        You can have AI do way more automated testing in a loop, let cheap models run 24/7 so all edge cases can be found over time by pulling random repos, you must make sure the agent is entirely autonomous, ask another agent to make a list (also in a loop so it keeps appending to it) and another agent that try to fulfill "run it with Deno".

        • jdxcode an hour ago

          I think node already does this (sans AI), idk where the code lives but deno could probably just use the same list of repos

        • someguyiguess an hour ago

          You're getting downvoted because "AI bad" but this is actually a good idea.

          • jorvi an hour ago

            Because none of that requires "AI". You can use a script to clone GitHub top NPM repos (by whatever measure), and then 'simply' try to migrate them to Deno and log all the errors and warnings. Maybe you compile those errors in a neat list with an LLM, and ask it to emphasize things it considers important. But even that can be done inside the script with loglevels and maybe some regex.

            Parent is getting downvoted because they're suggesting something that is akin to "why are you running this simple, reliable, efficient Python script instead of feeding inputs to an LLM and praying you get the outputs you want".

            Respect yourself by respecting your craft.

            • pixel_popping 24 minutes ago

              A script made by AI, digested by AI, organized by AI? Let's call it what it is.

  • Tiberium 2 hours ago

    To be honest, Deno was cool in the past (I even somewhat promoted it on HN in some comments), but nowadays I'm disappointed in their lackluster approach to stability and testing (specifically in Node compat). I recently hit multiple Node compatibility regressions in Deno that were hard to debug, and it doesn't help that they use Claude for everything now, from actual fixes to writing blog posts (even this one).

    For example, those two issues recently directly affected my projects:

    - https://github.com/denoland/deno/issues/34297

    - https://github.com/denoland/deno/issues/35289

    Seems like the core of these issues was a Claude-coauthored PR: https://github.com/denoland/deno/pull/33208

    I think I'll probably just go back to normal Node because it's stable and won't break things like this between minor releases, plus it's not full-on vibe-developed like Deno and Bun.

    P.S.: Deno does genuinely have good parts: built-in type checking, LSP server, formatter with sane defaults, and so on. I'm just very disappointed that they seem to be focusing less on the actual core runtime.

    • bartlomieju 2 hours ago

      > Seems like the core of these issues was a Claude-coauthored PR: https://github.com/denoland/deno/pull/33208

      Disclaimer: I'm the author of the linked PR. Using AI here is not really at fault here - it was just a giant rewrite that replaced how we do `node:http` in Deno. Replacing the engine while driving is never easy and we did the best we could. While we have a lot of test coverage and we use tests directly from Node.js codebase, we just don't catch everything. We're constantly working on improving the situation and I'm sorry you hit a problem. I can assure you that we are fixing all Node compat bugs as quickly as possible.

      • swatcoder an hour ago

        > Using AI here is not really at fault here

        Maybe reality isn't represented by the git logs, but according to them, you appear to have composed, reviewed and merged 131 commits affecting 58 files and 6000 lines -- a task that you say amounts to "replacing the engine while driving" -- in the span of one week.

        If that's accurate, of course your reliance on AI is at fault here. It invites you to mistake velocity for quality and conflate test satisfaction for completion.

        Without AI, this effort would likely have taken much longer and an experienced team would have approached it with due meticulousness, being especially stringent in review. Absorbed in it, the work would have weighed on their unconscious while they slept, with "Ah shoot, did I consider XYZ?" moments striking them in the shower. Ideally, familiar with the specific contributors (i.e. you) and their style of work, the reviewer who later consider merging the work would have ideas what to watch out for and would spend extra time looking at the details you might not have fully considered. It's a whole decades-matured craft practice that can do a pretty good job of making sure that a refactor of this scale doesn't land in main too broken.

        And while that version still probably wouldn't have been entirely flawless either, or might never have even been attempted because of its greater calendar and attention burden, that doesn't mean that using AI wasn't responsible for why and how this version is broken.

        This is exactly how AI makes things worse and why many people are wary of relying on third-party projects that embrace it too blithely. If you're going to use it, that's great, and maybe it will help you keep landing big features more quickly than otherwise -- but at least accept responsibility for the tradeoffs that you're inviting when you do so.

      • re-thc an hour ago

        > Rewrite the entire node:http stack to use llhttp (Node.js's HTTP parser)

        Can we please not turn Deno into junk? If you do the above -- what's the point of Deno?

        Once you bolt everything on like that you might as well just use Node.

        Deno started off with its own tools. Bun has managed a good balance between compatibility and its own thing (the recent moves aside) without resorting to these tactics...

        • bartlomieju an hour ago

          We tried to build `node:http` on top of Rust libraries (like Hyper) but we failed for a couple years. So earlier this year we decided to make it compatible (by using llhttp to have very high coverage - at the moment 88% compatibility for node:http module) and then focus on improving performance and slowly chipping away llhttp parts while keeping compatibility.

          • SOLAR_FIELDS an hour ago

            It's so easy for others to casually dismiss how difficult of a problem it is to get this right, especially, as you say, this is happening in flight for many thousands of users. Kudos to you for being transparent and building a genuinely cool and useful platform.

          • re-thc an hour ago

            > We tried to build `node:http` on top of Rust libraries (like Hyper) but we failed for a couple years.

            Are you sure you "failed"? Maybe there was good enough compatibility and that wasn't the problem?

            The problem sounds like a business 1 where you're after more users and you deem this "magic compatibility" is fixing it. Well maybe that's not it.

            A lot of people tried Deno and even tried to build libraries for it back some years ago. What you "failed" at is building the traction, ecosystem and community support.

            Compatibility doesn't buy you moat. Deno specific ecosystem, libraries and services etc do.

        • someguyiguess an hour ago

          > what's the point of Deno?

          To demonstrate how amazing bun is in comparison.

      • conartist6 an hour ago

        Of course the AI is not at fault, you were responsible as an engineer and you abdicated your responsibility

        • bartlomieju an hour ago

          Sure, we also managed to close ~30 outstanding issues with this rewrite and set us up to reach ~90% node:http compatibility, so overall I consider it a success.

          • conartist6 an hour ago

            AI lets people be reaaaaaaally "productive" when leaning into entirely the wrong work. Deno has no future if all it wants to be is a clone of node, so it just seems to me like your work is to speed the collapse

            • undefined_void 19 minutes ago

              > A "node:http" regression caused by a PR fixing many of outstanding issue. Author explains and apologizes.

              > "Deno has no future"

              I think there may be other things bothering you? These comments aren't really productive and discourage maintainers to even continue replying.

              Disclaimer: I am a maintainer.

              • conartist6 5 minutes ago

                Oh, you bet that my goal is not to give the AI users a pat on the back. I want them to know my unfiltered contempt for their unfiltered contempt for me (and anyone like me who still works with their hands).

    • MoonWalk 2 hours ago

      Well if Node compatibility is your big deal then yeah, why not just use it?

      I started a new project on Deno to avoid the NPM mess. Node compatibility was a distraction for the product.

      I'm tired of everything depending on Node. Assuming that everybody uses it is lazy.

      • Tiberium 2 hours ago

        Because I wanted native TypeScript support which Node only gained relatively recently and only partially, plus the issues I showed are regressions - they worked fine in earlier Deno versions.

      • pier25 44 minutes ago

        > Node compatibility was a distraction for the product

        I've gone back and forth on this point over the years.

        Yeah, Node compat has probably affected the rest of the product. I imagine at some point they (or their investors) freaked out because adoption wasn't happening. And the reality is it really doesn't matter if your product is better when nobody is using it.

        In retrospect I think it would have been a better decision to target Node compat from the start like Bun did. An impossible option at the time given Deno started trying to make something different from Node.

        Or maybe the problem was simply they couldn't afford low adoption after having investors on board.

      • someguyiguess an hour ago

        To be fair, you can't blame a person for thinking that a runtime created by the same guy who created Node would work with Node.

        • timw4mail 2 minutes ago

          But the point of Deno was to try to avoid pitfalls that became apparent in NodeJS, so some over-correction was bound to happen.

    • ch4s3 2 hours ago

      Time for someone to spin up Endo, but this time no cute ideas for real.

    • Recursing 2 hours ago

      node randomly broke production for us last week https://github.com/nodejs/node/issues/63989 not sure it can be considered "stable and won't break things like this between minor releases"

      • Tiberium 2 hours ago

        Welp, guess the only option is to stay on some single version then and hope it doesn't get critical security issues...

        • Recursing an hour ago

          That node release was to fix security issues...

    • dismalaf 2 hours ago

      Deno went downhill as soon as they introduced Node compatibility. It promised a better way of doing things, then stooped back down to Node fuckery.

  • lackoftactics 2 hours ago

    definitely hard to beat Bun at the moment, the live reload is crazy good

    • someguyiguess an hour ago

      Agreed. Bun is awesome! I see no reason to switch to deno.

  • shimman an hour ago

    Deno is a great example of how taking VC investments tanks the viability of an open source project. They keep focusing on money driving projects for an extremely small + fractured community (let's be honest here, whose only customers who are likely other VC holdings), oh and having continuous major layoffs does not signal good leadership qualities.

    Ryan Dahl is assuredly a poor steward of open source software if these are the results. Node is popular because of the massive, inclusive community behind it; not because of a few rock star individuals, but for the VC mindset it's much easier to control an individual programmer than a community of them.

    Only wonders are what other communities VC will try to rat fuck next, how fast do we think Evan You will speed run this exact same arc (which has already happened a dozen times in lived memory), and why does Bryan Cantrill feel like the only smart tech executive that doesn't fall into these traps?

  • sharts 23 minutes ago

    Why do so many projects exist needing to shore up shortcomings of js ecosystems?