Fork me on GitHub
#clojurescript
<
2019-01-21
>
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?" https://github.com/cjohansen/dumdom

victorb15:01:59

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

WhoNeedszZz17:01:24

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

WhoNeedszZz17:01:49

...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

WhoNeedszZz17:01:55

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

WhoNeedszZz17:01:51

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

WhoNeedszZz17:01:49

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?

WhoNeedszZz17:01:04

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

boogie66617:01:39

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 😛 )

jimberlage18:01:28

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

boogie66618:01:31

it's complicated 😛

boogie66618:01:48

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

danielneal14:01:58

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

danielneal14:01:03

I wasn't able to fix it

danielneal14:01:25

I think it might be the thing about constant folding

boogie66618:01:07

basically cljsbuild does advanced compilations on some shit

boogie66618:01:45

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

ec19:01:18

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

ec19:01:08

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

rinaldi19:01:49

Is there an Next.js (https://nextjs.org) 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.

eoliphant12:01:51

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.

dnolen20:01:39

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

👍 2
dnolen20:01:22

Getting Clojure up & running on Heroku is pretty straightforward

rinaldi20:01:24

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

dnolen20:01:06

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

👍 2
😄 1
luchini20:01:09

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

1
idiomancy21:01:45

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?

idiomancy21:01:51

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

idiomancy21:01:14

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

idiomancy21:01:19

seems a little primitive

pablore21:01:47

What is the cleanest way to extend a js prototype class? Like

SomeClass.prototype.foo = function() { this.bar = true }

pablore21:01:04

Do I use set!?

dnolen22:01:34

Google Closure has facilities for this as well

dnolen22:01:47

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