This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-18
Channels
- # admin-announcements (13)
- # announcements (1)
- # aws (17)
- # beginners (1)
- # boot (113)
- # cider (71)
- # cljs-dev (7)
- # clojure (93)
- # clojure-android (2)
- # clojure-berlin (1)
- # clojure-dev (22)
- # clojure-italy (3)
- # clojure-japan (1)
- # clojure-poland (41)
- # clojure-russia (96)
- # clojurescript (140)
- # cursive (11)
- # datomic (27)
- # devcards (1)
- # devops (1)
- # events (4)
- # funcool (3)
- # hoplon (133)
- # immutant (7)
- # ldnclj (22)
- # leiningen (5)
- # off-topic (6)
- # om (22)
- # onyx (12)
- # re-frame (8)
- # reagent (12)
@bhauman: If I wanted to make a patch to invalidate compiled files when deps change or other similar issues, whose court would that ball be in? Leiningen, Cljs compiler, or figwheel?
@danielcompton: this falls squarely on the compiler. But this is something that is being worked on as far as I know.
@afhammad: I’ve seen those kinds of errors when I’ve reloaded a page halfway through a figwheel recompile, not sure if that’s the case here
@danielcompton: doesn’t seem so
@afhammad: have you looked at the generated js? Turning source maps off and see what's actually being generated could help. My guess given the limited info is Figwheel is reloading file and the browser is choking on the generated js
@bhauman: ok trying. btw is "notifying browser that file changed: ..” the last thing fighweel outputs?
@bhauman: when I get an Java exception in the Figwheel REPL, the whole REPL has to be restarted. Is this the normal behaviour?
I'm using re-frame for a project and I'm having a bit of trouble as to how I should store the data and what the subscriptions should look like. Can someone help me out?
@lancefalcon: There is a #C073DKH9P channel, state you questions there
@profil: alright, thanks!
nice feature for chrome would be, if content-type of response is application/edn, have a tree like inspector like we have with json
@danielgrosse: that is a bug that's fixed in 0.4.0
how does one invite new users? for example <mailto:[email protected]|[email protected]>
@bensu I didn’t think you needed an invite? just goto http://clojurians.net
Hi @vikeri! Nice meeting you two :)
!Build problem! I've started to use Reagent and can't start my web app with an advanced mode optimization - my page is blank, there are no error messages in console. But if I use a whitespace mode optimization it's OK. I think the problem in minification, but I don't understand where to start. Could someone help me?
Any warnings during compilation? @abtv
Also try adding a top level log statement
@martinklepsch: Yes, you are right. I made lein do clean, cljsbuild once
and received ERROR: JSC_INVALID_CLOSURE_CALL_ERROR. Closure dependency methods(goog.provide, goog.require, etc) must be called at file scope. at /Users/andrew/work/blog/resources/public/js/out/figwheel/client/file_reloading.js line 979 : 7
OK. Could you give some example of such config file with several build settings (dev/production)? I can remove figweel from project.clj, but I think it's a bad way.
I see. I have :profiles -> :dev section and there is :figwheel {:http-server-root "public" :server-port 3449 :nrepl-port 7002 :css-dirs ["resources/public/css"] :ring-handler blog.handler/app}
@abtv: it's hard to know what you env is. I would need to know more about your setup.
@bhauman: build works as a trigger on lein uberjar, but I still can't understand what to remove
@abtv: so the problem is that you are sharing the same directories between dev and prod. This is a bad idea.
I really don't recommend using profile merging to overload a single build config. better to have explicit build configs.
You should have two builds and as many profiles as you need. But make sure that you have separate :output-dir for each build
@abtv: btw you can do a prod build within the figwheel repl (clean-builds)
(build-once prod)
@dnolen: depending on the size of the job cursors are pretty awesome, the contextual update is sweet as heck. I think there is a size correlation to these strategies really small -> single-atom passed around small, medium -> cursors help tremendously freaking huge ... anticipating unbounded growth -> relay, falcor
@bhauman: Running into an issue using figwheel 0.4.0 with NRepl - following instructions from Github, works in 0.3.9 but in 0.4.0 get the message
cljs.user=> DEBUG: unknown status need-input
Also doesn't print any response when evaluating an expression
@shaun-mahood: you should read the changelog And we should update the wiki
Oh no, I'll do that again - read the changelog earlier but didn't think to reread it
I always end up reading changelogs and only remembering the new stuff, not what I actually need to know
@shaun-mahood: you need to include piggieback manually now. You'll see
@bhauman: Ok, threw [com.cemerick/piggieback "0.2.1"]
into my dependencies, getting the message
Started Figwheel autobuilder
WARNING: unable to load "cemerick.piggieback/wrap-cljs-repl" middleware
when running lein figwheel
, and after running (cljs-repl)
it gives me the message INFO: nREPL connection found but unable to load piggieback. Starting default REPL
.did you put it into the :figwheel { :nrepl-middleware ["cemerick.piggieback/wrap-cljs-repl"] }
I just added that, no luck though - get the same error messages.
@dnolen: what's the rationale behind the compiler taking a Closure lib from :libs
and putting the contents of that dir relative to :output-dir
(which would result same-named in files like index.js
colliding)? Is it just an arbitrary decision or would anything break if I put files in a subdirectory? I mean, it compiles fine if I do that, but maybe something I'm not aware of will subtly break. (yes, still playing around with putting lib conversion in the compiler, want to have a more solid understanding of how things work before I bother Maria for her opinion)
@shaun-mahood: it sounds like the dependency isn't available. So connect the nREPL as you normally would, don't call (cljs-repl)
and try to (require 'cemerick.piggieback)
and see what happens. If piggieback isn't available you need to get that working. Thats outside of figwheels scope
@bhauman: Yeah, I must be doing something wrong with incuding piggieback. If I can figure it out I'll update the wiki with what is needed for 0.4.0
@shaun-mahood: try adding it to the :dev
profiles :dependencies
and are you on lein 2.5.2?
@bhauman: Still on Lein 2.5.1, so maybe that's the problem.
@bhauman: Looks like it works now, just had to follow the instructions from the piggieback page - adding the :dev
profiles part from there worked with Lein 2.5.1.
Did get a message DEBUG: unknown response keys :printed-value
after it printed the response in the cljs repl, though - anything I should look into there?
@bhauman: I'm using nREPL with Cursive, but am inf-clojure curious - going to have to get the cursive repl working too though
@shaun-mahood: I have no idea what that is about.
@shaun-mahood: you can use the other method as well that doesn't use nREPL https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL
@bhauman: Yeah, I'm planning on migrating to it at some point - figured I'd get this working so other people who are using nREPL but not cursive can use it too
@bhauman: Nope, only me here - pretty wonderful, I get to pick the language and tools and get paid for it. Just want everyone to be able to use figwheel
@dnolen: basically, if I have somedir/library1
and somedir/library2
specified in :libs
then lib-rel-path
will treat that as lib-path
and strip it from the path of each file in the given library, which will result in somedir/library1/samename.js
and somedir/library2/samename.js
colliding in out-dir
, since both will get out/index.js
output path assigned.
What I was asking if there's anything in the compiler that depends on this behaviour or if I can safely add a directory to that, so they will result in different paths like out/library1/index.js
and out/library2/index.js
. To my understanding of the compiler this shouldn't be a problem since load-library
basically globs the dir and then resolves module names and dependencies by parsing the ns
macro, but I'm all fresh to this, so I want to make sure.
but I also don’t see how they could depend on it, people don’t generally care about the contents of output-dir
I don't mean people, I mean other code in the compiler (current implementation of module conversion puts the files in out-dir
and then adds them to :libs
and I follow that so far, which results in files being put in the root of out-dir
) - my understanding of it is it doesn't care about directory structure (since it just globs the lib-path
), but wanted to make sure.
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj#L1214-L1217 is the relevant code
Unless you should not be giving the library root directory to :libs
but the parent directory and I'm doing it wrong.
@bhauman: Looks like the debug message is something weird from having cider-nrepl in my lein profile from long ago - so super out of scope and not related to anything important. Probably safe to say that everything works with lein 2.5.1, too. I also managed to get it to work without adding :nrepl-middleware
to my figwheel config. Wiki is updated with what worked for me.
@shaun-mahood: it should work without :repl-options middleware as well
argh. I'm going crazy running in circles on this. I simply cannot figure out why lein uberjar
is building in dev mode and including all the public/js/out/goog
files:
:profiles
{:uberjar [:profiles/production
{:omit-source true
:env {:production true}
:hooks [leiningen.resource
leiningen.cljsbuild]
:cljsbuild {:jar true
:builds
{:app
{:source-paths ["env/prod/cljs"]
:compiler {:optimizations :advanced :pretty-print false}}}}
:aot :all}]}
It's not picking up the additional :source-paths
entry:
Compiling "resources/public/js/app.js" from ["src-cljs"]...
@curtosis: why not just make an explicit :prod
build and for goodness sake make a different :output-dir
for your prod build
@bhauman: it was surprising; I was aiming for composite profiles, though I think I was doing it badly.
@bhauman: when you say add a :prod
build, you mean in the :cljsbuild.builds
map? parallel to :app
?
more seperate builds and directories, less chance of having files that you don't want included in your build
and then in (say) my :uberjar
profile, the :cljsbuild.builds
map would also reference :prod
instead of :app
, right? just checking to make sure I'm following.
but I'm assuming that it you are calling cljsbuild once, you will need to make sure that cljsbuild is being called with prod
@bhauman: yeah, that's where I need to dig. declaring it in the :uberjar.cljsbuild.builds
map doesn't necessarily mean it's getting invoked.
(sometimes = I've tried adding that step in my dance to try and figure out what's building which way.)
which is not helped by the fact that I have to ultimately build an uberwar
, which also has its own profile merging issues.
Hmm, looks like stuartsierra/component
supports ClojureScript as of an hour ago or so: https://github.com/stuartsierra/component/blob/master/CHANGES.md