4 ms·
I'm curious, if anyone has lived through the experience: What is the migration story like to port an existing codebase from node.js to Deno?
by zomglings 6y ago
I'm curious, if anyone has lived through the experience: What is the migration story like to port an existing codebase from node.js to Deno?
- TranquilMarmot 6y agoEven trying this with some toy projects I have it is NOT easy or straightforward. The dependency management alone is different enough to make this almost impossible. I think if you want to use Deno, it would have to be from the ground up or a complete rewrite.
- nikisweeting 6y agoVery painful due to the lack of support for importing npm packages.
- searchableguy 6y agoYou can import npm packages using esm and skypack. import React from "https://esm.sh/react@17.0.2 https://esm.sh/react@17.0.2" should work. For skypack, add ?dts flag at the end to get typescript typing support automatically. Self hosting is an option too with above. if you want more npm modules to work with deno, you can contribute to https://deno.land/std/node https://deno.land/std/node
- nikisweeting 6y agoThis is good, but even with integrity hashes it makes me slightly uncomfortable to have a (relatively unknown) SaaS company stand between the original source on npm and us. Self-hosting seems good, but how does one do that? I didn't see any docs on Skypack's site about self-hosting something that would work as a npm-to-deno-repackaging server.
- searchableguy 6y agoSorry, I was talking about esm.sh https://github.com/postui/esm.sh https://github.com/postui/esm.sh This is written in golang and can be self hosted. > This is good, but even with integrity hashes it makes me slightly uncomfortable to have a (relatively unknown) SaaS company stand between the original source on npm and us. I understand the worries but npm is a private SAAS company which was unknown at the time of node too. Things take time to sort out and become stable. Unlike node, where npm defaults to npmjs - a private company which can go anytime. Deno doesn't make that choice for users. I believe that is the right step. Trust what you need to and have an allow list.