Hi. There's been a lot of talk recently about making Clojure and Clojurescript easier to use, particularly for Javascript developers. shadow-cljs is frequently brought up as something that can ease that transition.
I haven't had time to use it myself, but I'm wondering if there's an interest in a single command that can create a project with some sane defaults that uses shadow-cljs and might be promoted as "create-cljs-app", echoing the ever popular create-react-app.
I do think that shadow-cljs already has all the proper sane defaults and you really only need to configure the stuff that needs configuration. Template wise you could just clone https://github.com/shadow-cljs/quickstart-browser and get started.
shadow-cljs however is just the build tool, it can't be opinionated about which framework to use since I want to support all of CLJS. It already provides template-ish :target which abstracts away some of the config stuff so you only need to configure the things you actually need for your target/app but it doesn't force any particular framework or so. I don't think it should.
People have already started building templates, probably just a matter of time until someone creates a npm based template. I'm currently busy with too many other things to start one myself.
Thanks. Very helpful. Will try to figure out where to go from here.
given the fact far few people are using ClojureScript, I don't think there will be a create-cljs-app. plus which library to choose, Reagent, Rum, Om, or Respo?
I don't think there will be a create-cljs-app
Why not?
Just as you can lein new shadow-cljs your-project +reagent you can write the same in ClojureScript and invoke it via npm? yarn create cljs-app will just invoke whichever script is published under create-cljs-app. Either you can create a complex template with CLI options for each framework or you could just write individual templates, eg. yarn create respo-app.
In the end its just about creating a few files and invoking simple commands.
Opened https://github.com/reagent-project/reagent/issues/333 following @thheller's feedback.
which library to choose, Reagent, Rum, Om, or Respo
I was thinking reagent. But Mr. Heller's suggestion for options makes sense. I think there should be a default though, so users can pick if they want or just get the default if they don't want to make a decision. npm install -g create-reagent-app would obviate a decision on a React library completely so I was thinking to start with that. After all it's create-react-app, not create-js-app.
given the fact far few people are using ClojureScript, I don't think there will be a create-cljs-app
My impression is we want more people using it. I've repeatedly heard the barrier to entry is too high. I'm willing to try to lower it, see if that helps, and try something else if it doesn't. At this point I'm just looking for a github org to publish under and a bit of spare time. :)
Mr. Heller's
Geez, please call me Thomas. :)
npx (comes with npm v5) lets you run scripts without installing them. So npx create-reagent-app some args ... would download the create-reagent-app package and call whatever the "main" is (eg. node <tmp-dir>/index.js some args ...).
yarn create reagent-app is the same just more sugar-y.
We have lots of lein templates already, porting some of them over would probably ease things for JS people since they won't have lein.
I created a helper for Shadow-CLJS for my personal projects in case people still want some.
https://www.npmjs.com/package/create-shadow-cljs-app
npx create-shadow-cljs-app cljs-app
# or
npm init shadow-cljs-app cljs-app
Enjoy!;p
In case you missed the README I created a simple npx create-cljs-project foo-bar a while ago. It however only creates the basic project skeleton and doesn't add any other framework specific boilerplate for builds configs yet since I cannot figure out how to do it an acceptable way. Want to avoid generated too much or too little.
I'm not a big fan of templates though so thats probably why it is taking so long. ;)
@thheller I actually did my due diligence and searched for existing projects and found yours as well before creating yet another one (I wanted a different repo name actually which was taken;p). It seemed weird that I could not find the repository behind it though, and when I tried it I just got an empty project (no source files, although the src/main folder is there) so I guessed you abandoned the idea.
My main philosophy with the skeleton projects is that I run one command and then start typing code for my app. If I need to delete 1-2 files that I don't need it's no issue and can be done later as well.
The best example in my experience so far, other than the awesome create-react-app, is the Elixir built-in mix new app1 which creates the absolute necessary thing for your project, without any dependencies, and with a file you can just start typing in your code and trying it out.
I am happy to either extend my project with any idea you might have or considered already, or even contribute (and maybe merge) to your project if it's still in-progress.
ps. I actually haven't noticed the section in the README; I am always inside the guide...
The code for the script is here and the package is here. The build config compiles into that dir.
If I need to delete 1-2 files ...
This is my problem with templates. Beginners will not know which files can be safely deleted or don't apply so they'll remain forever. I couldn't write a plain lein-cljsbuild + lein-figwheel config by hand myself and I doubt any beginner can. Most templates also generate way too much in this area.
Thats why my focus has been to make configuration so small that you can actually write them by hand. There is still value in templates though I just haven't find one I was completely happy with (and customizable enough if needed).
Most helpful comment
I created a helper for Shadow-CLJS for my personal projects in case people still want some.
https://www.npmjs.com/package/create-shadow-cljs-app
Enjoy!;p