This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-30
Channels
- # bangalore-clj (1)
- # beginners (9)
- # boot (51)
- # cider (20)
- # cljs-dev (419)
- # clojars (1)
- # clojure (338)
- # clojure-brasil (64)
- # clojure-dev (7)
- # clojure-greece (2)
- # clojure-italy (3)
- # clojure-russia (10)
- # clojure-spec (127)
- # clojure-uk (12)
- # clojurebridge (2)
- # clojurescript (132)
- # core-async (8)
- # cursive (37)
- # datomic (34)
- # dirac (5)
- # events (1)
- # funcool (3)
- # hoplon (39)
- # jobs (3)
- # leiningen (3)
- # off-topic (16)
- # om (44)
- # onyx (7)
- # pedestal (20)
- # protorepl (1)
- # random (1)
- # re-frame (64)
- # reagent (6)
- # specter (4)
- # test-check (9)
- # untangled (17)
- # vim (4)
Was going over the guides for Om Next, and there's a section of code that I can't seem to work out.
(defn get-people [state key]
(let [st @state]
(into [] (map #(get-in st %)) (get st key))))
On this page here: https://github.com/omcljs/om/wiki/Components%2C-Identity-%26-Normalization#appendix
What is the transducer being passed to into
trying to achieve there?hi! is it any correct way to pass cljs data between two windows? now i can do it, i can print it, it looks good, i can deref atom, but i can't get value from map by keyword
@andre interesting question. is it possible that keywords from different JS contexts will have different values?
what happens with string keys?
also i'm using reagent for rendering this passed data, and reagent doesn't rerender it, something wrong with this data
@dnolen ok, thank you, сan you advise something to "serialize" data between contexts? data->edn (json?)->data ?
Transit is probably best option here
I think lein-externs
provide a very simple approach for generating externs file, why not cljs-build or cljs-compiler use it by default?
@doglooksgood: because we don’t integrate anything around Leiningen
it could be that lein-externs
works reasonably well but it doesn’t have enough users to appear to be properly vetted for integratino into any other tooling
I mean this plugin just use some regex to find which name should be preserve. It's quite simple.
which isn’t exactly uncommon given the lack of more static forms of metaprogramming in JavaScript
did anyone have issues updating from clojurescript 1.8.40 to 1.8.51 or later? Its the point where the closure-compiler is upgraded to v20160315 (if thats related I’m not sure). My dev app works, and advanced compilation builds without error, but in advanced comp my app does not even mount. Not sure where to start debugging 😕
@dnolen i see, ok. i tried bumping to 1.9.229 as well but i saw the same issue. every version before 1.8.51 seems to work.
currently using clojurescript 1.8.40, clojure 1.8, om alpha44, and i had to exclude guava from datomic “0.9.5344” because it was colliding with the google-closure version
im in the middle of trying to update our core dependencies. we were on om 1.0.0-alpha36 and clojurescript 1.7.228. I was able to upgrade om to alpha 44 and clojurescript to 1.8.40. if i upgrade to 1.8.51, and exclude guava from datomic, i get a build with no errors. but when i load my app, the “app” div is just an empty div. no console errors, build errors or network errors. the outputted js is there as well.
i realize thats not enough information but thats where i am right now in debugging. before i went deeper i wanted to check if moving to a new google-closure version broke some peoples build, which it does not sound like it did. so ill do some more research
@kenbier a couple of tips, make a advanced build with prettying printing and pseudo-names enabled
has anyone found / written any good resources on using spec with figwheel? my thinking was placing the cljs.spec.test/instrument
calls in the :figwheel-on-js-load
function but it does not seem to instrument fn
s, my guess is somehow they are getting overwritten after instrumentation by something in figwheel
If I have core.cljs
and core.clj
, is it possible to use the macros in core.clj
in core.cljs
? Just trying to directly call my macros, without adding anything to my :require
, results in WARNING: Can't take value of macro
It seems like the above is possible according to this https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure#macros > ClojureScript namespaces can require macros from the selfsame namespace, so long as they are kept in different compilation stages. So, for example a foo.cljs or foo.cljc file can make use of a foo.cljc or foo.clj file for its macros.
so I dont have to manually eval the instrument calls, and it will be elided in the uberjar cljsbuilds
@ownwaterloo note instrument
isn’t a runtime thing
if I had the :figwheel-on-js-load
call a fn (do (fdef things.....) (stest/instrument 'fdef-ed-fn))
sorry yeah the :figwheel-on-js-load
is a setting in project.clj which will call a function when it detects file changes
:recompile-dependents true
would allow you to edit other files and trigger this dev namespace to recompile
Is there a reason https://github.com/clojure/clojure/blob/master/src/clj/clojure/core/specs.clj is not included in cljs yet? Seems as simple as adding the namespace, no?
How do you call var
in cljs? I get a java.lang.AssertionError: Assert failed: (ana/ast? sym)
when trying to call var
.
Even stranger.. I am able to call var in the REPL. Are you not able to have dynamic calls to var
?
@kenny vars in ClojureScript are static
you shouldn’t expect them to work like in Clojure
AFAIK their implementation is minimal enough for cljs.test
to work
@anmonteiro You aren’t able to dynamically retrieve metadata from a symbol then? 😞
for a symbol that refers to a var?
maybe with some macro black magic, I’m not sure
which would be calling cljs.analyzer.api/resolve
in the Clojure side of things
it would, that’s what I’m telling you
you pass it the &env
and the var symbol
but note that most your expectations regarding vars in ClojureScript won’t hold
they’re not going to work like in Clojure
&env
is the ClojureScript compilation environment
it’s where the analyzer will find your var
then you need to think about how you’re going to return the metadata you find on the Clojure side to the ClojureScript runtime
probably worth more trouble than changing your implementation to something more solid
&env
is an implicit argument to the macro
it’s “there"