News for hackers. Stuff that matters.
Re:Deno raises $21M by jitl on Tuesday June 21, 2022 @03:22PM (#31828005)
There is already a system for building a NPM node package from a Deno package, called dnt (deno to node). It's maintained by some Deno team members. Here's a blog post they wrote about porting "Oak" (a deno HTTP server framework) to Node: https://deno.com/blog/dnt-oak

The nice thing about Deno conceptually, is that it's much more similar to the browser platform than node is. It uses ES6 only, has things like `fetch` built-in by default, and generally follows browser standards around interfaces like Request, Response, etc. Instead of needing a complicated build process to make Node code work on the browser, now we have a complicated build process to make Deno/Browser code work on Node. ¯\_(ツ)_/¯

Re:Deno raises $21M by capableweb on Tuesday June 21, 2022 @03:25PM (#31828045)
Not to take away from the rest of your message, I thought you wanted to get up to speed on that `fetch` is now available in nodejs core since version 17 or something like that (think it got included early this year).
Re:Deno raises $21M by jitl on Tuesday June 21, 2022 @03:27PM (#31828058)
I think this requires the `--experimental-fetch` command-line argument (per https://nodejs.org/tr/blog/release/v17.5.0/), so I don't think it qualifies as "by default".
Re:Deno raises $21M by wging on Tuesday June 21, 2022 @03:35PM (#31828160)
That's an old blog post; the current release is 18.4.0, which supports `fetch` without a command-line argument. You do get this warning the first time it's invoked, though:

    (node:340760) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
    (Use `node --trace-warnings ...` to show where the warning was created)
(some later blog posts that mention fetch being enabled-by-default and in the global scope are https://nodejs.org/en/blog/announcements/v18-release-announc... and https://nodejs.org/en/blog/release/v18.0.0/)
Re:Deno raises $21M by wdb on Tuesday June 21, 2022 @04:01PM (#31828455)
Yeah, but you could use `undici`-package for older Node version as it is being used to provide this experimental Fetch in Node 17+
Re:Deno raises $21M by melony on Tuesday June 21, 2022 @04:07PM (#31828527)
Can the same build pipelines be reused for CF/Fastly workers? The DX for workers is horrible with multiple buggy Wrangler implementations and zero observability into deployed workers.
Re:Deno raises $21M by the_gipsy on Tuesday June 21, 2022 @03:33PM (#31828142)
What about using an npm package in deno?
Re:Deno raises $21M by wperron on Tuesday June 21, 2022 @03:51PM (#31828341)
Has been possible (and surprinsingly easy) for a while through CDNs like skypack or esm.sh
Re:Deno raises $21M by yencabulator on Wednesday June 22, 2022 @08:12PM (#31843543)
Re:Deno raises $21M by the_gipsy on Wednesday June 22, 2022 @04:58AM (#31833535)
So deno runs JS? I thought it ran exclusively typescript.
Re:Deno raises $21M by whostolemyhat on Wednesday June 22, 2022 @05:34AM (#31833736)
Javascript is Typescript - TS is a superset of JS, so valid JS is valid TS, although you'd almost certainly get lint errors in dev complaining about lack of types.