Replies: 9 comments 5 replies
-
I'm using shadow-cljs in a couple of projects myself and I find |
Beta Was this translation helpful? Give feedback.
-
I feel it's more the job of shadow itself to create such |
Beta Was this translation helpful? Give feedback.
-
To add, I'm using shadow-cljs mostly for testing or producing libraries and publish them to NPM. So that doesn't align at all with the above proposal for example. |
Beta Was this translation helpful? Give feedback.
-
@borkdude: I totally get where you're coming from. I should clarify that I want to solve a specific problem here: I believe ClojureScript is too hard to set up and use to build web apps in 2022. Disclaimer: This is just my opinion and I'm incredibly grateful for all the work that the community has provided to us for free. Nonetheless, there's glue that's often missing and my dissatisfaction with the developer experience motivates me to solve the problem however I can, whether that's through For example, understanding what goes in all those files above just to get started was an annoying process for me even though I've been writing ClojureScript professionally for 5+ years now. The steps need to be performed manually if you want to add these things to an existing project instead of starting from a template. I know people who could really enjoy ClojureScript but may not be able to get past all these little steps on their own. Anyways, rant over. This project is awesome and I want it to stay that way. With all this in mind, I see a few possible approaches for me to move forward:
Since this isn't really relevant to |
Beta Was this translation helpful? Give feedback.
-
@rads I think a solution to the above could be a |
Beta Was this translation helpful? Give feedback.
-
And perhaps host it with shadow-cljs so it can be used as |
Beta Was this translation helpful? Give feedback.
-
Or we could still have a |
Beta Was this translation helpful? Give feedback.
-
Thanks for moving this to a discussion. Happy to keep the conversation going while I get a better understanding of the problems here. No rush either, just glad to to be involved. |
Beta Was this translation helpful? Give feedback.
-
@rads After reading this, I think it makes sense to have neil emit some bare-bones shadow-cljs setup for browser app development. Let's just start with the most minimal thing and then let's build it out.
or so? |
Beta Was this translation helpful? Give feedback.
-
Rationale
I recently converted a project from figwheel-main to shadow-cljs and now have a pretty good understanding of the challenges when using these libraries in 2022. Though figwheel-main was working fine once I set it up, I ended up switching to shadow-cljs for more community support. That said, when setting up both build tools, I had to parse a lot of information to build a minimal but complete dev workflow that included a ClojureScript REPL, tests, CI, etc...
One option to make this easier now that
neil new
supports external templates would be to create a configurable shadow-cljs template, which is similar to the approach of frameworks like kit-clj. That's a totally valid approach and it's why I'm also working on a PR for kit-clj to add deps-new compatibility which will enable this top-down workflow withneil
.That said, the template approach doesn't work as well for adding shadow-cljs to an existing project. This is where
neil
has an opportunity to shine, providing a bottom-up workflow in addition to the top-down one. Beyond that, if we could have a tool that knows how to add shadow-cljs features incrementally with sane, modern defaults, this would be a boon to ClojureScript developers everywhere.Example
Requirements
Note: Due to the number of features in shadow-cljs, we may consider options within
neil add shadow-cljs
to generate only a subset of the features below (e.g.--karma-tests false
if you don't wantkarma.conf.js
).neil add shadow-cljs
should fill in the following files as needed:deps.edn
:shadow-cljs
alias using example from shadow-cljs tools.deps integration docs:extra-deps
to addshadow-cljs
dependencyshadow-cljs.edn
:deps true
to enable tools.deps integration:builds :app
with:target :browser
:builds :test
with:target :browser-test
:dev-http
to run tests from:builds :test
:builds :ci
with:target :karma
build.clj
bundle
functionuber
function to includebundle
package.json
andpackage-lock.json
:target :karma
shadow-cljs
npx shadow-cljs
command, but this is optional with tools.deps integrationkarma.conf.js
:test
build inshadow-cljs.edn
.gitignore
.shadow-cljs
directory.github/workflows/cljs-tests.yml
:ci
build on push tomain
Beta Was this translation helpful? Give feedback.
All reactions