This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-08
Channels
- # beginners (76)
- # boot (13)
- # cider (3)
- # clara (7)
- # cljs-dev (254)
- # cljsrn (5)
- # clojure (20)
- # clojure-austin (2)
- # clojure-chicago (4)
- # clojure-dev (7)
- # clojure-russia (5)
- # clojure-spec (18)
- # clojurescript (68)
- # cursive (8)
- # datascript (3)
- # datomic (8)
- # garden (1)
- # hoplon (3)
- # lambdaisland (4)
- # luminus (20)
- # mount (19)
- # off-topic (30)
- # om (10)
- # onyx (8)
- # parinfer (14)
- # precept (7)
- # reagent (9)
- # unrepl (3)
- # untangled (72)
- # vim (4)
- # yada (1)
@anmonteiro
(let [x (js-obj)] (aset x "foo/bar" 33) x)
Why this works on lumo
, but throws exception on figwheel+chrome
@wilkerlucio not just for that. Could get folded into next release if patch provided
Try (set! *print-namespace-maps* true)
and then *print-namespace-maps*
to see if it "takes". There might be an odd nREPL issue setting this dynamic Var.
cursive repl somehow always overwrite this var... on rlwrap lein figwhell
it works....
I will debug. Thanks ;D
Patch applied to the ticket if you need to temporarily get around this some other way. See http://blog.fikesfarm.com/posts/2016-02-22-trying-clojurescript-paches.html
@dnolen I saw there is a patch there, but not sure if that already fix the issue
The patch is not correct
Was an attempt to play around with the issue
gotcha, thanks for the clarifications
I have an image-url . It loads fine when I add a new element: [:img {:src image-url}] However, instead of adding the image to the page, I want to get the data of the image as a Float32Array. What is the best way to approach this ?
when using reagent/react, is there a way to update an image without base64 encoding the data ?
@thheller how do I disable devtools in a "watch" build targeting node-library? I'm not allowed to install "ws" package to my project
@myguidingstar :devtools {:enabled false}
in your build config
thanks. I tried {:autoload false}
instead 🙂
actually it's not nodejs but a similar engine and no native dependencies is allowed
btw, how do I specify dev/cljs-runtime
directory to somewhere else? @thheller
@myguidingstar :output-dir "some/path"
in the build
interesting, I thought about reworking the node stuff to be a little more generic and not just for node
@thheller will shadow-cljs support different :dependencies and :src for different builds?
my node module breaks because of some browser-specific deps I set for another build targeting browser
that's strange. I keep seeing "XMLHttpRequest is not defined"
hmm, I removed the deps but they still remain. How do I clean build cache?
:node-library
ok, then shadow-cljs will follow all your :exports
and only include namespaces that where required somewhere
right. I'll find the problem somewhere else...
@thheller what about cljsjs deps that tell compiler to preamble some js files?
I think that causes unwanted js names in my node module's output
@myguidingstar which cljsjs package? I can take a look
never mind. I understand how cljsjs works now
Does anyone get "Namespace xxxx does not exist" when they compile or load a file that requires the namespace xxx with cider in emacs? The file does exist and the compiler outputs a fully working build with no errors. The stacktrace drills down to a call to cljs.closure$source_for_namespace.invokeStatic(closure.clj:707) so it looks like the compiler from emacs isn't aware that the source code for the file does? Any ideas?
@qqq It seems you have to use base64 for binary data, according to https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
Another option might be to use a <canvas>
tag
@assoc-in doesn’t seem like an Emacs or Cider thing - your project must follow Java classpath conventions
@dnolen It turned out to be something odd with running cider-jack-in-clojurescript on my setup. I was able to debug it with the help of @yogthos in the #luminus channel. I am using the following and I don't have Namespace not found errors anymore. Thanks for the reply! 0. Cider-jack-in 1. run (start) in clj repl 2. run lein figwheel in terminal 3. run cider-connect "localhost:7002" 4. in this new repl run (cljs) 5. in that new repl run (M-x eval-expression "(setq cider-repl-type "cljs")") 6. Cider commands such as C-c M-n and C-c C-k work now!
@assoc-in wow that's a weird one. I've run into issues like that before with cider, one of the reasons I switched to the Emacs inf-clojure
@assoc-in I was facing that exact issue last night and it was driving me crazy! I'll try the steps you listed
probably the same as https://github.com/clojure-emacs/cider/issues/2028, although my directory path was just src and test
@jsselman Looks quite similar to what I was facing. I am thinking that it could be a bug in figwheel-sidecar, since that step is skipped by running figwheel from the terminal and then connecting to it via cider. Also I lost tab complete by doing my workaround.
how can i use closure compiler dead code elimination at its maximum with clojurescript ? what's the best practices to require my namespaces
@lxsameer I’m afraid your question is too general and unlikely to get good response. ClojureScript does good job out of the box but there still can be specific (corner) cases where DCE is prevented unexpectedly. To my knowledge it is not really dependent on how you structure your namespaces. It is more dependent on what code constructs do you use and what is the shape of resulting javascript.
I would recommend you to compile your project in :advanced mode with source-maps enabled, and use a tool like https://github.com/danvk/source-map-explorer to explore results.
When you get to a point where you see some dead code you can experiment with different code to identify the problem. But it is a daunting work. For example here I went through similar workflow and identified a few cases where DCE was prevented: https://github.com/binaryage/cljs-devtools/issues/37
thanks, In general i was wondering whether to prefer referring to a function or requiring the whole namespace as a symbol and user something like symbol/fn
to address a function.
not sure what you exactly mean by “requiring the whole namespace as a symbol”, but in general you should be writing dumb code, something which will map nicely for google closure compiler to understand it fully