This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-14
Channels
- # beginners (53)
- # cider (10)
- # cljs-dev (23)
- # cljsrn (25)
- # clojure (68)
- # clojure-italy (4)
- # clojure-spec (25)
- # clojure-uk (7)
- # clojurebridge-ams (1)
- # clojurescript (10)
- # cursive (20)
- # datomic (21)
- # duct (4)
- # fulcro (1)
- # graphql (4)
- # hoplon (1)
- # java (7)
- # luminus (9)
- # off-topic (111)
- # om-next (2)
- # onyx (14)
- # re-frame (3)
- # reagent (9)
- # shadow-cljs (182)
- # test-check (32)
- # tools-deps (53)
- # uncomplicate (1)
- # vim (94)
- # yada (2)
The emacs cider integration looks solid: https://github.com/clojure-emacs/cider/blob/master/cider.el
@thheller, I'm really struggling with advanced optimisation of JS-on-classpath (which in turn imports other libs); it starts renaming attributes like crazy, breaking all sorts of things, because I think the JS-on-classpath itself gets optimised separately from its imports
@thheller,is there some way of making that work? would it work any differently if my JS-on-classpath was a separate node module instead packaged up with rollup or so?
@alex340 js on the classpath is optimized. so you'd need to write externs for JS interop since they can't be inferred by the CLJS compiler.
my JS-on-classpath is effectively a wrapper around slate (the editor thing), which in turn brings in immutablejs
File: /home/alex/code/dlt/src/gen/slate-code.js:99:19 Property endBlock never defined on _change$value
out of curiosity - should I do that for the ones coming from clojure bits & pieces as well?
for your code it would be better to do https://shadow-cljs.github.io/docs/UsersGuide.html#infer-externs
yea, my bad, I think. was just trying to optimize things out manually, and I think defparser (the macro) actually needs instaparse.core ns
didn't realize the externs problem was so simple. spent a few hours last week messing up with weird jsdoc strings to tell closure about types
a question about those Cannot infer target type in expression
- from what I read in the shadow-cljs doc the other day, you can effectively get rid of them by marking them with ^js metadata - however, is that really required when the whole thing ends up going through closure?
for example, it complains about some like getToken, which are provided by the google closure library, which presumably will get mangled the same way, so should just work?
isn't this mentioned in the docs? you can tag it with ^goog
or ^clj
to make the warnings go away
in rare circumstance if could become a problem if you tag something not-cljs with ^clj
I think it's all clean now, apart from some noise coming in from reagent, instaparse, goog/base and cljs internals
even though there is no warning about it, adding renderMark to the externs list fixes it
(renderMark is a prop to slate's react editor component, and the function I was passing in for that prop was not getting called)
yea, doing a diff of the builds with/without that shows that there's two props getting messed up for some reason - renderMark and decorateNode
is there any reason why most props would map fine, but some would get mangled like that?
renderNode, renderMark and decorateNode look pretty similar, yet the latter two get mangled but the first one is ok (and so are all other props on that thing)
hmm looks like it might be related to the name being identical to the value maybe? renderMark: renderMark,
try this. if that fixes the decorateNode
issue we can probably try to create a minimal repro and report to the closure compiler
dunno where renderMark
is coming from but if you can change the name for that var as well try that too
renderNode:renderNode$$module$gen$editor(_this.props.readOnly), renderMark:renderMarkFoo$$module$gen$editor, decorateNode:function decorate() {\n return undefined;\n }, value:_this.props.value,
i just cannot get my vim-fireplace to work, and I have no idea where to look next.
1) start a shadow server
2) from inside a .clj buffer connect via :Connect <nrepl://localhost:port>
3) I can now use :Eval (+ 1 2)
and get 3 (yay the connection to nrepl works)
4) cannot use :Eval
from inside a .cljs buffer (always spits out Fireplace: class clojure.lang.Compiler$CompilerException
)
5) from a .clj buffer run shadow...api/watch :app
— get back :watching
— success!
6) connect to the js environment by opening a browser
7) still no Eval in a .cljs buffer
8 ) from a clj buffer run shadow...api/nrepl-select :app
— get back [:selected :app] — success!
9 ) from a clj buffer :Eval (js/alert)
yay it works
10 ) still nothing works from a .cljs buffer
the reason i’m asking here is because fireplace works with lein’s nrepl, and I can eval from a .cljs buffer, but i just can’t figure out the differences between repls
i’m not sure where piggieback fits in — my understanding was nrepl-select :id
was going to already put me in a cljs environment?
it puts you into a CLJS environment on the server yes but the client might also need to update something
:Piggieback [{env}] Create a new nREPL session and invoke
cemerick.piggieback/cljs-repl with the given or
default (Rhino) environment. This will also happen
automatically on first eval in a ClojureScript buffer
if not invoked explicitly. If {env} is a number, the
piggieback repl-env will will use a cljs.repl.browser
(rather than a Rhino) env with the port set to the
number provided.
thanks again my man. do you have a patreon (or equiv) setup for shadow-cljs by the way?
kind of. I set it up but didn't tell anyone because I'm not really sure I want/how to do this.
a few days ago you mentioned that you do or dont have plans to allow running a shadow clj(s)-repl with an alternative default namespace (like how cli-tools’ clj automatically picks up the user
ns? I can’t remember which.
the reason I ask is I basically just want access to the 3 spec generator namespaces required to do generative testing in a repl - test.check.generators, spec.alpha, spec.gen.alpha
isn’t the “client” the process invoking shadow-cljs clj-repl
(assuming you already have a server running in the background)?
I get one and just one warning: Use of undeclared Var clojure.string/join. Some libary is using clojure/string. I'm not but thats ok. However the hot reloader gives the compiler warning every time I make a change and messes up the hot loader. I tried to add :warnings false in the compiler-options but still get the warning after compilations. How to turn compiler warnings off?
@larshelg it should only warn once for code that lives in jars by default. if the warning is in a file on your classpath you'll need to fix it.
I see. I will take a look. So there is no way to simply turn warnings off? If not permanently just for hot reload?
jepp this: #object[java.net.URL 0x29a2b3d7 "jar:file:/Users/larsstrand/.m2/repository/rewrite-cljs/rewrite-cljs/0.4.4/rewrite-cljs-0.4.4.jar!/rewrite_clj/parser/string.cljs"]
if you take the file out of the jar. put it in your classpath. and fix the warning 😉