Fork me on GitHub
Christian Johansen15:01:24

I made a ClojureScript library that is API compatible with Quiescent, supports hiccup and server-rendering, but does not use React. It's the answer to "what if React was just a rendering library?"


I might be missing something, but isn't React basically just a rendering library?

Christian Johansen16:01:43

It is also a state management system of sorts

Christian Johansen16:01:03

dumdom has no component local state


I guess I must be missing something here because I'm not understanding what this or Quiescent really accomplishes. State is optional in React and it even encourages only using state where necessary and use pure components everywhere else. State is necessary in some components so removing it entirely makes zero sense to me.

Christian Johansen17:01:31

Then this is not for you 😊

Christian Johansen17:01:45

I've been using quiescent for years


...but whom is it for?

Christian Johansen17:01:13

People making webapps :man-shrugging:

Christian Johansen17:01:45

I disagree that local state is ever necessary


Look, you're trying to pitch this out here for people to use so when someone is honestly asking you the purpose of it, being cheeky isn't going to bode well.

Christian Johansen17:01:17

Sorry, not trying to be cheeky

Christian Johansen17:01:08

But honestly, if you feel that local state is necessary I'm not going to convince you off it. I just happen to disagree

Christian Johansen17:01:43

I can see that response didn't come off great, sorry. I guess it's for anyone who wants a solid rendering layer, but prefer to own their own data flow


I'd be happy to discuss it. I'm waiting for you to give the justification for your bold claim.


For components that would typically have a local state, what do you do instead?

Christian Johansen17:01:55

I put everything in global state. It's a trade off, sometimes it's a little bit more of a hassle, but the benefits are tremendous in my opinion

Christian Johansen17:01:37

Having everything in global state means you can always trivially freeze/recreate/address the state of the app

Christian Johansen17:01:11

Makes for better apps in my experience, less state-related bugs, plus it's easier to debug

Christian Johansen17:01:45

Downside is primarily not being able to ship shareable "smart components"

Christian Johansen17:01:35

What kind of components do you typically give local state?


I had a feeling that was what you were going to suggest. Having everything in global state is the same as having all global variables. There are a lot of downsides there that you're getting your convenience from.

Christian Johansen17:01:27

It's not comparable at all

Christian Johansen17:01:38

It's more akin to a database

Christian Johansen17:01:28

In fact, if you use Datascript, it is a database


does anybody have any experience with re-natal (cljs + figwheel on react-native)? i have some issues with the build step that i can't seem to solve... (and it's not trivial 😛 and yes i tried to google for it 😛 )


What’s the error message? I may be able to help


it's complicated 😛


well the error message is that "a" is undefined 😛 but reason for "a" not being defined is a bit more complicated


oh god yes I got this when upgrading to react native 0.57


I wasn't able to fix it


I think it might be the thing about constant folding


basically cljsbuild does advanced compilations on some shit


then when the resulting file goes though babel.js some functions get removed for some <insert profanity here> reason


How can i use Antizer (antdesign) instead of reactstrap with my luminus project?


I've tried adding following readme and css dep as cdn generated home.html didnt work tho


Is there an Next.js ( equivalent for Clojure/ClojureScript? I'm looking for the simplest way to deploy an web app with Clojure for the back end and ClojureScript for the client side.


Don’t think there’s a 1-to-1 equivalent, but in looking it over, Clojure(Script) Frameworks like Fulcro, re-frame+(kee-frame/etc) are going to cover most of what it offers. Fulcro tends to be more complete, but there’s a lot more to learn up front, re-frame, plus extra bits is easier to get into, but you’ll need to pull in and wire up the extra bits you need. For deployment, as has been pointed out, the sky is the limit. If you’re uberjar’ing then Herkou, AWS’ Elastic Beanstalk (or Fargate), etc are super easy. And if you want to paradoxically go the fancier and simpler route Datomic Cloud+Ions rock. If you’re on AWS @U4L16CHT9 mentioned S3 for front-end assets, we use AWS Amplify to make even that easier, as well as some nice integrations with other AWS services and some nice UI components too boot.


I don't think there's anything quite that easy

👍 10

Getting Clojure up & running on Heroku is pretty straightforward


I might give it a shot. I see they support custom runtimes


Datomic Cloud is another relatively easy way which I quite like (biased of course) - and you get a DB to boot

👍 10
😄 5

Datomic Cloud on the backend with a simple public S3 for front end is a combo hard to beat


with figwheel-main, do I need to include something in my figwheel-main.edn that indicates that it should actually perfom the hooks I have defined?


I have an ns with ^:figwheel-hooks and a function with ^:after-load, but when it recompiles, it doesn't run those functions :/ interestingly, if I just put a call to the function in the namespace, it will call it as it re-evals the compiled js


so I just drop a (-main) at the bottom of the main file


seems a little primitive


What is the cleanest way to extend a js prototype class? Like = function() { = true }


Do I use set!?


Google Closure has facilities for this as well


but if you're just looking to modify an existing prototype then set works