This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-06
Channels
- # adventofcode (99)
- # announcements (9)
- # aws (3)
- # babashka (22)
- # beginners (90)
- # boot (2)
- # calva (22)
- # cider (8)
- # clj-kondo (14)
- # cljsrn (20)
- # clojure (24)
- # clojure-europe (4)
- # clojure-italy (3)
- # clojure-losangeles (1)
- # clojure-nl (83)
- # clojure-spain (1)
- # clojure-spec (46)
- # clojure-uk (43)
- # clojuredesign-podcast (70)
- # clojurescript (40)
- # cursive (25)
- # datomic (9)
- # duct (3)
- # emacs (14)
- # figwheel-main (2)
- # fulcro (61)
- # graalvm (8)
- # juxt (7)
- # kaocha (2)
- # leiningen (19)
- # luminus (5)
- # malli (58)
- # off-topic (4)
- # re-frame (11)
- # reitit (5)
- # rewrite-clj (3)
- # shadow-cljs (63)
- # sql (5)
- # testing (5)
- # tools-deps (26)
- # uncomplicate (2)
- # vim (4)
Hello folks,
I am trying to compile a production release with this command :
clojure --main cljs.main -co '{:closure-defines {"clojure.browser.repl.HOST" "192.168.10.12"} :optimizations "advanced"}' --compile cljs-sample-proj.core
I am getting this error :
Unexpected error compiling at (REPL:1). Could not write JavaScript nil
I also tried clojure --main cljs.main -co '{:closure-defines {"clojure.browser.repl.HOST" "192.168.10.12"}}' -O advanced --compile cljs-sample-proj.core
and
clojure --main cljs.main -O advanced -co '{:closure-defines {"clojure.browser.repl.HOST" "192.168.10.12"}}' --compile cljs-sample-proj.core
. Both of these gives the below error :
Dec 06, 2019 8:51:05 AM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: WARNING - unknown @define variable clojure.browser.repl.HOST
Dec 06, 2019 8:51:05 AM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 0 error(s), 1 warning(s)
How do I get this to work please ?
Thanks!
Also, maybe fore future reference and especially if you want to use NPM libraries, consider using shadow-cljs - it does many sensible things for you.
Regarding unknown @define variable
- that's because you're compiling the app and not running a REPL on it. The variable is defined within the REPL source which is not used during a simple compilation.
So, to just compile the app, you should omit this particular entry in :closure-defines
.
@U2FRKM4TW - Thanks! Actually, my intention is to build a production release and then execute a clojure -m cljs.main --serve
. So, without :closure-defines
the server starts at default localhost:9000, whereas I want it to start at my required network IP. Actually, am just trying to follow the clojurescript guide to get a feel of the things. Will definitely use shadow-cljs as I proceed further
clojure.browser.repl.HOST
is for REPL only. It doesn't affect the way you serve your files in the production.
Try --serve host:port
, as the help available at clj --main cljs.main -h
suggests.
Hi all, Has anyone ever been able to use cljsjs/delaunator? I have tried multiple combinations of (js/Delaunator.from. [[1 2] [2 3] [1 5] [2 4]]) with different point formats (including the one in the example (<https://github.com/mapbox/delaunator>), which is [[1, 2], [2, 3], [1, 5], [2, 4]]. It seems from is not to be called as prototype values as described here (<https://github.com/cljsjs/packages/wiki/Using-Packages>) because of how the externs are defined here (<https://github.com/cljsjs/packages/blob/master/delaunator/resources/cljsjs/delaunator/common/delaunator.ext.js>). The output is : #object[Error Error: No Delaunay triangulation exists for this input.], although the points are not aligned... What am I doing wrong? Thanks!!
Using (js/Delaunator.from. or (js/Delaunator/from without '.' doesn't even change the error message...
holy hell you're right...it works. Well I am not getting any error. Any idea how to access hashedges from there? Cause the externs contain functions but for instance I can't even find in the original index.js the _hashEdge one
As soon as I see the words "externs" or "cljsjs", I immediately go to shadow-cljs for the help. 🙂 And then I can actually start working instead of yak shaving.
turned out halfedges are properties of the js object, so (.-halfedges Object) worked 🙂 thanks again!!
Hi, Do clojure and clojurescript code are interchangeable? I mean, if i write a program in clojure (that only use the core language features), can i simply change the dependency on clojure by clojurscript an it will work?
roughly @U2KGTH1EG - there are often small differences to take account of
This might help? https://clojurescript.org/about/differences
i recently updated an old project to figwheel 0.5.19, which seems to have caused it to break somehow. files aren't correctly reloaded in the browser, and i'm presented with Figwheel: error loading file
message in the console
i tried increasing :time-in-ms
option on the server to eliminate a basic timing issue, this looks like a browser issue however
when I make a change, every file that change touches seems to time out independently when attempting to reload in the browser
Hi all, anyone knows how to get the value at index n of Uint32Array? I can't get the syntax right, and can't find any helpful function or property in here : https://cljdoc.org/d/clojure-interop/cljs-web-api/1.0.4/api/js.Uint32Array
@mehdihajjam (aget array n)
seems like aget is not on cheatsheet https://cljs.info/cheatsheet/
yeah, it is only in Clojure Cheatsheet https://clojure.org/api/cheatsheet
I am trying to use js/MaterialUIStyles.makeStyles
with react/rum/citrus
It seems to be absurdly fiddly because
• https://material-ui.com/styles/api/#makestyles-styles-options-hook ONLY works as a React hook
• rum/defc
will ONLY give me a plain-function component (suitable for hooks) if I avoid any kind of mixin complexity
Is there a known way to make this less awkward?
would like a non-breaking space in a string. should be "\xa0" and this works in the javascript console. However, clojurescript is just a clojure program and "\xa0" and this is an unsupported escape character. A workaround is (char 160)
but wondering if there was a more elegant solution?