This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-16
Channels
- # beginners (103)
- # boot (48)
- # cider (2)
- # clara (12)
- # cljsrn (9)
- # clojure (133)
- # clojure-art (3)
- # clojure-dev (9)
- # clojure-korea (7)
- # clojure-russia (228)
- # clojure-spec (8)
- # clojure-uk (26)
- # clojurescript (131)
- # cursive (8)
- # datomic (30)
- # emacs (4)
- # events (2)
- # hoplon (47)
- # lein-figwheel (5)
- # off-topic (1)
- # om (12)
- # onyx (337)
- # perun (23)
- # planck (15)
- # proton (3)
- # re-frame (5)
- # spacemacs (20)
- # untangled (97)
- # utah-clojurians (1)
- # yada (13)
@ag is it slower only when you edit the .cljc file or always?
Cljs compiler itself doesn't reload macro namespaces so build tools implement than themselves. Boot-cljs reloads changed clj/cljc namespaces used by Cljs code.
But that should only happen when there are changed clj/cljc files.
@juhoteperi it seemed to be slow the first time on the task run. Anyway. I decided to keep things separate, in .clj and .cljs files
First time the task runs is always slow.
Hmm, macro namespace could make that even slower. Did the cljc namespace depend on many other namespaces?
Hmm, any, even one namespace which is slow to evaluate can make this slower
In case of macro namespaces, the dependency namespaces have to be loaded to Clojure environment
yeah, I guess. anyway… as I said: I think it wasn’t great idea in the first place… it’s totally fine to keep things in separate files although it’s technically is the same namespasce
I guess I use so few macros nowadays that it is possible that I wouldn't notice if there is a problem in boot-cljs
Yep, checked a few projects and no local macros. Some dependencies of course use macros.
@juhoteperi: FWIW the ClojureScript compiler now reloads macro namespaces in watch
since 1.9.183: https://github.com/clojure/clojurescript/commit/2267a8e5e9607aff8c940fa372dbdb35816350ba
@anmonteiro Right, but build tools reimplement watch
Yeah, I'm not saying it's practical to support in tooling, just being pedantic if anyone is using cljs.build.api/watch
@ag @mulchy
>bulk of CIDER functionality does not work with cider-connect, you gotta jack-in
Sorry, but that is not true. You can set the setting: cider-cljs-lein-repl
to for example "(start-repl)”
and then you can do cider-create-sibling-cljs-repl
when you are connected to the clojure repl.
thheller: thanks! yeah, I noticed that (1) if I dump them out in a [:pre ] in hiccup, they are NOT source mapped (showing lines in .js files) -- but if I dump them out to (.log js/console ...), the console does source map them for me; I'm guessing sourcemap info is *NOT easy to do inside cljs, and is handled by the browser?
Running into an issue with testing clojurescript. I am using reagent with re-frame. I have excluded React altogether. However, when running lein doo
to test, using karma chrome, I see it cannot find React. So I added them in :cljsbuild
as a foreign lib. Is there a way to verify that the foreign lib is being loaded? It still claims Uncaught Error: js/React is missing
2) I also don't understand why you appear to be (a) removing React and (b) trying to put it back in
hwk You add it as an exclusion to Reagent in the :dependencies
and then add blank namespaces for cljsjs.react
and cljsjs.react.dom
. It works well, especially since this is used in a bigger React project.
It works in the larger react project fine. It's just adding some tests for it where it's getting problematic.
never read re-frame, but read it's documentation while trying to figure out "how do I setup a canvas module inside react" and reframe docs is like "there are three levels of reagent components; reagent only teaches you ghe first level; we teach you the third, undocumented level for wriing your own components"
I only retain a paragraph of information at a time, so I read the docs but it didn't stick until I used it.
i tried asking this in the om channel so apologies for crossposting, but has anyone used goog.cssom? i'm finding myself in need of calling a css method and seems the best way would be to use addCssRule, but i'm unsure about the syntax for the parent sheet. for example, whether i can be like (goog.cssom/addCssRule (str "#" id) (str ...))
hi, under what conditions would the following return false for a javascript obj: (map? (js->clj obj))
?
If I try to convert the object to a string in order to print it out, I get "Cannot convert object to primitive value"
But if I merely print it with (js/console.log obj)
then I get a fairly innocuous looking map/obj representation printed out
by "innocuous looking" I mean precisely the following: { artist: 'Pink Floyd', label: { name: 'labelname' } }
my guess is that there are hidden properties or something on the obj which are preventing js->clj
from fully converting it to a map (and .toString
from converting it to a string)
@johanatan Don't know what the problem is, but I suggest you enable "pause on exceptions" and walk the stack to figure out where the error is occurring in js->clj
. This should hint at what the problem may be.
I suppose you could copy the js->clj
code and add println
s everywhere to figure out where the problem occurs. Seems so archaic lol
ah, not a bad idea. 🙂 yes, definitely archaic but anything that works at this point
I suggest you look into setting up node-inspector (or something similar). Would be a huge productivity boost! 🙂
@johanatan If you are using Node 6.3 or above you could use Node's built-in inspector. See http://stackoverflow.com/a/39493551
and the only reason i thought of going this route is the need to call a css method and that seemed to not be working otherwise
i assume because it's done at hardware level. that's one reason why i'm not into css. rather opaque as to what's going on behind the scenes
@sophiago I’m confused - is there some reason you can’t just write a stylesheet? Or are you investigating whether you can avoid it?
i'm writing a function that needs to do a matrix transform on the fly and that requires calling a css method matrix()
. i'm not aware of any way to interop that with cljs
does that make sense? you pass the selectors methods: http://www.w3schools.com/css/css3_2dtransforms.asp
slider-factory is an om/factory created from a defui and then i'm setting the style in :transform
, which requires the matrix method
i didn't realize that either. so it needs to be in the defui for me to alter it later?
right. i'm more just at proof of concept with this now. but that clears things up greatly. thanks! going to try it now 🙂
@dnolen Do you know the answer to this one?: https://clojurians.slack.com/archives/clojurescript/p1479324630017613
@johanatan sorry I do not, nor do I have time to look at it right now
@johanatan what do you get if you do (.log js/console (js->clj obj))
?
@dnolen thanks again, everything is working. sort of...my bias against css is confirmed by their inability to use transform matrices in standard format 😛
"matrix(scaleX(),skewY(),skewX(),scaleY(),translateX(),translateY())" <= who thought this was a good idea? 🤕🔨
From Om.Next docs: > Previously Om attempted to mitigate deep coupling to state via the cursor abstraction. Unfortunately, cursors brought problem of their own. Is there an article/blog post somewhere detailing the problems people found with cursors? Was it asymmetrical read/writes? (asking in #clojurescript because this feels like more of a general cursor question than an Om specific one)
@kenny I think David touched on those at his EuroClojure talk last year (2015)
I'd have to watch it again 🙂
Hmm.. He does mention it at 6:00 in the video, but it's not totally clear what the problem is. He says the API is around collection access to which I inferred that he means it does not generalize to other data stores (e.g. Datascript). But it seems like if you have a "universal" cursor where an arbitrary lens can be applied to an arbitrary data structure then you do not have that problem.