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

hey folks, I would like to know which clojure front-end framework should I use for my application. Any help?

nenadalm07:05:50

I used only re-frame so far (https://github.com/Day8/re-frame). It has very good documentation.

👍 4
Jakub Holý (HolyJak)10:05:07

it depends on your needs. But #reagent is a very popular, relatively simple choice for the UI part. If you need more advanced stste management, add #re-frame to the mix. If you have complex UI needs such as undo , look at #fulcro

👍 4
Daouda20:05:52

Thank you very much guys, that helped a lot

Daouda21:05:03

I think I’ll go with reagent

Daouda21:05:28

Any advice about UI framework i should go with?

nenadalm11:05:23

I am using material-ui: https://material-ui.com/ it is also available on cljsjs (https://cljsjs.github.io/).

carkh02:05:36

it'll depend on the size of your application and how much time you're willing to spend learning, also how data heavy it is i guess

dominicm08:05:05

I'm trying to define a macro for self-hosted cljs and having issues. I tried putting it in the cljc file, and then doing (:require-macros) on self in :cljs, but that doesn't seem to be working. Moving the macro into a clj file is difficult because the macro has many :requires.

dominicm08:05:53

putting it into a matching .clj file gives me "Can't take value of macro" even though I'm doing (the-macro [] …). This isn't a great solution though because clojure is going to read the .clj file first

dominicm08:05:37

ah, moved my require code in a cljs-only function and a semi-circular dependency is allowed in this case because it's macro-expansion.

dominicm08:05:14

oh, but now I can't do #?(:cljs) to detect whether I'm running under bootstrapped cljs 😔

thheller08:05:40

self-host capable macros are fun aren't they? maybe this helps? https://github.com/cgrand/macrovich

dominicm08:05:43

Yeah, I've been poking at the source, but not fully certain how to use it without depending on it (it's for a 0-dependency library). My attempts so far haven't worked too well 🙂

dominicm09:05:01

right, it works, nobody touch the code.

Filipe Silva10:05:42

I was trying to find some information on how to build/publish libraries made in CLJS to be used in the JS ecosystem but am not finding a lot of information on this topic

Filipe Silva10:05:56

there is a nodejs target but that makes isn't quite the right thing for browsers libraries for instance

Filipe Silva10:05:33

I figured there might be a similar ESM (ES2015 modules) target but there doesn't see to be one

Filipe Silva10:05:59

Is such a usecase (cljs->packaged js->import from js-land) supported, or planned to be supported?

Filipe Silva10:05:34

If it's something the team would like to do, I'd like to help out

Filipe Silva10:05:31

I'm one of the devs in Angular CLI but not here on official capacity, just as an OSS contributor that is interested in interop

thheller11:05:45

@filipematossilva #shadow-cljs (a CLJS build tool) has a couple options to create commonjs packages (ESM would be simple to add as well). See :node-library or :npm-module, eg. https://shadow-cljs.github.io/docs/UsersGuide.html#target-npm-module

Filipe Silva12:05:56

Thank you for the direction @thheller, I'll have a look there!

Filipe Silva12:05:41

You mentioned it would be easy to add more... Is there some information available online about this? I suppose the general functionality of adding targets

thheller12:05:20

yeah shadow-cljs is built with a target abstraction that lets you easily customize how the output it organized. its mainly just taking the regular CLJS compiler output and moves files into proper places and generates boilerplate for depending on the target platform

thheller12:05:50

but its all shadow-cljs specific. CLJS itself isn't really extensible in that way.

Filipe Silva12:05:06

Gotcha, thank you