This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-21
Channels
- # adventofcode (47)
- # aleph (18)
- # announcements (20)
- # babashka (81)
- # beginners (23)
- # biff (6)
- # calva (5)
- # cider (50)
- # clojure (34)
- # clojure-europe (19)
- # clojure-norway (11)
- # clojure-spec (6)
- # clojure-uk (1)
- # clojurescript (2)
- # conjure (2)
- # cursive (14)
- # datomic (1)
- # humbleui (11)
- # hyperfiddle (3)
- # introduce-yourself (5)
- # joyride (1)
- # nbb (7)
- # off-topic (19)
- # podcasts-discuss (1)
- # reagent (3)
- # reitit (19)
- # releases (1)
- # ring-swagger (1)
- # shadow-cljs (29)
- # sql (6)
- # squint (56)
Hello! I want to do a quick poll: On your fullstack (frontend + backend) projects where frontend is a spa built with shadow-cljs, do you create:
a) a repo for each project (like project-web, project-service)
b) a repo with a subdirectory for each project (like project/{web,service})
c) a repo for both projecs on the same structure, with backend and frontend code coexisting under same src/ (maybe with/in different namespaces)
If the answer is (c) how do you do this? Also, how do you share common cljc
code between the frontend and the backend? Foremost and most important, how do you make a project that has both a normal deps.edn project for backend and a shadow-cljs.edn project for frontend?
I do both b) and c), but in c) I use Leiningen and not deps.edn. The CLJC is shared. Both project.clj
and shadow-cljs.edn
reside in the root directory, each with the correct src
settings. The settings don't overlap much.
I haven't (yet) because I so far used option (b). I'm just making a poll to see what most people use, and to gain ideas whether it is possible to fire a single repl to host both the frontend and the backend somehow for option (c) 🙂
I just switched to this setup. Previously I could launch both together in Emacs/CIDER with Leiningen & Figwheel classic, but I haven't gotten the setup to work with Leiningen and Shadow-CLJS so I start one in terminal and other in Emacs/CIDER.
You can have each build tool usually in watch mode in a terminal somewhere and use one editor. In case of Emacs/CIDER you should be able to have both in one editor. And Emacs can of course have terminals in it too. The advantage of the "proper support" is that you can use all the bells and whistles so jump to source (without LSP etc.)
I think this channel is perhaps wrong for this question, it is not at all related to Shadow-CLJS.
Yeah I posted it here because I believe that the biggest challenge is having shadow-cljs play along inside a normal clj repl somehow
Since the code I run in the Shadow-CLJS REPL is intended for the browser, I would anyway want it to be separate.
This is with the disclaimer that I mentioned previously that my setup worked better with Leiningen+Figwheel and now something prevents me from launching Leiningen+Shadow-CLJS at the same time, but haven't had time to investigate really. I hardly ever use the browser REPL, I often rather print to the browser.
We have frontend in one folder, on the same level as many folders for the backend code in polylith. I run neovim and conjure, but many instances. I don't even use buffers, but every file is managed by wm. The editor knows what repl to pick up by traversing the tree up, looking for the .nrepl, which hits the frontend shadow-cljs repl before it goes up the the repository root, where the clj repl port is written to