Fork me on GitHub
#clojurescript
<
2019-05-24
>
cch104:05:24

What are characteristics of a project that uses Clojurescript on the client and Clojure on the server that would warrant having them in the same git repo? And perhaps less obviously, what are the best practices for such a project in terms of aliases for dependencies? Would it be reasonable to have the client-only dependencies in a single alias, the server-only dependencies in another and the (few) common deps in the global section of deps.edn? Or mush them all together globally? Are any conventions and practices established for such projects?

lilactown05:05:52

I think i tend to separate them so the jar I deploy to the server doesn’t get too big

Stefan05:05:17

Hi all, I recently ran across Svelte (https://svelte.dev/blog/svelte-3-rethinking-reactivity). I haven’t used it yet, but from the looks of it I think I might prefer something like that over React. Does anybody know of something similar in CLJS land?

lilactown05:05:46

You could check out hoplon. It doesn’t have the compile time aspect but it has similar ideas about reactivity

Ahmed Hassan05:05:50

How does it compares with shadow-arborist and Svelte?

lilactown14:05:45

I haven’t used any of them. AFAICT arborist uses a similar model to React where it has a virtual-dom that is updated based on props passed into components.

lilactown14:05:09

svelte compiles your templates into very small amount of DOM mutations at runtime

lilactown05:05:54

Afaict, anyway

Stefan05:05:03

I’ll check it out thanks; the compile-time thing is what makes it really interesting though, right? 🙂

Stefan05:05:50

Hmm actually that’s not right, it’s ditching the virtual dom I guess

lilactown05:05:20

That’s the part I’m most interested in. The compiler aspect

lilactown05:05:34

The reactive part is meh

lilactown05:05:56

But I also haven’t tried it yet so maybe I’ll be surprised

Stefan05:05:04

Yeah I’m not sure either, it would be worth a try. Unfortunatly me experiments at the moment revolve around (ios/android) native things, so I guess that practically glues me to react native…

felipebarros05:05:39

Someone recently mentioned a CLJS project inspired by Svelte but I can't remember the name. Let me try to find it.

Stefan05:05:26

Thanks! Him again heh 🙂 Not sure if I can justify (to myself) using that without upping my Patreon donations to him 😅

😅 4
Stefan05:05:27

> This is not something you should build upon (yet)

felipebarros05:05:01

Yeah, seems to be pretty fresh.

Stefan05:05:25

Still interesting, I’ll study the readme. Thanks for the pointer.

felipebarros05:05:19

You're welcome. I hope the project gains some traction.

Stefan05:05:11

Ok stuck with react for now. So then my question becomes: which framework to use in CLJS land? There seems to be quite a bit of choice. I’m a beginner here, so I don’t have experience with any. Reagent seems to be the most widely used one, but is that declining? What about om, rum, hx, what have you? How do I choose?

Stefan05:05:04

(btw saw this thread via shadow-arborist readme; maybe having some virtual dom things isn’t that bad an idea after all… https://twitter.com/dan_abramov/status/1120971795425832961)

carkh05:05:35

start with reagent, graduate to re-frame... for a harder to understand, more opinionated framework, use Fulcro

carkh05:05:16

keechma looks like a down to earth, getting things done framework too

carkh05:05:32

but i didn't test that one

Stefan05:05:54

(just to clarify: I do have experience with react and redux, so those architecture patterns are very familiar to me)

Stefan05:05:37

@carkh “harder to understand, more opinionated” doesn’t seem to be a very good sales pitch 😉

carkh05:05:13

and yet, that's the one i'm working with right now =)

carkh05:05:36

after having tried reagent and re-frame

carkh05:05:43

re-frame was nice

carkh05:05:02

but fulcro comes with a whole ecosystem

carkh05:05:48

integrates nicely with pathom, has a nice fulcro-inspect chrome addon to help with development

carkh05:05:36

integrates with workspaces too that's a novelty to me, have my components displayed on a single page in all their states, then having a tab per component, check it all at a glance

carkh05:05:29

if you want to spend a bit of time check this tutorial series (a little bit outdated but still nice)

Stefan05:05:50

Thanks I’ll definitely do that!

Stefan05:05:35

(But I also feel overwhelmed with all the choices, so maybe I’ll take your advice to just start with reagent/re-frame and learn their pros and cons first…?)

carkh05:05:53

you can't go wrong with re-frame

Stefan05:05:29

(are all these options also suitable for react-native btw?)

carkh05:05:10

that's a bit out of my depth, but i think fulcro can be made to work with react native.... re-natal is re-frame ported to react native

Stefan05:05:11

> Re-Natal is a simple command-line utility that automates most of the process of setting up a React Native app running on ClojureScript with Reagent + re-frame, Om.Next or Rum.

Stefan05:05:28

Leaves me with a lot of choice I guess 🙂

Stefan05:05:00

So far I’m going with shadow-cljs instead of re-natal btw

carkh05:05:10

see i never investigated re-natal =)

👍 4
carkh05:05:27

shadow-cljs is fine, you can mix and match anyways. use one for dev, another for deployable artifacts

carkh05:05:57

the code you write will still be the same for the most part

carkh06:05:07

unless you're doing yet another todo list

carkh06:05:19

when it's about build tools i mean

carkh06:05:58

UI code and system architecture will be very different when doing re-frame or fulcro

Stefan06:05:46

Yeah that makes sense.

ferossgp15:05:26

Hi! I'm experimenting with :npm-deps and I'm curious to understand if it works with browser build? I found that if I shim the process it works, but this is a dirty hack, because we should not have the env in browser

dominicm16:05:17

There's a flag to turn on the process shim in cljs itself

richiardiandrea18:05:46

what is everybody using for displaying emojis nice in a webpage?

Jimmy Miller19:05:59

Not really sure what you are asking. Emojis are just unicode characters. So you can just use the character or use the escaped version &#x<hex-code>

Jimmy Miller19:05:25

Is there something missing with that approach?

richiardiandrea20:05:53

Yes, I mean, I can definitely see them, but they are a bit ugly and they don't look like Slack ones 😄

richiardiandrea20:05:08

I am very newbie on this so I might be missing something

gklijs21:05:32

I don't use them often, but as mentioned above they are just unicode characters. Witch means it's simple to use and takes only a bit of bytes. But the drawback is they look different depending on browser and such. If you want them to look the same you should use something else, like loading them from svg.

richiardiandrea23:05:58

it seems like I need the right font-family

martinklepsch10:05:33

@U0C8489U6 the unicode interpretations vary by OS

martinklepsch10:05:43

most tools use sprites for that reason

dominicm12:05:05

EmojiOne is a nice and mostly free font for this

richiardiandrea15:05:23

Ok cool thanks a lot!

Jacob Haag20:05:35

Has anyone had much luck in tagging clj.test tests? I am using karma.conf.js to drive a lot of my tests