This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-08
Channels
- # aleph (52)
- # beginners (74)
- # boot (8)
- # cider (4)
- # clara (3)
- # cljs-dev (1)
- # cljsjs (2)
- # cljsrn (1)
- # clojars (2)
- # clojure (300)
- # clojure-argentina (1)
- # clojure-dev (9)
- # clojure-italy (10)
- # clojure-nl (1)
- # clojure-russia (77)
- # clojure-sg (9)
- # clojure-spec (38)
- # clojure-uk (70)
- # clojurescript (108)
- # core-async (12)
- # cursive (9)
- # data-science (4)
- # datascript (7)
- # datomic (37)
- # defnpodcast (4)
- # emacs (11)
- # graphql (6)
- # jobs (3)
- # jobs-discuss (1)
- # juxt (3)
- # keechma (1)
- # klipse (4)
- # lein-figwheel (1)
- # lumo (1)
- # off-topic (3)
- # om (5)
- # onyx (10)
- # parinfer (3)
- # pedestal (1)
- # perun (1)
- # protorepl (3)
- # re-frame (35)
- # reagent (19)
- # spacemacs (4)
- # specter (2)
- # uncomplicate (279)
- # unrepl (32)
@darwin: it works now, I'm an idiot, it's js/amazon, not js/document.amazon ... which is why it was notworking
There's a defonce
but is there something like do-once
intended for side effects? More broadly... trying to manage this go-loop so only one is running for the duration of the session
Calling all clojurians who are in SINGAPORE, please search #clojure-sg to join our Singapore clojure channel:grinning:😀
I have this weird behavior, compiling my reagent project with uberjar vs develpment mode. In uberjar version of compilation, I the binding item
gets lost (actually it prints some random value, not even nil). I'm really lost..
@tomaas https://github.com/clojure/core.async/wiki/Go-Block-Best-Practices#unsupported-constructs-and-other-limitations-in-go-blocks
In the light of that article I would say using doseq macro in a go
block is very adventurous:
https://github.com/clojure/clojurescript/blob/06c1b9b5bbb514d34fdc0193a730467e89f73bb8/src/main/clojure/cljs/core.cljc#L2357
Hi @darwin, thanks for your help. This is driving me crazy, I had read that article, I used doseq in all those cases, but with this snippet, the production code (uberjar) totally user the binding of item variable in the second argument's function body. This is sad...:(
maybe it is not problem in this async code snippet, maybe you simply put garbage into items somewhere else (due to advanced optimizations)
Is the cheat sheet documentation for "Get property" incorrect? It advocates the use of aget
for getting object properties.
http://cljs.info/cheatsheet/
https://github.com/cljs/api/issues/128
sorry, I meant, "prints a data structure map {:_id "123" :name "hola"}, where @items is a collection of those"
In ClojureScript/Reagent, when I write [:iframe {:onLoad #(….)}]
how do I get access to the iframe object itself using this-as
?
Maybe this is an XY problem: my goal is to change the height of the iframe so there is no scrollbar
try using a callback ref to get the dom node
i.e. store the dom node in a local atom, then you can resize on onload (or whenever)
no problem
@darwin, finally the problem was the :pseudo-names {:cljsbuild {:builds {:min :pseudo-names true}}}
With :advanced mode optimizations, determines whether readable names are emitted. This can be useful when debugging issues in the optimized JavaScript and can aid in finding missing externs. Defaults to false.
However, I can't see/understand how this could break that particular closure in my code snippet
maybe it works by accident if you set psuedo-name to false? (it's spelled with an s, do you have that?)
That's strange, so advanced build, with pseudo names to false
it works? Or just development? Can you gist the non-working part of the JS file with pseudo names true?
I recall that once I had similar issue, but the other way around, when :advanced
mode didn’t work, but with :pseudo-names
true it worked. that was a pretty bad situation to debug advanced mode issue
I can imagine pseudo names might not be perfect and it could generate names which shadow each other in nested scopes, that wouldn’t be a problem in advanced mode because there the names would be unique, and it works in debug mode, because the code is not inlined, so the scoping is different
Hello there, I want to know that by default closure compiler removes console.log(...)
calls in advanced compilation mode
regarding sente, what's stopping someone from mutating their :uid on the client side to impersonate another client before pushing a request to the server?
@joshkh I believe it's set server-side
@cl0jurian it doesn’t remote console.log
by default
@thheller is there a way to? I found that you can redefine console.log = function(){ };
doing so. But I haven't tried that with closure compiler.
@cl0jurian you can write a macro which emits console.log in dev mode and nothing in :advanced
mode
is there a possibility to tell closure compiler to omit all the (.log js/console "...")
lines right before the production compilation?
(set! (.-stripTypePrefixes co) #{"console.log"})
where co
is the ComilerOptions
from closure. can’t go into detail … I gotta go. 🙂
I'm trying to get this to work: https://github.com/cljsjs/packages/tree/master/three
what kind of cljs template project could I use where I then put in the dependency for three.js and the code example in core.cljs ?
quick and dirty github search: https://github.com/search?q=cljsjs.three&type=Code&utf8=%E2%9C%93
@newtocljs DANGER: when you successfully finish this exercise, you should scrap your slack user and create a new one 😉
after I create the a new project, what I am supposed to do ? the link to the READ me in the project doesn't work?
btw. https://github.com/jborden has multiple other repos with games based on this template, so maybe you can look at them instead of using the template
@newtocljs here is another one, a bit older: https://github.com/mikebelanger/minimal_threejs_cljs
@newtocljs What kind of project are you working on? How much experience with three-js do you have?
@newtocljs I’m sorry I cannot help further, I just searched github and briefly looked at the readme.
@captainlexington I have 0 experience with three-js
ok now I found a project and it compiles! and in the html file it says: figwheel template, checkout your deceloper console ===> what to do now in the console??
@newtocljs look in your browser’s console at whatever address lein is serving from
wow, this was a bad time to give advice — I gotta go, sorry
It worked, this metropolis "template" https://github.com/kybaeus/metropolis/tree/a030c3e04d513cc45fa6002ea5a61d6f96830b79worked, I threw away the source code and replaced with the example from three.js https://github.com/cljsjs/packages/tree/master/three
and now I have a spinning cube 😮 now to learn some three.js and clojure state handling, should be fun!
Does anyone run their ClojureScript unit tests via Node? It seems like a lot of people use PhantomJS which is overkill for my task.
If so ^^^ do you have a sample project config or something like that?
doo seems to make this a lot easier https://github.com/bensu/doo
Oh, man. I totally missed that doo supports Node.
Thanks!
@chrisdavies check https://github.com/bensu/doo#node before trying it. Node has some problems with relative vs absolute paths
Thanks. Will do
random question: so I was watching a video whereby a guy wrote an example script with lumo that worked like the tree utility https://github.com/lambdaisland/birch/blob/ep29-end/bin/birch so out of curiosity I ran it on a very large directory with many files aside from being much much slower I noticed it also managed to use up 300MB of ram which while note much is pretty large for a tiny shell script if you had a variety of scripts running. I was wondering if something like lumo would be more useful if it was something like a daemon which started a thread to evaluate what was sent to it or if the memory usage is implicit in it being clojurescript