This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-20
Channels
- # announcements (5)
- # beginners (37)
- # calva (3)
- # cider (23)
- # clojure (98)
- # clojure-dev (16)
- # clojure-europe (5)
- # clojure-italy (4)
- # clojure-nl (5)
- # clojure-spec (7)
- # clojure-uk (52)
- # clojurescript (14)
- # cursive (15)
- # data-science (1)
- # datomic (20)
- # emacs (7)
- # flambo (2)
- # fulcro (10)
- # jackdaw (1)
- # jobs (3)
- # joker (2)
- # juxt (3)
- # keechma (3)
- # leiningen (8)
- # luminus (3)
- # music (1)
- # off-topic (83)
- # pathom (19)
- # re-frame (19)
- # reitit (4)
- # shadow-cljs (76)
- # spacemacs (95)
- # tools-deps (16)
shadow-cljs compiles the RegExp has some problems, such as following code:
(let [v (js/RegExp. "^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^]{8,16}$")]
(.test v p))
Then there is a compiler error:
main.cljs [line 55, col 54] Unsupported escape character: \d.
Yes, RegExp
seems doesn't work for this, but #
does, please try it. And shadow-cljs can't compile "#" pattern too.
Hey, @thheller! I'm getting The shadow-cljs ClojureScript REPL is not available
from CIDER with the new [email protected]
Do I need to change something?
Looking at this code: https://github.com/clojure-emacs/cider/blob/15c4ef0aca4d709e70a70f556a8dfb3ff6a49497/cider.el#L696-L699
@malch I just released [email protected]
which brings back that ns for cider. doesn't do anything but should fix the detection.
@thheller I'm sorry to bother you, but I have search much about RegExp in cljs. It looks like a compiler fault, which doesn't support some formats of the RegExp
? 😂
@180338742 the error you posted is the reader complaining. has nothing to do with regexp. you probably just need to escape the string properly?
hey @thheller I've made some progress with three.js + expo + shadow-cljs. I'm however experiencing some lag. it might be because I'm producing a lot of objects, but I also wanted to ask how much :compiler-options {:optimizations :advanced}
affect this. when running shadow-cljs release app
I had to set them to :simple
in order to get the app to run. would this affect performance a lot?
I've looked a bit at externs for three.js, and it seems possible to autogenerate them. however when I use :compiler-options {:infer-externs :all}
I get some 400 warnings. it'd take some time to fix those, so I just wanted to ask beforehand if you knew if there'd be any significant performance (in terms of fps) gains, or if I should focus on other things (e.g. not creating as many objects per frame)
I think the performance is OK when building however (using `expo build:android), so maybe it doesn't matter that much
@saikyun as the manual mentions, don't use :infer-externs :all
. :auto
is enough and all you can fix anyways.
:advanced
will be "smaller" so it'll probably load faster. runtime performance should be the same as :simple
also make sure you do performance testing with expo dev set to off
I think in dev mode there’s a lot more things going on
If I'm requiring in ["@material-ui/core/styles" :refer [makeStyles]]
, what's the fully qualified name of makeStyles
since @material-ui.core.styles/makeStyles
will try to deref?
Is anyone successfully using CIDER with shadow-cljs? Every time I try to cider-jack-in-cljs
I get a REPL which tells me:
No application has connected to the REPL server. Make sure your JS environment has loaded your compiled ClojureScript code.
Try cider-connect-cljs
instead of jack-in, emacs will ask you a few questions like host, port, and type (i don't have access to my cljs environ so I can't be specific)... you'll give it for ex localhost
8888
shadow
and your shadow target code like dev
or app
or however you set it up
and make sure your browser is up and running & talking to your shadow command after you do the shadow-cljs watch [app]
@thheller how do I start the runtime if it's node, not the browser?
@chepprey I've tried both ways, it does not seem able to connect when I enter the nREPL port number output by npx shadow-cljs server
. There is no browser here, this is node.
> 14.3.2. :target :node-script, :node-library These targets will have produced a .js file that are intended to run in a node process. Given the variety of options however you’ll need to run them yourself. For example a :node-script you’d run via node the-script.js and on startup it’ll try to connect to the shadow-cljs server. You should see a WebSocket connected message on startup. The output is designed to only run on the machine they were compiled on, don’t copy watch output to other machines.
Hmm. It does not ask me for a build when I connect, only when I start from within CIDER with cider-jack-in
.
and the REPL I get when I run cider-connect-cljs
and put in the nrepl port number output when running shadow-cljs node-repl
is a Java REPL
@enn i use cider-connect-cljs
then set the host
and port
then choose the cljs repl type as shadow-select
then give the node-repl
build
that puts me straight in a cljs repl
OK, that's good to know. After choosing shadow-select
I get error in process filter: Wrong type argument: stringp, nil
in the minibuffer, and I never get to choose a build. So likely I have some package version mismatch somewhere. The story of Emacs....
to do a plain node-repl
in Emacs (basically, a CLJS REPL without an associated build) I do:
1. cider-jack-in
which lands me in a CLJ REPL
2. (shadow/node-repl)
which lands me in a CLJS REPL where I don’t need to start an external process like node path/to/build/output.js
or a browser window
from there i can also type :cljs/quit
to go back to the CLJ REPL and start/stop/REPL in to my other builds
in other news, I’m attempting to transition a lein-figwheel project to shadow-cljs and it is rough
lots of cljsjs I have to proxy myself, several of which don’t have exact same versions on npm… shadow-cljs actually using the core specs on our bad code… etc. 😛
the code:
(condp = tag
...
:clojure.spec.alpha/invalid
(throw (ex-info
"Visual Segment Value Was Invalid"
{:value value
:explain-data (spec/explain-data :visual-segment/value value)})))
the error:
478 | (condp = tag
-----------^--------------------------------------------------------------------
Syntax error macroexpanding cljs.core/let.
Call to cljs.core/let did not conform to spec.
-- Spec failed --------------------
([... :clojure.spec.alpha/invalid ... ...] ...)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
should satisfy
any?
-- Relevant specs -------
:shadow.cljs.devtools.cljs-specs/bindings:
(clojure.spec.alpha/and
clojure.core/vector?
shadow.cljs.devtools.cljs-specs/even-number-of-forms?
(clojure.spec.alpha/* :shadow.cljs.devtools.cljs-specs/binding))
-------------------------
Detected 1 error
do you have something reproducible? (condp = tag :clojure.spec/invalid :foo)
works fine
https://clojure.atlassian.net/projects/CLJ/issues/CLJ-1966 Created June 21, 2016, 4:02 PM 😞
@lilactown workaround: (def INVALID :clojure.spec.alpha/invalid)
and then use INVALID
in the condp