This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-30
Channels
- # arachne (5)
- # beginners (42)
- # cider (35)
- # cljs-dev (25)
- # cljsrn (2)
- # clojure (107)
- # clojure-dev (32)
- # clojure-finland (2)
- # clojure-greece (3)
- # clojure-italy (6)
- # clojure-nl (7)
- # clojure-spec (27)
- # clojure-uk (45)
- # clojurescript (152)
- # core-async (3)
- # cursive (26)
- # data-science (4)
- # datomic (33)
- # defnpodcast (1)
- # duct (12)
- # editors (3)
- # emacs (6)
- # events (5)
- # fulcro (6)
- # jobs (1)
- # lein-figwheel (9)
- # off-topic (7)
- # onyx (7)
- # re-frame (1)
- # reagent (9)
- # reitit (31)
- # shadow-cljs (130)
- # slack-help (1)
- # spacemacs (53)
- # tools-deps (55)
- # yada (4)
I am having issues connecting to proto-repl in atom.
i connected to remote repl and executed (shadow.cljs.devtools.api/nrepl-select :app)
. Then tried to get into a namespace, but the prompt remains as cljs.user=>
it does not change to the new namespace.
If i try to access anything from that namespace it returns as nil. Any idea why this is happening. The UI works fine, the only issue is i cannot access anything in repl.
I’m playing around with shadow-cljs watch
in a docker container and the live reload is quite slow (around 10-15 seconds). I have my docker resources at CPUs: 7 and memory: 8.0 GiB. On my mac live reload is usually less than a second. It seems to detect the file changes pretty quickly and then takes forever to compile. Would this be down to docker not being as fast as my mac or something else maybe?
@caleb.macdonaldblack this is usually due to the fs-watch
not being slow. you can try setting :fs-watch {:watcher :polling}
in your shadow-cljs.edn. at the root not in the build config. should be faster at the cost of more resources used.
if thats not the slow part trying running shadow-cljs watch build --verbose
to get more timing infos about where it might be slow
I saw the issue with that and ive tried fs-watch already. I think it improved the initial detection but was still otherwise slow to compile
Ill have a look
@prabhath6 you must always (require 'lib.data)
in the REPL first. otherwise (ns lib.data ...)
will just set up an empty namespace which won't have any of your functions. to switch to a loaded namespace you should also use (in-ns 'lib.data)
instead.
After restarting my laptop my compile times have improved. Ill run locally outside docker and see what I get
@caleb.macdonaldblack which version are you on? there was a cache issue fixed recently that caused cache to get slower over time
it starts out fine but gets slower over time. regardless of running in a container or not.
We had tried to update briefly in the past but ended up with the above error
We ended up just reverting back
@caleb.macdonaldblack remove shadow-cljs, clojure, clojurescript from your deps
That’s with just the cljs bump
Nope Ill try
I had know idea the ordering mattered.
yeah transitives dependencies are weird. the first one encountered is chosen, not the latest version. lein doesn't resolve conflicts very well
Okay so there is a comparison between docker container and my mac
Also there doesn’t seem to be any difference before and after the update. But based on what you said ealier it seems like the update will help for longer running shadow-cljs processes
This could be it
I am mapping a volume here. I will try in docker without a mapped volume
I looks like it’s probably the docker configuration causing the slow downs here.
check how big .shadow-cljs/builds/caleb/dev/ana/medial_web/core.cljs.cache.transit.json
is just in case
maybe its getting bigger than it should be? but since its only happening in the container I'm just guessing a slow disk in the container
[:caleb] Build completed. (381 files, 2 compiled, 0 warnings, 0.35s)
with no mapped volume
in a container
So I think what Ill do is just map the src directories as read only volumes
Should be fast as then
thheller, do you have a patreon or some other way that we could buy you a lunch / coffee / beer? 😄
I did start to setup a patreon but kinda got stuck since I don't really know what to do with it 😉
There are also other programs in the crypto space like gitcoin or status's bounty that are interesting and easy to setup - just an FYI
Different I know but imho more effective than patreon for one time donations
More effective because the maintainer can claim the bounty/prize on issue and everybody wins :i_love_you_hand_sign:
maybe I'm missing something, but when I do an app release with some specific preloads
/`compiler-options`, my app doesn't always seem to run. It runs fine in non-release mode.
{:lein true
:jvm-opts ["--add-modules" "java.xml.bind"]
:nrepl {:port 3333}
:builds {:app {:target :browser
:output-dir "resources/public/js"
:asset-path "/js"
:modules {:main {:entries [ui-app.core]}}
:compiler-options {:closure-warnings {:global-this :off}
:closure-defines {"re_frame.trace.trace_enabled_QMARK_" true
"day8.re_frame.tracing.trace_enabled_QMARK_" true}}
:devtools {:http-root "resources/public"
:http-port 3449
:preloads [shadow.cljs.devtools.client.hud
devtools.preload
day8.re-frame-10x.preload]}}}}
The problem most probably is the re-frame-10x
-dashboard/hud. Since I'm not using devtools and dev-mode is off in release mode, there seem to be issues with that dashboard, giving a null where there shouldn't be one.
My question actually is: can you make compiler-options specific to the environment. Now, it defines some closure-defines. I'm not sure if that's the problem, switching them off when not in dev-mode, may solve the problem (I think).there's an example in the user-guide using closure defines: https://shadow-cljs.github.io/docs/UsersGuide.html#closure-defines
👍 what I was looking for (I think)
@kurt-o-sys there is also https://shadow-cljs.github.io/docs/UsersGuide.html#_release_specific_vs_development_configuration but I guess the closure-defines chapter covers that more or less too
I’m getting with familiar with existing shadow-cljs usage on a client project - is in-ns
usage supposed to be a bit slow?
unrelated - is there any documentation on using shadow w/o nREPL? i.e. I just want to run a shadow-build / REPL via Clojure code, or wire up to Component, yadda, or you are on you own?
basically shadow-cljs compile build
is identical to calling (shadow.cljs.devtools.api/compile :build)
$ shadow-cljs cljs-repl browser
shadow-cljs - config: /mnt/c/Users/thheller/code/shadow-cljs/shadow-cljs.edn cli version: 2.4.22 node: v9.4.0
shadow-cljs - connected to server
[1:1]~demo.browser=> (in-ns 'cljs.core)
nil
[1:1]~cljs.core=>
btw you can totally skip the entire npm shadow-cljs
command if you prefer to just use tools.deps + clj
clj -m shadow.cljs.devtools.cli compile build
is identical to shadow-cljs compile build
the npm package should still be installed though since it brings in some required deps like source-map-support, node-libs-browser and so on
are there any disadvantages to using the :lien true
setup with Shadow in Cursive/Idea?
btw, very excited to see David Nolen taking interest in Shadow!
I guess dependency management is a bit more complicated. the shadow-cljs
command eliminates some of the most common problems which you have to do manually with lein
I see, so it would be better to just duplicate the setup with shadow.edn + project.clj
not a big deal at all, just curious
depends. many people like running shadow-cljs embedded in the main CLJ JVM so they only have to worry about running one JVM that does it all
I prefer running things side by side since CLJ and CLJS don't really need anything from each other technically
I'm rather new to the entire clj/s game really, so I don't have any legacy preferences
up to your preference I guess. I recommend running shadow-cljs standalone since thats avoid a whole world of potential dependency conflicts
ok, but just to make sure I understand, in the docs https://shadow-cljs.github.io/docs/UsersGuide.html#_cursive it mentions that I can "create a dummy project.clj or use the full Leiningen integration". I'm just trying to understand what the tradeoffs would be
for cursive I usually just do shadow-cljs pom
and create a new project from the generated pom.xml
ok, that will handle everything then? (I'm new to Intellij as well... I actually wrote up an entire article about using Shadow with Atom, but Atom couldn't handle the amount of data I was trying to parse 😄 so I had to up my IDE)
I'm working on properly documenting all this stuff. its all a bit lacking at the moment.
yes. its mostly about properly handling dependencies and the pom.xml
takes care of that
no worries, it's a lot to take on, so many different IDEs, but shadow's been working like a charm for me so far (using NPM like a boss), so it's totally worth the time
Sorry, I'm getting Cannot import anything from C:/Users/Surface/Projects/clojure/cljs/census-geojson/pom.xml
when trying that
ah. you need to have the maven support
plugin active. for some reason that is disabled for some people.
ah, ok
That seems to have done it