denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
94.57k stars 5.25k forks source link

node compat checker #14061

Closed elycheikhsmail closed 2 weeks ago

elycheikhsmail commented 2 years ago

I request for command like this deno utiles checkcompat {pkg name or url } that fetch and analyse given pkg and tel if it deno compat or not if not compat it will list node api used in this pkg and not supported by deno compat

UltiRequiem commented 2 years ago

The idea sounds cool, but IMO it would be better on the userland.

dsherret commented 2 years ago

Probably better to just make deno compat work where it doesn't?

elycheikhsmail commented 2 years ago

Probably better to just make deno compat work where it doesn't?

Yes but I think it will take sometime ( may be long time) and I think node compatibily will never be 100% with actual approach.

UltiRequiem commented 2 years ago

I think node compatibily will never be 100% with actual approach.

Could you elaborate please?

elycheikhsmail commented 2 years ago

I think some of node compatibilty goals are: 1- give dev possibility to use existing js pkg in npm registrary in deno 2- easy migrate code writen for nodeFirst to be denoFirst and use it in both runtime for js pkg not compatible with deno we can write his equivalent in denojs but instead we can change or add small peace of this code to make it deno compat. actual deno --compat approach ( maybe forever ) is to run code as it even this code use some node (supported) api, I think this approach can't be universal because it will always depend on supported node api by deno compatibility and question is npm pkg x is supported by deno compatibility will be always asked?  If no the next question why ? will be asked too.

lucacasonato commented 2 weeks ago

I don't think this is technically possible. We aim to have full node compatibility. Try run the program in Deno to see whether it works - a separate tool is not necessary.