This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-07-20
Channels
- # admin-announcements (15)
- # announcements (1)
- # beginners (10)
- # boot (39)
- # bristol-clojurians (2)
- # clojure (146)
- # clojure-canada (1)
- # clojure-gamedev (8)
- # clojure-italy (2)
- # clojure-japan (16)
- # clojure-korea (1)
- # clojure-poland (1)
- # clojure-russia (20)
- # clojure-spain (3)
- # clojurebridge (5)
- # clojurescript (104)
- # core-typed (2)
- # datomic (80)
- # indycljs (1)
- # jobs (1)
- # ldnclj (31)
- # off-topic (15)
- # om (21)
- # onyx (7)
- # ox (9)
- # re-frame (2)
- # reagent (16)
but now all my projects have 4 files in the root dir: build, build.clj, repl, repl.clj
@bbloom: I guessed that (about the syntax module) but it’s the only way for now I guess. It wouldn’t be too hard to build hiccup on top but I’m not sure if that’s the correct approach. With hiccup you end up with two different syntaxes: one for html and one for your own components. Is there are reason why div
, span
, etc can’t simply be functions (does this impact ability to do reference equality checks for example)?
i just realized that it would be easier to build the vdom top-down, so i didn’t use functions since then i’d have to create an intermediate tree representation bottom-up … which is basically what the syntax module is
although i’ll probably define a map-based tree representation, rather than the seq-based one
I will probably try to build something out of functions. The only issue is id generation but I guess that can be a second pass over the tree
yeah, a second pass is reasonable, but ultimately my plan was to decouple the ID scheme from the structure of the visual tree
for example, scope IDs to a particular component, so that if you have an outer
component render (middle {} (inner {:key “x”}))
then the inner would have an id context from the outer component
so instead of doing a pass over the whole tree, just do it over the output of a single component’s render
especially b/c i want to be able to support decoupling the component hierarchy from the visual hierarchy
for example, i was rendering some custom tooltips in react, and b/c they were child components, they messed up scrollbars and other nonsense
so i just made one big global tooltip component and when i want to show a tooltip, i set some global state for the “current” tooltip and rerender
but ideally i wouldn’t need to play that game, if components could also return more than just a single root of components
i could say “here’s a set of absolutely positioned sub-components on a higher layer”, for example
morning all - any resources comparing hoplon and the react-based libraries? Specifically in terms of performance?
Is there some clojurescript router that works without hashes?
@pupeno: bidi uses google closure’s history lib which can use „hidden mode“.
@ordnungswidrig: have you used it?
only on the clojure side.
But the design is very good.
From bidi’s README, it looks like it’s designed for Clojure and not ClojureScript… or rather, for Ring, not… well… the browser? Does it work in both places?
yes cljs support was added a while back check https://github.com/juxt/bidi#comparison-with-other-routing-libraries
Thanks.
I wonder how silk and bidi compare.
@pupeno: yes bidi works in the browser, I prefer it to secretary actually.
After looking a bit more in detail, I think my choice will be between bidi and silk.
@domkm: I like the driving principles for Silk, but it’s still a bit unclear to me how to use it. Is it supposed to replace Compojure on the server?
@pupeno: It can replace Compojure on the server or it could be used in conjunction with Compojure.
Are there any example projects to see how it fits with Ring and ClojureScript?
@pupeno: Silk is for going from URL to params and back to URL, compatible with both CLJ and CLJS.
@pupeno: Let me see if I can find some open-source examples. So that I can help better, is there a particular part that is confusing?
@pupeno: Here's an example of using Silk for CLJS front-end routing https://github.com/metosin/ks-front-routing-example/blob/master/src/clj/ks_front_routing/ui/routing.cljs
That looks useful.
Thanks.
The other part I’m not so sure about is how to interface with Compojure and/or Ring.
Oh… and one question… are you doing doing any kind of browser history management? like bidi does?
@pupeno: No history management ships with Silk currently. Considering it for the next version.
@pupeno: Regarding Ring: Silk takes a URL and returns params, so to use it with Ring you create a handler that matches the URL with Silk and then uses the extracted params to form the Ring response.
@pupeno: This is essentially what Compojure does except that it is specific to Ring while Silk is compatible with Ring but not specific to Ring.
Now that bidi support clojurescript, are there other advantages of silk over bidi that I’m not seeing?
@pupeno: Depends on what you consider advantages, I guess. Silk routes can be created and combined easily while Bidi routes are defined in one large data structure. Also, I think Bidi only deals with URL paths while Silk can match any part of the URL.
@pupeno: Not relevant yet, but I'm excited about the next version of Silk. It should be super fast (like faster than Compojure). I just need to find time to work on it. 😞
This is where I’m confused. With Compojure’s defroute, I define the path to match and the function to call. In Silk, I’m not seeing the function. Do I have to implement that dispatching myself?
argh… I need to run. bbl
@pupeno: Sort of. You implement it yourself but Silk ships with domkm.silk.serve/ring-handler
helper. The names of routes in Silk can be handler functions so dispatch can be as easy as calling the matched route's name and passing in the extracted params.
I'm on the street now, it's hard to navigate code on a phone so I'll look at it earlier. It would certainly help to have some of that wiring more packaged or more documented. I suppose the same thing would have to be implemented with browser history.
Packaging production cljs artifacts: advanced cljs compilation outputs a minified .js file to a target folder, but there is also the intermediate 'out' folder with unoptimized js files inside. Is there a way to separate these two from the get-go, or am I doing something wrong with boot? I am unsure if my question pertains to cljs or boot.
@petrus: The "out" folder is the :output-dir
in the ClojureScript build configuration. Not sure where that lives in Boot world.
@petrus: for what it’s worth, i’ve just dealt with this as well, and i ended up scripting a shell script post cljsbuild to remove the out folders prior to S3 upload. only :optimizations :none
actually uses those files.
@robert-stuttaford: We use CircleCI for builds, and I was leaning toward rsync
with --exclude ./out
to artifacts folder.
@petrus: if you want to strip stuff from the target/
directory you could also put a (sift :exclude #”out/*”)
at the end of your pipeline.
@petrus: see boot sift —help
for details.
I am surprised that Silk doesn’t include, out of the box, ways to connect to Ring or Compojure or Html5History and makes me wonder, how are other people actually using this library? @domkm?
@pupeno: Here's an example, using hashchange instead of html5history: https://gist.github.com/Deraen/426285564376266c675b
Oh, I see domkm already mentioned similar example.
@pupeno: Silk was meant to be fairly low-level. It's been a frequent source of questions and confusion so I think I will include some helper functions for common uses in the next version.
@dnolen: trying to create namespace descriptions for cljs.compiler.api
and cljs.build.api
but they have the same docstring. what would you say distinguishes the two?
@shaunlebron: I’ve gone ahead and clarified them a bit. Better more detailed docstrings still welcome.
@dnolen: great thanks
Thanks @domkm and @magnars. I'll look into those again tomorrow, hopefully more awake. 💤
Mike Fikes’ REPL available on the AppStore now https://itunes.apple.com/us/app/replete/id1013465639?ls=1&mt=8
I went for (doc interleave)
myself
@dnolen: thanks for the announcement and @mfikes thanks for making something so amazing for us to play with
I can really tell how used to paredit I’ve become 😛
“oh crap, okay uh …open, open, close, open, close, close ….okay” <ret>
@nullptr: The ability to do regex forms has been fixed for quite a while. (Long lead time to get app in store.)
by that time we might well be having this conversation in #clojureswift 😄
@chris_johnson: I think ClojureSwift very unlikely, no GC
@chris_johnson: I count them 1 2 2 2 2 1
@dnolen: I agree that GC is unlikely, and I wasn’t being entirely serious with my suggestion.
@gtrak: I will often count on my fingers while muttering “open …open, close …open” to myself also
@chris_johnson: haha, hard to tell, that one has come up a few times as a serious suggestion
is there an idiomatic way to do animations yet in Reagent? specifically, expanding and hiding blocks
@mfikes: Replete is fantastic! Thanks!
@shaun-mahood: Glad you like it. There’s obviously a lot more that can be added to it. Needed to ensure it would be approved, etc.
@mfikes: I'm pretty impressed that it even exists.
I totally got into Clojurescript at the most exciting time.
I have a multidimensional javascript which I receive from a javascript library. While I try the (js->cljs) method I get a Uncaught RangeError: Maximum call stack size exceeded from ´´´IEditableCollection (-as-transient [coll] (TransientArrayMap. (js-obj) (alength arr) (aclone arr))))
The Objects are referencing internally to next, prev and parent. Maybe this is causing the error.
@danielgrosse: won’t work. You just cannot use js->cljs
for that.