Live data from Hacker News

Deno 1.14

deno.com

11–20 of 111 posts

Re: Deno 1.14

#11
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.

Off the top of my head it's probably useful for implementing The Singleton Pattern, which reduces to one single instance of a class: https://en.wikipedia.org/wiki/Singleton_pattern

Re: Deno 1.14

#12
post #5

Earlier quoted context omitted.

Can you share a bit on the use case, i.e. what do you need configured? Personally, I find Deno's "zero config" approach appealing, although I do have to fight the linter's "ban-types" rule occasionally since suggested type replacements are not equivalent.

Please open an issue on denoland/deno_lint with examples so we can make the diagnostic messages more useful.

Thanks, I usually do, but in this case they are typescript issues and have tickets in the ts repo.

For example, constructor signature for mixins requires `any` type that conflicts with `no-explicit-any` rule. In another case, `object` cannot be replaced with `Record` when used with conditional types to mean "any non-primitive value".

Re: Deno 1.14

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

Re: Deno 1.14

#15
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.

You can use it to load or compute derivatives of environmental configuration once

Re: Deno 1.14

#16
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.

I have 2 projects all in node, using express. Is there an easy way to migrate it? What happens to all the imported modules and dependencies? Can I still use express in Deno the same way?

Re: Deno 1.14

#17

Anyone using Deno in production? Would love to hear how it's going for your team.

We tried it for a couple months, it was basically a huge hassle getting our stuff to work especially anything that has bindings to CPP (any of the node gyp packages). Also felt like we were putting in a lot more effort to try to get packages with docs for node to work similarly in deno, and weren’t really feeling any value from using deno over node.

If you’re a hobbyist or an academic or starting a totally new project that won’t have dependencies/doesn’t need a large community of modules, then I recommend deno. Otherwise I highly recommend sticking to node until deno comes out with something to make the switch more appealing.

Re: Deno 1.14

#18
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.

I have 2 projects all in node, using express. Is there an easy way to migrate it? What happens to all the imported modules and dependencies? Can I still use express in Deno the same way?

"Easy" is highly subjective. If you're proficient at picking up new architecture paradigms for familiar languages, you're adept with ESM syntax, and refactoring is a skill; then you might consider it easy.

It's a paradigm shift, so there's always going to be some friction in migration. For your express needs, check out Oak https://deno.land/x/oak@v9.0.0

Re: Deno 1.14

#19
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.

I have 2 projects all in node, using express. Is there an easy way to migrate it? What happens to all the imported modules and dependencies? Can I still use express in Deno the same way?

Probably not, but Deno has Oak, which is Express-like and the combination of those two will get you close. But most node libs are not compatible and similarly node projects.

Re: Deno 1.14

#20
post #19

Earlier quoted context omitted.

I have 2 projects all in node, using express. Is there an easy way to migrate it? What happens to all the imported modules and dependencies? Can I still use express in Deno the same way?

Probably not, but Deno has Oak, which is Express-like and the combination of those two will get you close. But most node libs are not compatible and similarly node projects.

Isn't there a compatibility layer available, or are there reasons that in principle make this impossible?
Post reply on HN