Re:Deno 1.34: Deno compile supports NPM packages
by JamesSwift on Thursday May 25, 2023 @10:15AM
(#36071022)
Seems like it could easily just be a compiler flag to 'only allow pure deno' and then fail/warn if a dependency pulls in npm stuff.
[ Parent
| on HN ]
Re:Deno 1.34: Deno compile supports NPM packages
by keb_ on Thursday May 25, 2023 @11:38AM
(#36072134)
I think a flag like that shouldn't have to exist. It's complicating and bloating the runtime more just to gain more adoption, not to make Deno actually better.
Re:Deno 1.34: Deno compile supports NPM packages
by rhaway84773 on Thursday May 25, 2023 @01:19PM
(#36073450)
I think not wanting to pull packages in from the largest package ecosystem in JS land is a fairly marginal need which should only be catered to through a setting, if at all.
You can always not add NPM packages if that’s something that bothers you, and there are probably fairly simple ways to add a lint step that ensures you’re doing that by simply scanning your package.json (which makes me think…can’t you simply not add a package.json? The original direct URL library references will be around anyways).
Re:Deno 1.34: Deno compile supports NPM packages
by WorldMaker on Thursday May 25, 2023 @05:28PM
(#36076484)
You just have to also lint your URL imports for "npm:" URLs. That's an easy enough lint. (Though slightly more complicated if you also decide to block in your lint rule other common npm-based CDNs like unpkg/esm.sh/others.)