Fork me on GitHub
#clojurescript
<
2023-11-04
>
Noyal Jose09:11:04

hi what is the current state of the reagent vs hellix. since reagent doesn't have hooks is the latest changes in react affecting it adversely compared to hellix?

p-himik09:11:40

You can use hooks in Reagent just fine. You just have to use function components - either everywhere or only where you need them but with a tiny bit of extra care (adding :f> to Hiccup vectors that wrap function components).

Noyal Jose09:11:23

so i hope learning reagent and reframe wouldn't be an issue in the future, can you suggest me some good resource to learn front end in reframe/reagent

p-himik09:11:10

I think their documentation is pretty much perfect. But if you're a complete beginner, then maybe something else would be better, I don't know.

Noyal Jose09:11:26

yes, i'm a complete beginner i was looking for a guide aimed at complete beginners

p-himik09:11:40

A complete beginner with just Reagent/re-frame? Or CLJS? Or web development? Or development at all?

Noyal Jose09:11:22

i'm tryng to do a project and i learned basic clojure plus pedestal for the backend, what i'm trying to learn is front end and i thought learning reagent/reframe will cover the whole front end in some sense

p-himik09:11:47

Mm, hard to say. CLJS and CLJ have their differences, and they both are affected by their underlying platform. JS is quite a lot on its own, CLJS adds to it, React adds to it a lot, Reagent adds to it yet again, and re-frame adds to it even more. I'm not sure starting from the top of this burger is the best choice.

Roman Liutikov09:11:31

I think most Clojure devs are just using reagent and re-frame without ever diving into JS/React, however building more advanced, interactive experiences requires good understanding of the browser platform and how React is integrated with it (update lifecycle and rendering for example).

p-himik09:11:41

You'll still be showered from that leaky abstraction sooner or later with things like lifecycle methods, keys, refs, synthetic events. And then just using an existing React library usually requires learning a lot. How to interop with React componets, the differences between elements/components/instances, when and how to convert between JS and CLJS data when working with HOCs, etc. All those are just the things I could remember while writing this message. The actual list is likely much larger.

phill11:11:31

...might be kind of like asking, "I only speak English but now that I am going to learn Mandarin, which city's dialect is easiest?" Start with reagent! The abstractions are leaky, so you will eventually learn lots of useful tidbits about other stuff. But that's ok! Better to learn useful tidbits, than not-so-useful!

sridhar parasuraman11:11:28

Have trouble requiring the latest version of amplify in a shadow-cljs project. anyone else has the same problem?

sridhar parasuraman11:11:50

["aws-amplify" :as amp :refer (Amplify Auth API graphqlOperation Storage )] is problemetic. my package json has this version of amplify. The earlier version worked for me "aws-amplify": "^5.3.11",

thheller11:11:57

this means that Amplify is undefined. could be that the :refer does not exist anymore or was renamed. do a (js/console.log amp) or so in the REPL to check out what it is and what it exports

sridhar parasuraman11:11:12

I was translating this working code from an example react project using the same version of the library aws-amplify 5.3.11. import { Amplify, API, graphqlOperation } from 'aws-amplify'

thheller11:11:43

that isn't relevant really. look at what amp actually is

thheller11:11:28

aws-amplify is notorious for confusing shadow-cljs and not working properly, so the only way is to actually check (and of course look at warnings/errors the browser console)

thheller11:11:25

the printed REPL result really doesn't help

thheller11:11:43

thats why I said to use js/console.log and look at it in the actual browser console instead

sridhar parasuraman11:11:03

o ok will do. thanks !!

sridhar parasuraman11:11:57

(.configure Amplify aws-exports)
=>
Cannot read properties of undefined (reading 'configure')