Live data from Hacker News

Deno 1.14

deno.com

91–100 of 111 posts

Re: Deno 1.14

#91

One of the most exciting opportunities IMO that Deno opens up, compared to most traditional server-side frameworks, is the possibility for simple url-based live-reload workflows in production. I'd love to be able to develop backend services by pushing source code to some url as I develop, and then have the production instances of the service notified of the changes and reload themselves immediately for a super-tight…

This is a really old concept with interpreted languages, Capistrano in Ruby came out in 2006 for this sort of workflow: https://en.wikipedia.org/wiki/Capistrano_(software) 10 year old gist for this exact thing: https://gist.github.com/rchampourlier/1281506/a22148264c457ebb69259261f117548569be6bef Same exists in Node, using PM2 process monitor via rsync/ssh: https://pm2.keymetrics.io/docs/usage/deployment/ Run a comma…

[deleted]

Re: Deno 1.14

#92

One of the most exciting opportunities IMO that Deno opens up, compared to most traditional server-side frameworks, is the possibility for simple url-based live-reload workflows in production. I'd love to be able to develop backend services by pushing source code to some url as I develop, and then have the production instances of the service notified of the changes and reload themselves immediately for a super-tight…

This is a really old concept with interpreted languages, Capistrano in Ruby came out in 2006 for this sort of workflow: https://en.wikipedia.org/wiki/Capistrano_(software) 10 year old gist for this exact thing: https://gist.github.com/rchampourlier/1281506/a22148264c457ebb69259261f117548569be6bef Same exists in Node, using PM2 process monitor via rsync/ssh: https://pm2.keymetrics.io/docs/usage/deployment/ Run a comma…

Some frameworks will offer this as part of the development process with a development server. Mojolicious (Perl) for example ships with Morbo as a development webserver, and Hypnotoad as a more enterprise ready one. One of the major differences is that morbo will take a path and auto-reload if any file in it updates, while hypnotoad offers zero downtime reloads, but you have to manually tell it to restart.

Arguably a delineation like this is better, even if just a single flag separating the behavior in the server, since it allows production to not worry about some file copies/changes forcing lots of reloads that aren't needed, which isn't really a problem in most development environments.

Re: Deno 1.14

#93
post #43
post #35

Earlier quoted context omitted.

Who doesn't love being removed even further from the platform they're running on?

One of Deno's value props is to have a tighter and more explicit trust model. And this is not a obscure need. There are cloud providers who let you run JS on a specialized and restricted API. However, there is nothing stopping you from using Node or integrating V8 and go wild with it! (In fact I would argue that this is a solid strategy for some types of projects, where you can get the best of both (static/dynamic) w…

> And this is not a obscure need. There are cloud providers who let you run JS on a specialized and restricted API.

Sounds rather obscure actually. Still somewhat confused why this would be useful in Deno. Looks like it's just a repeat of what happened with Java's SecurityManager, which is now being deprecated and removed.

Re: Deno 1.14

#94
post #34
post #28

I tried out Deno last weekend for a fun little hack project (syncing a local Markdown file to a formatted Google Doc), and it was awesome. Writing TypeScript code for Deno feels a lot like writing Go (which is a very good thing to me): - opinionated build/fmt/deps - well-designed stdlib - no need for scaffolding files (.eslintrc, babel.config.js, jest.config.js, mocha.opts, etc.) If that sounds good to you, try Deno!

I also tried it out recently, because I wanted to make a small utility for myself and liked the idea of it providing a single executable (and bypassing the node/NPM ecosystem for learning a JS/TS based system appealed to me). It delivered on that beautifully, as all I did is switch from running "deno run" as I was for testing to "deno compile" and it delivered to me exactly what I was looking for. A bit large at 57 M…

Does the fact that you didn't need Npm mean that Deno has a suffciently large built-in library that a thing like Npm is in most cases not needed?

Re: Deno 1.14

#95
post #14

Love Deno and using it as a node replacement. Fantastic work. I encourage anybody who has npm packages to move everything to deno.

> Love Deno and using it as a node replacement.

I'm pretty happy with Node.js. What would be some good reasons to switch?

Re: Deno 1.14

#96
post #58
post #56

https://github.com/denoland/deno/discussions/11771 > NodeJS compatibility, what is our high-level strategy, goals, next steps? > Do we see Node and Deno co-existing, or do we want to think of Node as "legacy"? (Note, there was no clear decision on this question, it was just a conversation) > If we could say "you can run your Express server under Deno faster than Node" would that encourage adoption? No clear answer I…

Node is from the days before ES6 and uses a different API. Should just kill it and start fresh. Deno conforms to modern JS standards and is much more pleasant to use in pretty much every way.

Node.js adds new-style APIs all the time. The File-system API now has an async/await version which is a joy to use.

When you load a library you can load a newer version or an older one. It's up to you. You can use both.

Re: Deno 1.14

#97
post #2

Only tangentially related, but what's the point of a static class block? What problem does it solve that's not covered by either the class constructor or a static const? Doesn't it introduce a weird (stateful!) computation that's hard to reason about? There's probably a use-case I'm missing, because intuitively I'd automatically classify it as bad a practice.

Another perspective on static blocks is what they replace/help migrate away from. Static blocks are one of the last pieces of the puzzle holding some projects (or at least some particularly old legacy objects in those projects) from migrating to the new class syntax. For better or worse the classic Constructor Function pattern of building objects in JS was full of static initialization code (as it was an easy thing t…

Here's a pattern I've been using for some time in ES6 JavaScript (on Node.js) :

   module.exports =  
   class MyClass
   { // ...

     static init ()
     { // ... do something, like create and 
       // cache a Singleton etc. 
       return this;
     }
   } . init();
The static method init() is executed only once when the class is created and exported. You could add some check to it that causes an error if it gets called more than once.

Do static blocks allow me to do something more?

Re: Deno 1.14

#98
My son is 13. He loves Deno. What I don't get is why a 13-year-old can get Deno, and we don't, and it's not as widely popular as it must be for its merits!

Re: Deno 1.14

#99
post #34

Earlier quoted context omitted.

I also tried it out recently, because I wanted to make a small utility for myself and liked the idea of it providing a single executable (and bypassing the node/NPM ecosystem for learning a JS/TS based system appealed to me). It delivered on that beautifully, as all I did is switch from running "deno run" as I was for testing to "deno compile" and it delivered to me exactly what I was looking for. A bit large at 57 M…

Does the fact that you didn't need Npm mean that Deno has a suffciently large built-in library that a thing like Npm is in most cases not needed?

Honestly, I'm not sure. My needs were very minimal, one Deno stdlib import, and one third party module import (for ini file parsing). https://deno.land/x/ has their third party module ecosystem, but it's all just JS in the end, so I think think there's anything making it so you couldn't use the NPM ecosystem.

I found this article[1] which seems to indicate if the node packages use ES modules you can use import them as is, or if not it says JSPM can help with that.

1: https://medium.com/samsung-internet-dev/using-node-modules-i...

Re: Deno 1.14

#100

One of the most exciting opportunities IMO that Deno opens up, compared to most traditional server-side frameworks, is the possibility for simple url-based live-reload workflows in production. I'd love to be able to develop backend services by pushing source code to some url as I develop, and then have the production instances of the service notified of the changes and reload themselves immediately for a super-tight…

I built this https://webcode.run/

This looks super dope. I also love Observable and have wanted to find more ways to leverage it. This seems perfect!
Post reply on HN