Deno and Node.js - Compatibility

Asked

Viewed 197 times

9

The creator of Node.js has developed a new Javascript platform called Deno.

The code written for Node.js will be compatible with this new platform?

There is a Issue open about it, but I didn’t quite understand where that stood.

1 answer

9


There is no full compatibility and it is not possible to have it. The product has fundamental differences and was not made for compatibility. What I understood there is that they want some facilities and tools to help change from Node to Deno.

There is some progress to facilitate. There are cases that people who have made libraries are changing so that it works with Deno since the API is different. Your code may also suffer even not using these libraries, but it will not be tragic. This will be the one that will bring more problems, mainly by the way of using the modules.

Note that I am not saying that temporary and accidental incompatibilities should not be fixed. Just be sure that the API is similar, but not 100% the same. You’ll have to try and see if there’s too much trouble with your code.

Anything low level made for Node will not work because Deno is written in Rust with all new code.

Whole system of build is different, is always in different solutions. Who had builds simple will not suffer much, but how it was possible to do something simple with Node and be useful?

Although any Javascript code will work on it because Typescript understands any Javascript code its official language is TS, so if you don’t start changing your code to TS it won’t have all the advantages of Deno. Some people used TS but did a conversion before, now it is "native".

For safety some things that before was allowed is no more (if you disable this protection begins to lose advantages of having gone to Deno).

There aren’t that many changes and I don’t think compatibility should be a goal. Anyone who wants to go to Deno must know that it will be different and if he has a legacy he must pay a price to change, and have gains later. Who can’t pay for it will stay in a technology that is clearly inferior and hopefully die of starvation :).

It has a series of patterns that may not work anymore because they assume things that Deno is different. It is not a direct incompatibility, but it may not work if it takes advantage of an implementation detail that no longer exists (it might even cease to exist on the Node).

There is saying something about Deno’s maturity. People are already using, but nothing guarantees that everything is perfect, it is near.

From what I understand the community will create some facilitators to run things from Node on Deno.

For those who learned only following cake recipes will be suffered. But I believe that the community will start creating recipes to make the transition easier.

A new product was developed and not only a new version because it could only be fixed by breaking compatibility.

I know this will attract people who don’t like the answer but the Node has always been a mistake. I don’t know how big is better, but Deno is an important step when the person chooses it for the right reasons. Thankfully that the creator of Node was not proud as it happens a lot in our area and preferred to create something that would potentially kill your original product.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.