Skip to content

Instantly share code, notes, and snippets.

@jpalala
Created June 2, 2020 21:51
Show Gist options
  • Save jpalala/f557e9a1a627b9b5c06355ddffc63124 to your computer and use it in GitHub Desktop.
Save jpalala/f557e9a1a627b9b5c06355ddffc63124 to your computer and use it in GitHub Desktop.
Deno ditributable - using NPM Packages as sane way to distribute deno and using Deno to share CSS stylings

WARNING THis goes contrary to Deno philosophy of no package.json dependencies.

Imports management

This Article from dev.to desrcibes a way to keep packages updated (or at least notify you if package needs updating).

But there's already an existing tool called npm. How can we take advantage of npm to distribute deno packages. Among other things, since deno acts from cdns, you can also

Idea 1: What if instead, you ship deno packages as npm packages

We can piggyback off the work of npm! NPM downloadas the package into the node_modules,

and a new tool/script somewhere there (still to be written) can run which checks an imports file if there are updates to the deno package.

Idea 2: Redistributable stylesheets/themes

Not exactly the global stylesheets, but on an organism level (instead of atomic/component level). You can separate the CSS into an object and "inject" (like how react-styled / jsx works). I think the whole idea is that instead of using jsdeliver to share your css, you have the "object styles" in your own servers, ready for consumption by s any framework that can decode / map it to your component.

Think shareable themes, not really webcomponents.

Idea 3: Your server-in-a-box

We usually have to use python SimpleHTTPServer to run a website html. With deno, static file serving using their server thing is a sinch. Found a gist already on this - https://gist.github.com/kitsonk/f8210d2f802a0e5396abda32552be0dc . Deno looks able to serve my html files without the need for an nginx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment