This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
@cfleming: yes I've been needing to refresh the lein project in Cursive to update the deps (version 0.1.67 on IntelliJ CE 14). I've been mainly using the clojure.main one using a figwheel build script I got from dnolen.
@thosmos: Ok, thanks - yeah, with the clojure.main one you will have to. I’m planning to add a banner in the project.clj if it’s been modified since the last sync, with a link to import right away.
this is further complicated by the fact that on one project I'm using boot lein-generate to update the lein deps
oh looks like there's the option to add a sync lein projects task before running the repl
that works fine for now. adds some time to each repl startup, but heh, better than doing it manually. the only other little issue is that I had to close the repl window that was missing the deps and then rerun it, rather than just starting it again in the same window.
I just compiled a sample app with one line of code -> (js/console.log "hello console") on :optimizations :advanced and the resulting file over 100kb. Is there a switch I'm missing somewhere to shrink this further?
(.' js/React createClass spec) whats the meaning of .' why would they not just do (.createClass js/React spec) ?
Hi, not sure if this is the right channel. I am trying to parse this transit encoded string: ["^ ", ":name", "treename", ":loaded", true, "~:id", "tree-id"] in javascript with transit.js (transit.reader("json").read(s))) but keep getting this error: Uncaught SyntaxError: Unexpected token ^. Any ideas what is wrong here?
@thosmos if you are playing with modules
I encourage you to try shadow-build
, it has various module related features that cljs is still missing. (eg. :none
works as well, so no HTML changes required to switch between :none
->`:advanced`)
Ok, I see, the problem is that transit.reader reads a json string, but I have a javascript array
@thheller: thanks for the ref. I'm aware of it but have yet to try it. I'll take a look at it. I'm interested in the use case of a small prerendered landing page that then downloads the rest of the app and state.
it usually is an optimization for production so not many people talk about it (me included)
yeah I'm discovering that. my one liner hello world was over 100k. at this point it will just be a prerendered page that will load the whole js and state to start with. that's not really a use case for modules so much as server prerendering and init from js.
but still .. even it is only a 60/40 split .. less data to download on the landing page
yeah you really can't do anything useful without cljs.core ... so we are usually looking at at least 30kb gzip'd
I did some experiments and sometimes using <script async ...>
yielded better results than shaving 20kb out of a 120kb download
but like I said ... you can't do anything useful without cljs.core .. so usually it won't be removed anyways
stuff is usually kept alive due to cljs.core using a hash-map or any other datastructure itself
but whatever the case .. if you gzip the 100kb "minimum" you end up with 22kb .. which is still less than most other .js (eg. jquery, react) even lodash is 18kb
i want to upgrade a clojure library i have to clojurescript as well. one of the function calls in the library is a multimethod which dispatches on (class x)
and yes, js doesn't have classes, but it still has strings and sequences etc are still implemented by protocol
@emil0r you may also roll your own -- see http://livingcode.org/entries/2015_01_09_multimethods/ (JavaScript)
@emil0r: what exactly doesn't work? you should be able to use class/type in that context
hi fellow clojurians. anyone got lucky requiring npm modules on the browser?
want to interop with a npm module, but can’t find my way to to that on the browser
never mind, just found it at cljsjs
Finally I did it! The first CHIP-8 emulator in clojurescript. http://coldnew.github.io/chip8.cljs/
@coldnew: awesome!