Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison to deno2node #2

Closed
KnorpelSenf opened this issue Oct 6, 2021 · 6 comments
Closed

Comparison to deno2node #2

KnorpelSenf opened this issue Oct 6, 2021 · 6 comments

Comments

@KnorpelSenf
Copy link

There are already existing working solutions for this problem, I am mainly aware of deno2node.

Can you explain if you have any objections regarding that project, and outline what advantages you're aiming for?

@dsherret
Copy link
Member

dsherret commented Oct 7, 2021

The core difference is that this uses deno_graph to do the deno -> canonical typescript transform all in Rust. So someone could take that pipeline step and then send the output to a Typescript bundler if they wanted.

The deno.land/x/ module (https://deno.land/x/dnt) uses this transform to send the output to the typescript compiler and produce a compiled npm package that can be consumed from esm or cjs modules.

Overall, it's still very much a work in progress and I wouldn't recommend using it yet. I'd recommend deno2node.

@KnorpelSenf
Copy link
Author

Thanks for the clarification!

@dsherret
Copy link
Member

This is much more advanced now. For example, it now type checks the output and runs any of the deno test code in Node. I've updated the readme to explain this: https://github.com/dsherret/dnt

@KnorpelSenf
Copy link
Author

Sounds pretty awesome!

I assume it won't be possible anytime soon to emit code that runs on Node 12.20 and 14.13 or later?

If so, can we instead specify our own shims in order to get this comparability?

@dsherret
Copy link
Member

@KnorpelSenf it's possible to specify a custom shim package https://doc.deno.land/https/deno.land/x/dnt/mod.ts#BuildOptions -- Perhaps it would be good to get that working with a locally specified file as well.

There's some talk on which node versions to support in the shim here: denoland/node_shims#15

@KnorpelSenf
Copy link
Author

It looks like dnt has become the superior tool by now. There is one feature in deno2node that I'm missing before I can migrate. I opened #46 for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants