reagent

A minimalistic ClojureScript interface to React.js http://reagent-project.github.io/
2020-05-07T05:34:45.387100Z

The new :f> seems great!

2020-05-07T05:35:30.388Z

I wonder how it will interact with re-frame.

juhoteperi 2020-05-07T05:37:34.388600Z

@neo2551 Shouldn't affect re-frame use in any way. Ratoms work the same in function components.

2020-05-07T05:38:36.389400Z

Yeah, the question should perhaps be more "how will the use of React Hooks interact with re-frame"

2020-05-07T05:39:03.390400Z

Because Hooks offers a different "state management" model

juhoteperi 2020-05-07T05:39:27.390800Z

Yeah. But my view is still that ratoms are already more useful, they can be used outside render call etc.

2020-05-07T05:39:51.391500Z

Yes, I absolutely agree

2020-05-07T05:40:06.392100Z

I was just suggesting the that issues would be elsewhere

2020-05-07T05:41:00.393600Z

Ie. :f> will work fine with re-frame. But the Hooks within them might not

juhoteperi 2020-05-07T05:41:13.394Z

But hooks could be useful as implementation for some things. Like useRef could be used to initialize ratoms/subscription once (like subscription deref already works).

2020-05-07T05:41:40.394400Z

Yep, I'm probably thinking more of useState etc

2020-05-07T05:41:48.394600Z

Is that the name?

juhoteperi 2020-05-07T05:42:35.395600Z

With useRef you can create mutable object, per component instance, where changes don't automatically trigger re-render.

2020-05-07T05:43:00.396100Z

I'm going to look that up now

2020-05-07T05:43:12.396400Z

I'm trying to get up the Hooks learning curve

juhoteperi 2020-05-07T05:44:27.397500Z

Just learned about that use for useRef yesterday myself, @roman01la recommended it for function component implementation instead of useState where I just had one value I didn't update: https://github.com/reagent-project/reagent/commit/8b365c11dd0cc1e18c9d06a10e0d6d726721e50a

2020-05-07T05:47:10.399900Z

@mikethompson thanks for clarifying my thoughts. It is exactly what I was thinking, hooks provide an additional way of managing state and I wondered whether/how we will manage it with re-frame or otherwise

2020-05-07T05:50:19.401800Z

I strongly suspect that Hooks managing state won't work well with re-frame managing state

2020-05-07T05:51:20.402900Z

I'm trying to like Hooks, i really am :-) But I don't like my views doing anything other than rendering

juhoteperi 2020-05-07T05:52:15.403800Z

useState could be used for local state, similar to local atom for some parts, probably doesn't make sense to use them for application state. And for interop etc.

1πŸ‘
2020-05-07T05:53:04.404500Z

I haven't tested it yet: but can we useState with a CLJS value?

lilactown 2020-05-07T14:38:33.418900Z

You can place any value inside of a useState or useRef, no need to convert anything

2020-05-07T05:53:48.405300Z

Or will it get round-tripped via clj->js

juhoteperi 2020-05-07T05:55:07.406700Z

Should work. I think hx and other wrappers use cljs values with state hooks directly.

2020-05-07T06:06:47.408200Z

@juhoteperi BTW, I'm currently putting together a grownups website for re-frame. When we have it all figured out, maybe we do something similar for Reagent

juhoteperi 2020-05-07T06:07:39.409100Z

Yeah I've been thinking about building a new website, and pretty much rewriting all the docs also.

2020-05-07T06:24:26.409800Z

I thought all your docs were really good for both projects.

juhoteperi 2020-05-07T06:38:23.411200Z

I think Reagent docs at least has good parts, but some of the older pages could be reordered a bit and they are missing some stuff and adding them requires modifying the existing parts.

2020-05-07T08:12:30.412Z

@neo2551 It is not the contents of the docs that's an issue. Its the presentation.

2020-05-07T08:14:10.413300Z

I wrote a small library for myself that extends marginalia for leveraging mkdocs-material (https://davidpham87.github.io/materiala/)

2020-05-07T08:14:45.414200Z

I think http://calva.io also use it. I found it was nice enough with the search function as well.

2020-05-07T08:19:47.414900Z

@neo2551 yeah, we're going with mkdocs

2πŸŽ‰
2020-05-07T09:55:42.415300Z

Shared from shadow-cljs channel … perhaps it’s more a reagent topic.

lilactown 2020-05-07T14:38:33.418900Z

You can place any value inside of a useState or useRef, no need to convert anything