This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-07
Channels
- # adventofcode (38)
- # aleph (1)
- # bangalore-clj (3)
- # beginners (126)
- # boot (165)
- # boulder-clojurians (5)
- # cider (42)
- # cljsrn (11)
- # clojure (203)
- # clojure-greece (6)
- # clojure-hk (1)
- # clojure-italy (11)
- # clojure-new-zealand (1)
- # clojure-nl (1)
- # clojure-russia (112)
- # clojure-spec (86)
- # clojure-uk (176)
- # clojurescript (38)
- # code-reviews (2)
- # core-async (2)
- # cryogen (2)
- # cursive (16)
- # datascript (2)
- # datomic (80)
- # events (2)
- # garden (28)
- # hoplon (115)
- # jobs (1)
- # jobs-discuss (7)
- # klipse (50)
- # lein-figwheel (15)
- # liberator (17)
- # luminus (6)
- # off-topic (8)
- # om (31)
- # onyx (26)
- # parinfer (4)
- # planck (35)
- # protorepl (26)
- # quil (2)
- # re-frame (50)
- # reagent (21)
- # ring (5)
- # rum (2)
- # schema (1)
- # untangled (29)
- # vim (10)
- # yada (40)
A question about externs: I maintain lein-chromebuild and lein-chrome-extension - which (shockingly) provide some hooks to get cljs running in chrome extensions. The way chrome extensions work is that you specify a list of javascript files for each component of the extension, so for a popup menu I would build the main cljs bundle including the projects sources. Project sources would contain a defn like
(ns myproj.popup)
(defn popup.init []) ;; code to initialize the popup runs here
And I also include a js file like:
myproj.popup.init()
When the user clicks the popup link, the popup js file is loaded and myproj.popup/init
is called.
This works ok for normal compilation, but when advanced compilation is enabled, the myproj.popup/init
is munged away. I have been trying to solve this by using externs, specfied in the cljsbuild step. My externs file looks like this:
var myproj = {};
myproj.popup = {};
myproj.popup.init = function () {};
This does not complain during the compilation phase, but the myproj.popup/init
is still getting munged away.
Am I on the right track here? It seems like most descriptions of using externs are about calling out to 3rd party libs from cljs, whereas I am trying to call into cljs. Is there something obvious about my examples above that indicate why it's not working as I expect? Any pointers would be greatly appreciated.http://www.spacjer.com/blog/2014/09/12/clojurescript-javascript-interop/ comes up and briefly mentions this
@clumsyjedi also check out goog.exportSymbol()
That's what I typically reach for when I need to make sure JS can access something from CLJS.
nice jrheard + chrisoakman, that's exactly what I'm looking for, thanks 🙂
The Google Closure compiler is now available in pure JS. https://github.com/google/closure-compiler-js This is great news for self-hosted CLJS!
Does anyone know if it’s possible to use clojure spec generators in clojurescript?
Aha i found it I need to get it from cljs.spec.impl.gen
Hey,
I’m trying to split my code into two modules: a landing page (ns rulv.client.landing) and the user page (rulv.client.core).
I’m using :modules
compiler option as follows:
But a) the resulting files are empty and b) other dirs and files have been created (under "resources/public/"
) for libraries I’m using.
What am I doing wrong?
@asier what version of ClojureScript?
@asier I don’t really know the advanced optimizations well enough to be much help, but fwiw you might try setting :warnings true
and/or upgrading to ClojureScript 1.9.293
thanks @manutter51 - @dnolen yes, this: cljs_base.js
and you set :output-dir
so of course you’re going to get intermediate stuff in that location
there’s just not information here to know what’s going on, did you trying turning on :verbose true
compiler option?
@asier if you’re still confused I recommend trying the module feature on some tiny trivial thing outside your project and comparing what you might be doing wrong
@asier probably not related at all to your problem, but I recommend upgrading to the latest ClojureScript, there was a fix related to dependency ordering with modules
@anmonteiro cheers