This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-07
Channels
- # beginners (4)
- # boot (186)
- # cider (68)
- # cljsjs (2)
- # cljsrn (6)
- # clojure (103)
- # clojure-dev (1)
- # clojure-russia (117)
- # clojurescript (40)
- # community-development (31)
- # cursive (2)
- # data-science (7)
- # datomic (6)
- # devcards (2)
- # editors-rus (2)
- # emacs (2)
- # jobs (2)
- # ldnclj (2)
- # lein-figwheel (41)
- # off-topic (5)
- # om (50)
- # overtone (2)
- # re-frame (36)
- # reagent (1)
- # spacemacs (3)
- # yada (2)
does anyone know of good open source examples of :foreign-libs
being used to consume commonjs modules?
if you don't control all the files IMO the better option is to just use webpack or browserify to compile the modules away.
Maria's code can't deal with NPM modules as they are for example and supports only relative requires (the only module root it considers is .
) IIRC.
is there a way to debug this: #object[SyntheticKeyboardEvent [object Object]]
// #object[SyntheticEvent [object Object]]
without needing to install clairvoyant or clj-devtools?
What’s the preferred way of doing cache busting these days? I have a project in boot with LESS and Cljs resources, with an nginx reverse proxy that sets the cache expire headers, but I need some sort of cache busting (e.g. fingerprinting assets, ETags or something like it) so when we push a new version on prod the client-side cache gets invalidated
there seems several ways of doing this, but I’m unsure what’s the best/simplest. We use Selmer templating to load up the main page
@joelkuiper: on s3 i like fingerprinting which gives most fine grained invalidation control but many people just use a uri param
@joelkuiper @martinklepsch Using boot it's pretty straightforward to transform compiled assets from main.js
to main.<sha1>.js
-- we use the pandect lib's sha1 fn
@pandeiro: right the fingerprinting itself is easy but then you need code that knows what paths to use for which objects etc
thinking of images in the cljs code etc
(which is itself a composition of the sha1 computation, renaming, and html manip tasks)
but probably a good approach to dump some sort of "spec" in the html
and have functions to build asset paths in cljs that rely on this information
@jaen thanks, so you’re saying I would need to build it into a static file and import that, and along the way probably make some externs?
@blissdev: yes, that seems like the best idea IMO, given the current status quo. This might be instructive - https://github.com/taylorSando/om-material-ui
The lib builds material-ui to a single file using scripts in build-mui
and then uses that as a foreign lib.
This for example might mean, you will not be able to use React from cljsjs, if the library needs to require
it explicitly (like material-ui
does)
@blissdev: you can describe external deps with browserify, which might be worth investigating if you want to continue to use the cljsjs version of react
@futuro ah, I’m trying to apply the material-ui build procedures to a non-react javascript lib, so I don’t think that will be a concern
@blissdev: there are a couple options, such as https://github.com/jmmk/javascript-externs-generator
to automatically generate externs for you. afaik, it loads the JS file then traverses the object you give it to figure out typing and so forth.
@blissdev: I'd say that's a really good starting point, as it will get most of what you want, and then you can fill in the rest by hand