Hacker News new | ask | show | jobs
by dimgl 1508 days ago
I haven't had the same success with Deno that I expected. At first, I was shocked by how good the tooling is, and I was super happy with its dependency management. All of the problems started once I started getting into actual business logic.

`redis` and `ioredis` `npm` packages don't work with Deno, even with the Node compat layer (I tried). So you have to use the Deno driver for Redis. But you look up the library for this, and it's experimental: https://deno.land/x/redis@v0.25.5

Same deal with Postgres. `pg` would not compile at all. Knex also didn't work (this was an older project). I'm assuming this is because these two packages use native Node.js plugins.

I like Deno a lot, and the out of the box TypeScript support is a gamechanger, but I had a really tough time working with it and actually being productive.

6 comments

My experience was very similar. I was excited to start working on a personal project in Deno and found trying to use npm and import maps to be so painful, it left me wondering how I hadn't heard of these problems before (or since, really).
>Same deal with Postgres. `pg` would not compile at all. Knex also didn't work (this was an older project).

You should take a look at Postgres.js [0] which supports Deno and TypeScript. Version 3.x was released recently and discussed in this HN thread [1].

The client is implemented in JavaScript. Queries can be written using JavaScript template literals.

[0] https://github.com/porsager/postgres [1] https://news.ycombinator.com/item?id=30794332

> `redis` and `ioredis` `npm` packages don't work with Deno, even with the Node compat layer (I tried).

I'd love to hear specifically what didn't work and how close the Deno team is to maybe fixing those sorts of issues. Not that they owe that to us open-source wise, just curious as like... otherwise you are right. We're starting the ecosystem again over from scratch.

redis clearTimeout shim does not work correctly, console gets blasted with timeout messages nonstop because `on('error')` from the EventEmitter keeps getting triggered, even though the client is connected just fine.

ioredis commands hang randomly. I couldn't do GETs or SETs.

I think the ecosystem just needs to be filled out

I'm hoping Deno is such a dramatic improvement on the foundation vs Node that it's enough to convince library authors to jump over; the jury's still out on whether that flywheel will get started

ioredis and mysql2 have been working for some quite sometime.
On the other hand, not being able to bring all of the node.js package ecosystem along can be considered a feature.
I don't think it can.

There's a lot of crap in the node.js ecosystem, no denying it.

But there's just a lot of packages in general. Many of which are really, really well designed and good.

I don't really understand this take.

Yes, there are a lot of packages available - but that gives you choice.

It's not a feature if you can't build the project you are trying to build.