Live data from Hacker News

Node.js built-ins on Deno Deploy

deno.com

71–80 of 112 posts

Re: Node.js built-ins on Deno Deploy

#71
post #5

I do wonder about the long-term effects of Deno being Node-compatible; will it result in only Node programming being done since "Deno will handle it fine" and thus Deno specific stuff will not be developed?

> and thus Deno specific stuff will not be developed?

Deno supports typescript out of the box. This alone greatly simplifies any deployment, and even if Deno did not offered anything else it would already take the lead in developer experience.

Re: Node.js built-ins on Deno Deploy

#72
post #26

Earlier quoted context omitted.

Nodejs is the de facto platform and ecosystem to write JS backend, and it seemed to me a bit weird that one would want to compete with it without being compatible with it which meant throwing away the very large ecosystem and existing code bases with no good reasons if you wanted to migrate. So congrats to them to have made it now, Deno can still compete on speed or tooling for example. Good Deno ideas will indeed pr…

> can someone explain why it's a good idea to have isolation at the interpreter level rather than relying on OS features? (or VMs). Those technologies are platform-specific and difficult to use. For example, provide the command line for running a Node.js program in Linux without file system access. In deno, it's deno run main.ts Or, to enable fs access: deno run --allow-read --allow-write main.ts --- That said, I agr…

Something along the lines of

> docker run -it --rm -v "$PWD":/app -w /app node:18 node main.js

It's a tad longer but it's more flexible too ;)

Re: Node.js built-ins on Deno Deploy

#73
post #43
post #25

Earlier quoted context omitted.

I think you can analogize these server JS runtimes (Node, Deno) to browser runtimes (V8, JavaScriptCore, SpiderMonkey) and to the APIs that ship with those. When one browser JS engine invents and exposes a novel feature + API surface for it that the other engines don't, what happens? If there's any demand at all for doing what the feature does, then devs will tend to write polyfills to make the feature "work" (for so…

Having a feature is not the same thing as having API compatibility with Node's implementation of the feature. I think people are worried that an exciting project that aimed to have a different approach and a different set of trade-offs from Node will end up having to support everything that Node does, possibly inheriting its trade-offs and losing the freedom to innovate that they started with. Even if there's no tech…

I think that most wanting to use Deno are wanting to write an application in a more Deno friendly way. Linting, formating, and typescript in the box. But pragmatically also needing or desiring to be able to utilize existing NPM modules. Those NPM modules more often than not needing node compatibility.

It doesn't mean the application at its core will be more node based so much as wanting to be able to use a given NPM module.

Re: Node.js built-ins on Deno Deploy

#74
post #71
post #5

I do wonder about the long-term effects of Deno being Node-compatible; will it result in only Node programming being done since "Deno will handle it fine" and thus Deno specific stuff will not be developed?

> and thus Deno specific stuff will not be developed? Deno supports typescript out of the box. This alone greatly simplifies any deployment, and even if Deno did not offered anything else it would already take the lead in developer experience.

This is my take as well. Given the relative pain to configure ts projects in node. Especially with the harder lines between esm and cjs modules. It's kind of painful at times in the node space.

Re: Node.js built-ins on Deno Deploy

#75

Slowly Deno is just becoming Node written in Rust with some added flexibility in certain areas. Not necessarily a bad thing but it feels like its three years too late to get major traction. Native TS is neat, but we also have TS compilers that are measured in milliseconds now.

I don't think the speed matters persa, what annoys me is when starting a node project I have to install typescript, jest, eslint (any plugins) then whatever dependences I am using and then set up a tsconfig and what every else also needs a config file.

In deno you can just open your ide, add some imports to the import map and you're ready to code.

Re: Node.js built-ins on Deno Deploy

#76
post #5

I do wonder about the long-term effects of Deno being Node-compatible; will it result in only Node programming being done since "Deno will handle it fine" and thus Deno specific stuff will not be developed?

Nah, Deno is just another runtime. Now we have the browser runtimes and multiple server runtimes. Not to mention we also have server runtimes like Cloudflare Workers that are "almost" Node in the sense that they run on V8, but without access to filesystem APIs. People will make sure to distribute their library so that it works on all of them. They might even use `deno compile` to bundle the library into a single file…

Note that even cloudflare workers is adding more node compatibility.

Re: Node.js built-ins on Deno Deploy

#77

Slowly Deno is just becoming Node written in Rust with some added flexibility in certain areas. Not necessarily a bad thing but it feels like its three years too late to get major traction. Native TS is neat, but we also have TS compilers that are measured in milliseconds now.

I don't think the speed matters persa, what annoys me is when starting a node project I have to install typescript, jest, eslint (any plugins) then whatever dependences I am using and then set up a tsconfig and what every else also needs a config file. In deno you can just open your ide, add some imports to the import map and you're ready to code.

Note that import maps are optional. I mostly just open my editor for a Deno project and I'm good to go. :)

Re: Node.js built-ins on Deno Deploy

#78

At this point, given the state of module loading on node and other ecosystem problems, my reasons for switching to deno (or bun) are dwindling.

Uhh do you not realize deno has an entirely different import system where you import by direct resource URL, or one level of indirection through an import map (just like the web)? There's no complex node_modules resolution, no .mjs extension nonsense, no package.json bits to flip. Imports are radically simpler in deno.

Pst, you can do the same thing in Node.js. Nothing is stopping you.

Re: Node.js built-ins on Deno Deploy

#79
post #72

Earlier quoted context omitted.

> can someone explain why it's a good idea to have isolation at the interpreter level rather than relying on OS features? (or VMs). Those technologies are platform-specific and difficult to use. For example, provide the command line for running a Node.js program in Linux without file system access. In deno, it's deno run main.ts Or, to enable fs access: deno run --allow-read --allow-write main.ts --- That said, I agr…

Something along the lines of > docker run -it --rm -v "$PWD":/app -w /app node:18 node main.js It's a tad longer but it's more flexible too ;)

Of course, now you have to boot and run an entire VM on your MacBook, just to run that one Node.js program.

Re: Node.js built-ins on Deno Deploy

#80
Am I the only one reading this right or am I the only one reading it wrong.

Deno is not supporting node.js built-ins. It's deno deploy. Meaning that this will not work on other hosting platforms, right... or?

Post reply on HN