This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-02
Channels
- # boot (227)
- # carry (1)
- # cljs-dev (3)
- # cljsjs (2)
- # cljsrn (19)
- # clojars (2)
- # clojure (93)
- # clojure-belgium (1)
- # clojure-dev (2)
- # clojure-italy (1)
- # clojure-spec (22)
- # clojure-uk (5)
- # core-async (15)
- # cursive (33)
- # emacs (8)
- # ethereum (1)
- # hoplon (3)
- # jobs (2)
- # leiningen (1)
- # off-topic (24)
- # om (32)
- # perun (1)
- # protorepl (1)
- # re-frame (13)
- # reagent (53)
- # rethinkdb (4)
- # ring-swagger (1)
- # vim (12)
- # yada (14)
@gerred: Welcome! Any particular reasons you're making the switch?
@shaun-mahood: I’ve flirted with clojure/clojurescript over the years, and thought I was bandwagoning with everybody else when it came to static compile-time type checking being such a productivity boon. I’m sure it is, but I got stuck in edit-compile-run-debug hell almost immediately with ML family languages.
so I’m familiar with it at least from that side, but not really on the frontend side, so I’m excited.
I come from Ruby though and I’m at the point where I’ll just ride out the statically typed craze, hang out in my dynamic language happy zone until the cycle ends. 😉
@gerred: Aah, I thought your name looked familiar. I can’t argue with that logic, the instant feedback is extremely nice for front end work.
I think I sit in flow better solving minor bugs in that style than I do having to parse a massive type compile error.
@gerred: I use Clojure and ClojureScript. was hoping to try out Elm and experience swifter resolving of type errors, hopefully aiding me in some of the situations where ClojureScript's confusing stack traces would confound me. With the reputation of Elm's error messages, I find it interesting that you still value solving bugs in ClojureScript more - this sounds controversial to me. So I hope that you do get to do that talk, or maybe do a blog post on it or something 🙂
Is there any way in reagent to specify component prop types?
@savelichalex since components are just functions, I guess you can cljs.spec them or use plumatic/schema.
@andre: I don't understand your question 🙂 Maybe try rephrasing it or explain your need or context?
i have broken data structures, and reagent doesn't understand it, ratom is changing . but reagent doesn't see that, so i want just constantly recalculate render function each frame
What do you mean when you say "broken data structures"?
i'm transferring data between two windows, they have different js context which cljs doesn't support
If you have data of some format/type, is one solution not to translate it into a ClojureScript datastructure and just update the r/atom normally?
Or is it too complex/difficult to convert?
I think you are going in the wrong direction when you're talking about calculating the render function on each frame.
a have cljs datastructure, i tried cognitect.transit to transfer data. but it demanding on big data, so it's cheaper to render each frame
Alright
Well, I guess you can derefence some key in your r/atom and have a go-loop that updates that changes the value of that key every milisecond 🙂 Or something like that.
What's the most efficient way working with selected items in the list? I mean I need to keep track of selection somewhere, but when list gets long, switching selections becomes slow
currently I use clojure set for selection and contains? predicate to know if the item needs to have selected class
using set as a function works the same
I guess the best way would be just not to render that many items and introduce some kind of pagination
How long is your long list? 🙂
In the cases I've worked with, the items have had an ID, and we've had a key in the app-state r/atom named something like :my-list/selected-id. Then deref that in the list component to decide arbitrary stuff.
@andre: Good luck, I hope you find something that works!
@reefersleep 1486 items
it takes ~350-400 ms to update selection
it seems like most of that is consumed by react and not data structures traversal
That does sound long. I don't know what's reasonable, though.
yeah, usually it is not that long, but I've opened up my pictures directory....
If it's react taking too long, I guess there's not too much to do except paginate?
yeah, I wish there was some ready-to-use component for that...
but it seems like I have to reinvent it or do an interop
Guess so.
@reefersleep thank you, i decided to recalculate form, it works good
@andre great that it worked out! 😄
@yury.solovyov: I don't know of anything specific for reagent, but you might be able to use or get ideas from https://github.com/bvaughn/react-virtualized
oh, looks very close
thanks, will take a look
though, it seems like it is js component, I wonder if it is on cljsjs
Oh awesome - I haven't needed it yet but it looks like a really good project. Hope it works for you!
not the latest version but still seems good enough, thanks