This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-26
Channels
- # announcements (2)
- # aws (4)
- # babashka (5)
- # beginners (91)
- # calva (4)
- # cider (17)
- # clara (13)
- # clj-kondo (14)
- # cljsrn (11)
- # clojure (159)
- # clojure-europe (2)
- # clojure-nl (14)
- # clojure-norway (2)
- # clojure-taiwan (2)
- # clojure-uk (32)
- # clojurescript (101)
- # clojutre (4)
- # cursive (13)
- # data-science (1)
- # datomic (46)
- # emacs (68)
- # figwheel-main (5)
- # fulcro (48)
- # graalvm (7)
- # graphql (6)
- # instaparse (5)
- # joker (4)
- # lambdaisland (1)
- # leiningen (2)
- # malli (9)
- # off-topic (41)
- # pedestal (15)
- # re-frame (47)
- # reagent (7)
- # reitit (14)
- # shadow-cljs (180)
- # spacemacs (58)
- # specter (1)
- # tools-deps (13)
I'm thinking of splitting out a bunch of heavy work to a webworker, and am feeling a bit lost over in the webworker without re-frame event flow. Does anyone know if there's a sort of headless re-frame (maybe citrus?) to help with coordinating coeffects and effects, etc., and letting me model inbound postMessage
as something like a re-frame dispatch?
I guess I could wire up a bunch of channels but the whole interceptors-cofx-fx state management set up is just so nice.
I just assumed the reagent dep would drag in a bunch of DOM stuff, but clearly I assumed wrong.
hm, ok, maybe a bit less awesome. Been meaning to see if I could figure out how to do that cljsjs stub trick and yank all of react out into a few <script>
tags
it's also not too much work to fork re-frame and remove the reagent dependency... which I've also done before...
I don't have any intention to open source it stand alone, but it's there as a POC for you
there's only like a few places that re-frame directly depends on reagent. the subscriptions, and I think the event queue also had one part that was easily removed
300K uncompressed / 85K compressed with re-frame, for my serviceworker script. I think I can live with that.
plus now I can symmetrically model postMessage
either from main -> worker or worker -> main as an effect handler, leave my UI dispatches alone and just change the event handlers.
hey guys
Have you tried to get a value from a checkbox before?
Thank you. It worked
the (.. % -target -value)
is pulling the value of the checkbox out of the React event
How the TodoMVC example does it: https://github.com/day8/re-frame/blob/master/examples/todomvc/src/todomvc/views.cljs#L34-L37
Hi, reframe contributors. What do you think of removing reagent as a dependency. I’m not sure that it’s a good idea to use reagent approach in 2020 when we have react hooks, suspense and time slicing in future. But reframe is awesome lib as a state manager, etc and it would be great to use it without additional not relevant dependency in bundle
@y.khmelevskii I'd be very surprised reagent was removed from re-frame, but based on the messages above it looks like it wouldn't be that hard to do in a fork.
@y.khmelevskii re-frame won't be made independent of reagent any time soon
From my point of view, features like hooks
are solutions to problems that re-frame doesn't have or, at least, already solves in different ways. I'm sure they are useful to pure React developers, but they don't seem to fit into re-frame well.
And, as for suspense
, to the extent I understand it, I certainly appreciate the goal and marvel at the glorious hack (throwing promises as exceptions, right?) but I don't like the attempt to implement statefulness (one state, suspense, another state) in the view itself. I feel like that should be handled in the logic/state of the program itself, with the view being a rendering of that state.
suspense is neat, but the thing that really effects reagent and re-frame is concurrent mode and time slicing
I've not looked into that at all, I'm afraid
I've got some quite time coming up, which means I'll have some time, do you have any links?
it’s the most important change. suspense is cool, but works without concurrent mode. concurrent mode enables much better UX along with it, though
Links for "much better UX" would be appreciated.
hooks are going to be more and more required when consuming npm libs going forward though, right?
here’s the intro in the docs: https://reactjs.org/docs/concurrent-mode-intro.html
Dan Abramov’s talk from React Iceland 2018 is relatively short and motivating: https://www.youtube.com/watch?v=nLF0n9SACd4
this is a good dive specifically on the scheduler and what’s going on in Dan’s demo: https://philippspiess.com/scheduling-in-react/
another video specifically about concurrent mode, a bit longer https://www.youtube.com/watch?v=ByBPyMBTzM0