Fork me on GitHub
#fulcro
<
2019-12-06
>
Aleed04:12:24

is fulcro compatabile with react hooks and react concurrent mode?

currentoor04:12:00

fulcro’s rendering model does not use those AFAIK

currentoor04:12:30

but you should have full JS interop and do it yourself in the parts of your app that need it

tony.kay14:12:32

You cannot use hooks within Fulcro components…that could be fixed with a few days work, probably, but it isn’t high on any priority list.

Aleed16:12:32

just started learning clojure, so can't comment much yet but if one plans to use react w fulcro, isn't it better to embrace where the platform is going?

Aleed17:12:17

i ask because i'm interested in trying out fulcro but don't know what problems i might run into

eoliphant18:12:11

jsut my 2 cents, fulcro components currently map to react components so the same restrictions apply, and the “problem” is no different, per se, than what you’d have trying to use hooks inside a react component. a good chunk of the motivation behind hooks, is addressed far more elegantly by fulcro’s marriage of db + component metadata, transactions, etc. I’d imagine the only problem you might run into would be using some 3rd party react lib that’s ‘hooks only’, etc

👍 4
Aleed02:12:11

yea that might be more of an issue in near future as more libraries move to using hooks

currentoor03:12:39

hook is a way to do state management right? most libraries are concerned with rendering not state management no? like a date picker component that takes in some props

currentoor03:12:58

perhaps i’m mistaken about what hooks are

tony.kay03:12:06

hooks are an alternate way of doing the component lifecycle kinds of stuff, and can also be used to feed data into a component in an isolated fashion. They are not particularly useful in Fulcro, since the whole point of Fulcro is to unify your I/O story in a sane manner without it being peppered about the app in various ways.

tony.kay03:12:00

but Fulcro could treat them as an implementation detail…a hooks? true option could switch the mode of defsc, and it would just not allow lifecycle methods then, and would tunnel props using hooks instead of setState

tony.kay03:12:12

it’s not that hard, I don’t think…but not that useful either

Aleed03:12:41

yea, as @U0CKQ19AQ mentioned, hooks allow not only state inside functions (i.e. useState) but also hooking into component lifecycle (i.e. useEffect). i could see the use of unifying global store state and remote data sources (i.e. what would in js land might be separate redux store and apollo graphql store) but if a data concern is only local i definitely prefer to keep it local

Aleed03:12:51

in js that makes the component easier to reason about. but maybe that's not a problem with fulcro?

Aleed03:12:27

either way i'd still be concerned about interop with libraries that rely on hooks. i.e. new react navigation for react native uses hooks

Aleed03:12:05

anyway, watching fulcro youtube video tutorial now to get a better idea of framework. cool to see the Clojure development flow, too. thanks for the videos @U0CKQ19AQ

tony.kay16:12:32

Welcome. Yeah, we don’t need hooks for data management, and library components can use hooks (React allows them to compose), so there isn’t a limitation I’m aware of.

cjmurphy08:12:12

In Fulcro Inspect I'm always getting "No app connected". I've tried F5, Shift F5, rebooting the machine, going back to a previous commit. Still always get it, and it doesn't make sense at this stage. Is there anything I can do to help myself?

Björn Ebbinghaus08:12:16

Did you allow 3rd-party cookies?

4
cjmurphy09:12:13

I've been developing with FI for a long time. Didn't change anything on that front recently that I know of. Just on localhost.

sheluchin10:12:22

I was getting this because I had a typo in my shadow-cljs.edn file. I used dev-tools instead of devtools. Maybe something as simple as that?

cjmurphy10:12:54

Mine says devtools . But it hasn't been altered in a long time. Even deps.edn hasn't been altered for a while. Thanks all.

Piotr Roterski11:12:14

@U0D5RN0S1 I had this problem earlier and reinstalling the Fulcro Inspect chrome extension helped, you could try doing that

cjmurphy12:12:54

Thanks Piotr. That (re-install Chrome extension) was one of the things I tried before installing the Electron version, which actually fixed the issue.

👍 4
cjmurphy12:12:03

My current theory is that there's a timeout somewhere for the connection to happen and the JavaScript of my app just got big enough to be slow enough to trip it. (On an i5 Linux machine). Or else something to do with that tempid error.

bbss06:12:02

I've also had this error a couple of times. I thought it was related to something in my state not being serializable, but reading this it might be something else.

cjmurphy08:12:53

If I right click on the FI pane itself (where it says "No app connected") I can get an error message: "Error: No reader function for tag fulcro/tempid". So perhaps that has something to do with it...

Robin Jakobsson09:12:11

what web browser are you using?

Robin Jakobsson10:12:40

I had that problem when using an ad-blocker

cjmurphy10:12:07

I have popup blocker and popup blocker pro. Both are set to allow popups to localhost:3000.

cjmurphy10:12:56

I just installed the Electron app and can see app state again. Certainly good that there's a way out when creepy weird stuff happens 👻

astrashe20:12:04

Someone asked me about browser compatibility and I didn't know what to tell them. It's an issue for us because some of our customers use a weird desktop CRM program that has an embedded IE widget. Would Windows 7 IE work?

adamfeldman20:12:37

As a first attempt at an answer, do Clojure/script and React work in that version of IE?

astrashe20:12:10

I'm not sure -- but it sounds like the answer to my question is probably, "You have to test to find out" -- that's reasonable, obviously, but harder to sell to management

mruzekw21:12:17

Looks like no earlier than IE9

astrashe21:12:20

Thanks, that's really helpful

mruzekw21:12:02

Unless you’re in a really special situation, I wouldn’t think browser compat to be an issue

astrashe21:12:18

I think that Windows 7 people can use IE 11

mruzekw21:12:31

IE
5.5: 0.01%
6: 0.01%
7: 0.00%
8: 0.10%
9: 0.04%
10: 0.03%
11: 1.53%

astrashe21:12:24

A lot of travel companies use a CRM system called ClientBase. If you pull up a company's record in the CRM, it will open their web page in an IE widget in the app. We ask people to use Chrome, but they don't, and this causes lots of support headaches.

mruzekw21:12:50

Gosh, and what version is the IE?

astrashe21:12:23

Whatever they have installed on their system. But IE 9 was released in 2011

astrashe21:12:34

And we could say, dl IE 11, and install that

mruzekw21:12:46

I would do whatever you can to push them toward that

astrashe21:12:40

We have problems with Vue apps, because devs tend to bring in libraries that don't work. I almost think that Fulcro would be better.

astrashe21:12:45

I think Clojurescript compiles to ES3

mruzekw21:12:47

By default I think so

mruzekw21:12:08

But I think that only applies to code compiled through the Google Closure compiler

mruzekw21:12:37

So if you’re using cljsjs or shadow-cljs, I don’t think ES3 is guaranteed. Would have to check

mruzekw21:12:59

@U05224H0W Would know about shadow-cljs 🙂

thheller21:12:11

browser compatibility depends on the stuff you use. CLJS emits ES3 code but that doesn't mean anything if you use (js/Promise. ...) or something like that

mruzekw21:12:27

ES3 even for npm libs?

thheller21:12:23

like I said ... it depends on the stuff you use. that includes libraries you use.

thheller21:12:55

you can transpile it down to whatever browser you want ... but you need to configure that

mruzekw21:12:28

Sure. Thanks!

astrashe21:12:05

These are encouraging answers for us, thank you!

souenzzo04:12:52

IMHO, it will be easier to "configure stuff" for legacy browsers in cljs then any other JS/Babelly/WebPack equivalent solution

12