This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-17
Channels
- # aws (3)
- # beginners (81)
- # boot (155)
- # capetown (2)
- # cider (32)
- # clara (14)
- # cljs-dev (40)
- # cljsrn (12)
- # clojure (158)
- # clojure-austin (5)
- # clojure-korea (6)
- # clojure-poland (1)
- # clojure-russia (63)
- # clojure-spec (45)
- # clojure-uk (75)
- # clojurescript (109)
- # code-reviews (1)
- # core-logic (12)
- # core-matrix (1)
- # cursive (36)
- # datomic (16)
- # defnpodcast (1)
- # devcards (2)
- # editors (3)
- # euroclojure (1)
- # events (3)
- # flambo (1)
- # hoplon (19)
- # javascript (4)
- # jobs (1)
- # lein-figwheel (4)
- # leiningen (1)
- # off-topic (1)
- # om (177)
- # onyx (121)
- # pedestal (14)
- # planck (19)
- # proton (3)
- # re-frame (36)
- # reagent (21)
- # remote-jobs (1)
- # ring (4)
- # ring-swagger (6)
- # spacemacs (1)
- # specter (2)
- # test-check (4)
- # untangled (9)
- # utah-clojurians (1)
- # yada (2)
When developing a clojurescript library. Let’s pretend for a moment that I don’t want to use the (in boot) excellent checkouts feature — so I’m not going to have some other project with boot-cljs-reload etc from which I’ll inspect & interact with my client library. Instead, I’d really like to extend my build.boot in such a way that I can get a clojurescript repl (+ nrepl for use with cursive/emacs).. Is this possible without going the reload route, serving index.html files and whatnot ? Can I use e.g. phantomjs and get a repl without involving a browser ?
Can I use boot-cljs-repl (https://github.com/adzerk-oss/boot-cljs-repl) in a headless manner ? Following the page’s instructions I’m stuck with a repl which says “waiting for client to connect … Connection is <ws://localhost:61535>”.. There’s no way to use phantomjs or something else to circumvent the need to startup & serve an index file etc etc etc ?
@borkdude are you including/serving main.out
?
this is our dev task:
(deftask dev []
(set-env!
:source-paths #(conj % "src-cljs-dev"))
(comp
(start-system)
(watch)
(less :source-map true :compression false :inline-javascript true)
(reload :on-jsload 'dre.app/fig-reload)
(cljs-repl)
(cljs
:source-map true
:compiler-options {:parallel-build true
:preloads '[devtools.preload]})))
I’ll look into this @richiardiandrea, thanks > Note that the compilation process generates the main.out folder in any of the optimizations settings. For source maps to work you need both main.out and main.js.map in your served folder.
yes exactly, I think that's my contribution to the wiki, I fell into this as well
We have this in resources/public/js:
{:require [dre.app]
:compiler-options {:asset-path "js/app.out"
:devcards true}}
Any idea what I’m missing?This works: http://localhost:3700/js/app.js, but http://localhost:3700/js/app.js.map doesn't
Ah this one works: http://localhost:3700/js/app.out/dre/app.js.map
@borkdude source maps work in this demo, for example: https://github.com/hoplon/triclojure-hoplon-2016
can anyone explain what's going on here? https://gist.github.com/skrat/79b7e43899e685a35dcecd70cd4d1bf5
@micha it works on linux, but running the same tasks with the same bootfile on windows throws this error
this error output is from my colleague running Windows, unfortunately I don't have one to test it
@skrat the issue is here: https://github.com/hoplon/triclojure-hoplon-2016
i mean @skrat the issue is here: https://github.com/cljsjs/boot-cljsjs/blob/0.5.2/src/cljsjs/boot_cljsjs/packaging.clj#L179
@micha that examples differs from ours because we use a app.cljs.edn file in resources/public.js + asset-path set. Maybe there is another example that looks more like ours?
The application seems to recognize the .map file, because it knows the file name + line, it just shows an empty file however in Chrome, so it can’t resolve the relative path it seems.
@micha seems so, they use in
string as regex to match a path, but it bork on Windows, because slash slash
I added this to our app.cljs
:
(let [x 10]
(js-debugger))
This is what I see in Chrome: https://www.dropbox.com/s/8i1sj3owd9qe9jo/Screenshot%202016-11-17%2020.20.55.png?dl=0@micha I can get the map file here: http://localhost:3700/js/app.out/dre/app.js.map, but I’m not sure if that’s the correct URL
@borkdude have you done this https://github.com/adzerk-oss/boot-cljs/wiki/Example
would be handy dandy to have a function to transform a path regex into platform agnostic path regex, ie. insert all the /|\\
@micha I’m not sure what you mean with ‘this’, specifically. We don’t output to target during dev.
this is what our js file looks like: https://gist.github.com/borkdude/2d5e4541ac0ac3a99c916765be5df4cd
https://www.dropbox.com/s/mpggdm7q3hwakpt/Screenshot%202016-11-17%2020.30.24.png?dl=0
if I open one of those files I see this: https://www.dropbox.com/s/ltbsuhyfwrpr9kk/Screenshot%202016-11-17%2020.36.47.png?dl=0
Got a reproducible project here: https://github.com/borkdude/boot-source-maps-issue
I see this: https://www.dropbox.com/s/376f0bor97yiwu4/Screenshot%202016-11-17%2021.20.33.png?dl=0
Python: https://www.dropbox.com/s/spr60iethy87bk8/Screenshot%202016-11-17%2021.22.47.png?dl=0
this is what I see when I navigate to app.js: https://www.dropbox.com/s/xy566mttoj6fthl/Screenshot%202016-11-17%2021.25.53.png?dl=0
and to app.cljs: https://www.dropbox.com/s/znual4b6t8fty3k/Screenshot%202016-11-17%2021.26.56.png?dl=0
Firefox: https://www.dropbox.com/s/vuuiqcrshqbv5ig/Screenshot%202016-11-17%2021.28.50.png?dl=0
{”version":3,"file":"\/Users\/Borkdude\/.boot\/cache\/tmp\/private\/tmp\/app\/1o3\/-ts11q9\/public\/js\/app.out\/dre\/app.js","sources":["app.out\/dre\/app.cljs"],"lineCount":8,"mappings":";AAAA;;AAEA,aAAA,TAAMA;AAAN,AACE,AAAA;;AAAA","names":["x"]}%
I’ve been using figwheel in boot by setting figwheel’s like :output-dir “figout/main.js"
and :output-to “figout/out”
and having (boot.pod/add-classpath “figout”)
and I can call start-figwheel!
from sidecar. this doesn’t pass through boot’s filesystem, but it’s working perfectly for me. Wondering if there’s potential downsides or benefits of adding it to boot’s docs or writing a simple task to do such a thing.. it’s been extremely helpful for me but I had to learn the build system to figure this simple thing out.
a new saapas project on my computer takes 700ms to reload and a more mature project I have takes over 1.3 seconds, and with figwheel it’s instnat
@naomarik Oh wow it works fine? I had many many problems with the exact same thing. I would add it to the wiki yes, it can of course be helpful, with a big warning, yesterday I had figwheel client communicating with the boot-reload
server, if I have time today (during the Clojure meetup, showing off a bit) I will continue and try to send the figwheel events on every change...hopefully this will be less of a hacky setup
I'd suggest creating a Figwheel page in https://github.com/adzerk-oss/boot-cljs/wiki with your solution, to which I will then add mine (if @micha agrees)
ya it works fine for me on a few projects i tried it on. there seems to be a lot of overhead having all the compiled JS get copied through the cache directories so initially i was doing this with a hacked figwheel using (Thread/sleep)
right before the send notification, and i had it dumping all the files into a resource path set by boot so the webserver can serve it
i don't have it in a task atm, just calling it via the repl but i think it would be very trivial to od
could even have it read in the EDN files that exist and set the figwheel config accordingly
boot-figwheel
has already the configuration and task part, I was hacking on that one for my tests
but yeah I guess it can be a new task, given the nature of it
boot-reload doesn't have to care about that, because cljs compiler already does
I am not familiar with that part yet, I will investigate it today because I need to tailor figwheel events, which require changed namespaces/files
there seems to be a diff indeed:https://github.com/adzerk-oss/boot-reload/blob/master/src/adzerk/boot_reload.clj#L164