This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-30
Channels
- # admin-announcements (1)
- # aws (32)
- # bangalore-clj (1)
- # beginners (2)
- # boot (137)
- # cider (2)
- # clara (1)
- # cljs-dev (39)
- # cljsrn (20)
- # clojure (268)
- # clojure-berlin (20)
- # clojure-canada (37)
- # clojure-dev (8)
- # clojure-gamedev (6)
- # clojure-norway (2)
- # clojure-russia (55)
- # clojure-spec (130)
- # clojure-uk (39)
- # clojurebridge (1)
- # clojurescript (102)
- # cursive (20)
- # datomic (231)
- # editors (5)
- # editors-rus (8)
- # events (5)
- # funcool (12)
- # hoplon (31)
- # instaparse (57)
- # jobs (9)
- # lein-figwheel (4)
- # off-topic (2)
- # om (8)
- # om-next (30)
- # onyx (241)
- # planck (6)
- # protorepl (4)
- # re-frame (115)
- # reagent (7)
- # rum (9)
- # schema (1)
- # test-check (9)
- # untangled (24)
- # yada (20)
Anyone using re-natal on Linux with Figwheel? I cant' seem to get the app to connect to the Figwheel server
Any https://github.com/Lambda-X/replumb replumb users here?
Replumb doesn't seem to handle multiple forms at once... any ideas on how to tackle this? My initial thought is to somehow read forms and eval it one form at a time .. any thoughts?
I guess I should find out how its done in planck here... https://github.com/mfikes/planck/issues/197
@cdine Since a lot of the Replumb code was derived from Planck and Planck has been updated to handle multiple forms at once, perhaps you could use it’s implementation as a guide or for inspiration. The relevant commit was probably this one https://github.com/mfikes/planck/commit/d2171b7a836ca605a936e36f636362ac415cf4dd
@cdine There is also a patch in http://dev.clojure.org/jira/browse/CLJS-1572 that provides the same functionality for the regular ClojureScript REPL, in case it is of interest.
ehem.. I’m sure this question been asked many times. I found a few solutions, find them a bit bulky. so what’s the canonical way of generating uuid nowadays?
is it possible to debug optimizations when using lein-cljsbuild
?
when using anything other then :optimizations :none
on my build, it fails
with no error, just:
Applying optimizations :simple to 138 sources
Compiling "target/js/app.js" failed.
Subprocess failed
@biscuitpants look into generated output folder, and skim those generated js sources, maybe you could spot some issue there
will give that a shot, thank you @darwin
also try to enable :verbose: https://github.com/clojure/clojurescript/wiki/Compiler-Options#verbose
yes, I believe - :preloads
is a normal key (deep) inside :cljsbuild
map, normal profile merging rules should apply
i’m gonna put my build config here, maybe i’m doing something wrong
{:id "prod"
:source-paths ["src-cljs"]
:assert false
:compiler {:optimizations :simple
:pretty-print false
:parallel-build true
:compiler-stats true
:elide-asserts true
:output-to "target/js/app.js"
:verbose true
:warnings true }}
@biscuitpants maybe try to integrate latest figwheel, it does pretty nice config valiadations, to me your snippet looks good
good idea @darwin, maybe that will give me a bit more info
@madvas ok, then :preloads
sounds like a good solution, but they work ONLY when compiling with :main
I’m just curious how you can do this using profile merging from system-global profiles.clj, :cljsbuild uses different ids so you cannot easily target all of them via some “template” in profiles.clj
nah, it doesn’t work, but I can just pass it into figwheel in REPL anyway, too bad I have to put there just namespace and not code, as in :injections
@biscuitpants seems strange to fail without error, might want to just try building with ClojureScript directly to see what’s up
@dnolen yeah just doing a plain build it works completely fine. no errors, and i get a compiled js file (which just has goog
dependencies)
but, as soon as i put in an optimization, it fails
been trying with the Google Closure jar, and that doesn’t work either. fails silently (even with all errors and warnings on)
don’t use lein-cljsbuild, use the same compiler settings and build your project with the ClojureScript compiler directly
this will tell you if there’s a problem specific to lein-cljsbuild and hopefully give you an idea what it might be
okay that’s a good idea. so using the ClojureScript compiler api
i will give that a bash
thank you @dnolen. i will let you know what comes from that 🙂
so it can’t find cognitect.transit
in one of my .cljc
files
but the dep for cognitect/transit-cljs
is definitely there
@biscuitpants During build it is likely using transit-clj
sorry, didn’t give an error msg:
Caused by: clojure.lang.ExceptionInfo: No such namespace: cognitect.transit, could not locate cognitect/transit.cljs, cognitect/transit.cljc, or Closure namespace "cognitect.transit" in file src-cljs/cognician/hex/util.cljc {:tag :cljs/analysis-error}
okay, so lein run -m clojure.main build.clj
gets me passed that error, and compiles the js
let me try with optimizations now
Does ClojureScript do something special with specs refered to in :req
when using cljs.spec/keys
? Assume I have (s/def :user/name :some-string-spec) (s/def :user/bio :some-string-spec) (s/def :user (s/keys :req [:user/name] :opt [:user/bio]))
and then do (s/get-spec :user/name)
and (s/get-spec :user/bio)
, the former returns some spec object, while the latter returns :some-string-spec
(the original keyword/spec name).
yup @dnolen back to the failing silently part again
sure thing
➔ lein run -m clojure.main build.clj
where build.clj is:
(require 'cljs.build.api)
(cljs.build.api/build "src-cljs"
{:output-to "resources/public/js/main.js"
:optimizations :advanced})
(System/exit 0)
the same setting for release.clj
as defined here: https://github.com/clojure/clojurescript/wiki/Quick-Start#production-builds ?
oh, sure
code/Cognician/Hex on customer-reporting [!?$]
➔ lein run -m clojure.main build.clj
Compile sources, elapsed time: 7812.549492 msecs
Compile sources, elapsed time: 0.093968 msecs
code/Cognician/Hex on customer-reporting [!?$]
➔ ls resources/public/js
hex
code/Cognician/Hex on customer-reporting [!?$]
➔
ah wait i see a problem with my build.clj
since i copied it from the project.clj
1 second
okay, updated both build.clj and my shell interaction @dnolen
@biscuitpants I don’t see any errors in that terminal output
So we are including our script on a third-party site that has an AMD module loader (which we have no control over) - this is breaking anything we include that uses the UMD style (typeof window.define !== undefined). Specifically we are getting React is not defined
. Now we solved this by wrapping the script and setting define
to null
. Is there a neater way to do this perhaps?
I don't think there's a neater way to do it... you can't assume anything about the isolation of your script on third party sites
Ok, my spec issues earlier are caused by defining the same spec, e.g. :user/name
, in two different namespaces and then having one taking priority while expecting the other would be used.
@dnolen - one way which would have convenient at least would be allowing :output-wrapper to be a template string rather than true/false
Worth raising a bug/PR?
@am-a_metail no template strings, but I guess we could allow it to be a function which returns a string
I’m trying to do something like ((resolve ‘my-other-ns.foo) args)
where `my-other-ns isn’t known ahead of time
except resolve
isn’t supported in cljs, so I was thinking about some sort of hack with aget
, which means I would have to explicitly ^:export
anything ns needs referencing… which makes me think this is not the best way to go about it.
hmm, i dont know enough about multimethods to know what that means.. but ill take a look thanks @jr
it certainly feels like that.. bummer, but I’m sure i can come up with something. wanted to make sure this wasn’t a solved problem first. thanks!
Hey folks..in order to get the Clojurescript docset bumped to the official Dash/Zeal server, we need ~40 emails to
. The Clojurescript docset is maintained by @shaunlebron and especially nice because it contains a lot of examples (personally I use it instead of the Clojure one, in conjunction with zeal-at-point
for emacs). We are a lot here, I guess we don't want to flood the thing, but please support: https://twitter.com/richiardiandrea/status/770713244197593089
thanks @richiardiandrea, I’m aiming to have the newest docset reflect the new site soon
might be easier to ask for support when the docset is actually up to date with latest version
so i’ll start helping to petition for that when that’s done
does the cljs compiler support any sort of metadata tagging to ignore-warning for particular lines?