Skip to content

Instantly share code, notes, and snippets.

View lemonteaa's full-sized avatar

Lemontea lemonteaa

View GitHub Profile
@metacritical
metacritical / js-in-cljs.md
Created December 5, 2018 11:58 — forked from jmlsf/js-in-cljs.md
Using JavaScript modules in ClojureScript

Using JavaScript Libraries from ClojureScript

Using JavaScript libraries from ClojureScript involves two distinct concerns:

  1. Packaging the code and delivering it to the browser
  2. Making ClojureScript code that accesses JavaScript libraries safe for advanced optimization

Right now, the only single tool that solves these probems reliably, optimally, and with minimal configuration is shadow-cljs, and so that is what I favor. In paricular, shadow-cljs lets you install npm modules using npm or yarn and uses the resulting package.json to bundle external dependencies. Below I describe why, what alternatives there are, and what solutions I disfavor at this time.

Packaging and Delivering Code