This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-09
Channels
- # beginners (55)
- # boot (173)
- # clara (3)
- # cljs-dev (10)
- # cljsjs (3)
- # clojars (11)
- # clojure (110)
- # clojure-austin (5)
- # clojure-berlin (13)
- # clojure-chicago (2)
- # clojure-dusseldorf (3)
- # clojure-france (24)
- # clojure-italy (4)
- # clojure-portugal (1)
- # clojure-russia (60)
- # clojure-serbia (8)
- # clojure-spec (150)
- # clojure-uk (129)
- # clojurescript (87)
- # core-logic (1)
- # cursive (75)
- # datavis (1)
- # datomic (75)
- # devcards (4)
- # dirac (17)
- # emacs (50)
- # events (2)
- # hoplon (9)
- # jobs (4)
- # jobs-discuss (37)
- # lein-figwheel (3)
- # luminus (5)
- # off-topic (54)
- # om (9)
- # om-next (5)
- # onyx (10)
- # perun (11)
- # protorepl (11)
- # quil (2)
- # rdf (2)
- # re-frame (14)
- # reagent (58)
- # ring (13)
- # ring-swagger (10)
- # rum (52)
- # spacemacs (8)
- # test-check (10)
- # untangled (17)
- # yada (34)
@nberger @drapanjanas Hi, I found a snippet about lazy loading here: https://gist.github.com/nberger/b5e316a43ffc3b7d5e084b228bd83899. It’s not clear to me how I could use it, do you have an example of its usage?
Is there a way to stop or restart a nodejs repl session that was started via piggyback? Hoping to restart to cljs repl without restarting cider.
Is it possible to use clojurescript on static site generators like jekyll, hexo or hugo instead of javascript? I know clojurescript compiles down to javascript so does that mean I can just replace the javascript in a theme with clojurescript?
@dorianc.b yes, here is a post about one approach: https://hashrocket.com/blog/posts/the-front-end-development-environment-of-my-dreams
@isak thanks, I was thinking about picking up going to javascript but the though of going back to an imperative language but it was....difficult
@dorianc.b it’s really easy, I have a Jekyll blog where all the JS is ClojureScript
(extend-type object ILookup (-lookup [o k] (aget o k)))
and you'll want to provide the not-found arity as wellBy the way, is it possible to look up the names of defrecord fields after closure has renamed them in :advanced mode? Other than parsing them from the string representation of the constructor function?
@miikka (defrecord Thing [field])
(:field (Thing.))
, keyword access always works for records
Well, it's a bit tricky since it takes as an argument a string literal. But I guess it'd be possible to do something nice with sufficiently advanced macro trickery.
I'd like to feed records to Vega (https://vega.github.io/vega/), which does string-based property access and code generation under the hood. Externs are fine for solving this, but I was thinking that maybe I could do something more automated.
but as @thheller implied, you can't use these directly, you might need to use reflect (but not sure if that’s applicable here)
Yeah, getBasis gives the CLJS names of the fields and reflect would give me the renamed property names except that it takes string literals, so I can't just apply it to getBasis results at runtime
https://medium.com/@addyosmani/javascript-start-up-performance-69200f43b201#.pai9ej388 @dnolen sneaking into JS performance articles 😉
@thheller interesting though it always so annoying that these posts have the Google spin
https://arewefastyet.com/#machine=29&view=single&suite=octane&subtest=CodeLoad
yeah but I agree with the point that benchmarks typically do not reflect real world results
it is nice to know though that the Closure Compiler (probably) does the most efficient thing already which we get for free
does clojurescript not have extends?
well, I have a cljc ns that's fine in a clojure repl, but won't compile in cljs with errors: WARNING: Use of undeclared Var myns.core/extends?
ah...
WARNING: Can't take value of macro cljs.core/satisfies?
in (cond
...maybe i should find another way altogether
When I run lein cljsbuild once, my app compiles without errors, but when I start a ClojureScript REPL using figwheel, I get this error: No such namespace: cognitect.transit, could not locate cognitect/transit.cljs, cognitect/transit.cljc, or Closure namespace "cognitect.transit". I did include [com.cognitect/transit-cljs "0.8.239"] in my project.clj. Any ideas what's going on?
I need to write something like this in ClojureScript:
<List …>
I tried:
(def List* (.createFactory js/React js/ReactVirtualized.List))
and then:
(List* …)
but I get:
Warning: Something is calling a React component directly. Use a factory or JSX instead.
What I am doing wrong?@borkdude: have you tried [(reagent/adapt-react-class js/ReactVirtualized.List)]?
I’m trying to write this example in cljs: https://github.com/bvaughn/react-virtualized/blob/master/docs/InfiniteLoader.md#examples (search for list to see what I’m trying)
@borkdude: I just uploaded an example of the infinite-scroll gist in https://github.com/nberger/reagent-infinite-scroll/blob/master/src/cljs/reagent_infinite_scroll/core.cljs
borkdude: yes, you can use [...], but it requires a reagent component.
reagent/adapt-react-class adapts a react component (class) into a reagent component (function)
You could do:
(def list* (reagent/adapt-react-class js/ReactVirtualized.List))
[list*]
Also fixed a couple issues with the infinite-scroll logic itself. Use it at your own risk though 🙂
@pupeno Yes, but does that work in this example?
<InfiniteLoader
isRowLoaded={isRowLoaded}
loadMoreRows={loadMoreRows}
rowCount={remoteRowCount}
>
{({ onRowsRendered, registerChild }) => (
<List
height={200}
onRowsRendered={onRowsRendered}
ref={registerChild}
rowCount={list.length}
rowHeight={20}
rowRenderer={rowRenderer}
width={300}
/>
)}
</InfiniteLoader>
Yeah, in that case, you should just create the react element, but if you needed to pass a reagent component, you should use reagent/as-element
Hmm, with js/React.createElement js/ReactVirtualized.List
, I still get the same error message
Got it… If I replace row-renderer with:
(defn row-renderer []
(js/React.createElement "div" #js {} “foo”))
the errors disappearSomeone out here who can help me with upgrading a cljsjs package? I need the checksum, but it doesn’t print it
There are #reagent and #cljsjs channels as well.
ha! ok.