Live data from Hacker News

Deno Is Webby

blog.jim-nielsen.com

1–10 of 215 posts

Re: Deno Is Webby

#2
> You can log and style CLI output the same way you do it in the browser’s developer tools: using what you know with console.log

> console.log("%cHello World", "color: red");

TIL, neat! If anyone else did too - https://developer.mozilla.org/en-US/docs/Web/API/console#sty... looks great

Using alert/confirm/prompt for CLI tools is nice too, makes a lot of sense to build that in and use the web APIs for it.

Re: Deno Is Webby

#3
One of the things I love about Deno is that since it implements standard web APIs, many libraries built for the browser just work. For example, I recently made a simple static site generator with Deno to make my blog, and I found that I could use Marked for markdown support simply by importing it like this:

  import 'https://cdn.jsdelivr.net/npm/marked@3.0.7/marked.min.js';
  // now I can use window.marked()

Re: Deno Is Webby

#4
This is nice, until its not. I have spent a fair amount of time over the last several years trying to make node act like the browser, or vice versa. It's doubly confusing to juniors who don't understand the difference between a language and a runtime. alert() looks like a standard function and should be specified by the ECMAScript Language Specification. But its actually specified by the HTML standard, because its Window.alert(), and Javascript's scoping rules let you call it simply as alert(). Trying to explain what's JS and what's Web is really difficult, and design decisions like this only muddy the waters.

Re: Deno Is Webby

#5
> You Might Not Need NPM

If it's like every other JavaScript project I've been on since 2016, it's going to actually require thousands of JavaScript packages and doing everything with it is going to be slow as molasses even on high-end developer workstations.

Re: Deno Is Webby

#6

One of the things I love about Deno is that since it implements standard web APIs, many libraries built for the browser just work. For example, I recently made a simple static site generator with Deno to make my blog, and I found that I could use Marked for markdown support simply by importing it like this: import 'https://cdn.jsdelivr.net/npm/marked@3.0.7/marked.min.js'; // now I can use window.marked()

That just seems worse than what npm/yarn have. Despite Node's flaws, at least those have a hash check on the downloaded package against what's in the lock file.

EDIT: I was wrong. See @spoiler's reply.

Re: Deno Is Webby

#7
post #5

> You Might Not Need NPM If it's like every other JavaScript project I've been on since 2016, it's going to actually require thousands of JavaScript packages and doing everything with it is going to be slow as molasses even on high-end developer workstations.

Deno is also creating a standard library, so that too should reduce the amount of external packages you'll need.

Re: Deno Is Webby

#8

One of the things I love about Deno is that since it implements standard web APIs, many libraries built for the browser just work. For example, I recently made a simple static site generator with Deno to make my blog, and I found that I could use Marked for markdown support simply by importing it like this: import 'https://cdn.jsdelivr.net/npm/marked@3.0.7/marked.min.js'; // now I can use window.marked()

That just seems worse than what npm/yarn have. Despite Node's flaws, at least those have a hash check on the downloaded package against what's in the lock file. EDIT: I was wrong. See @spoiler's reply.

So does Deno: https://deno.land/manual/linking_to_external_code/integrity_...

It's not part of a package manager, because there isn't one, though.

Re: Deno Is Webby

#9
post #8

Earlier quoted context omitted.

That just seems worse than what npm/yarn have. Despite Node's flaws, at least those have a hash check on the downloaded package against what's in the lock file. EDIT: I was wrong. See @spoiler's reply.

So does Deno: https://deno.land/manual/linking_to_external_code/integrity_... It's not part of a package manager, because there isn't one, though.

Ah. I stand corrected.

Re: Deno Is Webby

#10

One of the things I love about Deno is that since it implements standard web APIs, many libraries built for the browser just work. For example, I recently made a simple static site generator with Deno to make my blog, and I found that I could use Marked for markdown support simply by importing it like this: import 'https://cdn.jsdelivr.net/npm/marked@3.0.7/marked.min.js'; // now I can use window.marked()

One of the many things about Node that Dahl explicitly wanted to "fix"* when building Deno was that the global namespace should be `window`, because that's what it is in JavaScript's natural habitat.

*scare-quotes because the reader might feel strongly opposed to the term, not because I have an agenda

Post reply on HN