DEV Community

Discussion on: A Quick Exploration Into Deno

Collapse
 
michaelcurrin profile image
Michael Currin

The main hurdle for me is building a React or Vue app when those packages don't exist on Denoland.

I found this approach on a tutorial. Yes it means you are using NPM registry, but you don't use the NPM command and you get packages to choose from

import React from "https://dev.jspm.io/react";
Enter fullscreen mode Exit fullscreen mode

Have you tried that out?

More notes on JSPM

jspm provides a module CDN allowing any package from npm to be directly loaded
in the browser and other JS environments as a fully optimized native JavaScript module.

Collapse
 
phuctm97 profile image
Minh-Phuc Tran

That's definitely the way, there is a lot of CDN supporting this mechanism right now, there are also unpkg, skypack, etc. I personally use Skypack.

And for your concern, it is a very common hurdle among devs when they see a URL being imported, however you think about it correctly, it's exactly what NPM does for you, except you don't have to install NPM and run installation scripts (which is insecure). What NPM does essentially is to download the package somewhere from its API (also a URL) and keep in the node_modules. So, there is really no difference.

Hope it helps!

Collapse
 
michaelcurrin profile image
Michael Currin

Ah thanks. I knew of unpkg from npm stuff - so it does something like JSPM?

I'll check out skypack

Thread Thread
 
michaelcurrin profile image
Michael Currin

I see skypack.dev/ even covers deno on their homepage

Thread Thread
 
phuctm97 profile image
Minh-Phuc Tran

Yeah, skypack is pretty dope, but be aware that not all packages are compatible, packages using Node.js specific won't work.