Template from "Fullstack Workflow with shadow-cljs"
npx shadow-cljs clj-replGo to http://localhost:9630
⌃ + ⌥ + ↩
Go to http://localhost:18081
Intellij/Cursive dev setup
- "Import Project from Deps" via
deps.edn
Edit the "Clojure REPL / Remote" run config:
Use Port from file with localhost / Use standard port file
Create a new REPL command,
- "Language and Frameworks" -> "Clojure" -> "REPL Commands"
- Give it a name, e.g.
repl/restart - "Before execution" -> "File Sync" ->
Sync all modified files - "Execution" -> """Execute command" ->
(require 'repl) (repl/restart)
Then you can assign a "Keymap" to restart the server and reload changes with a single command
(e.g. ⌃ + ⌥ + ↩)
If you want to reload files in the Cursive REPL and don't need to restart the dev server, you can also use built-in Cursive commands - see here
The dev server also starts shadow-cljs to watch the public directory.
- The shadow-cljs UI is available at http://localhost:9630
- The dev server + frontend is available at http://localhost:18081
The frontend is set up to hot reload automatically as part of dev/repl.clj.
You can switch to the CLJS REPL via (shadow.cljs.devtools.api/repl :frontend)
Build the production-optimized frontend assets
npx shadow-cljs release frontendStart the standalone server at http://localhost:3000
clj -M -m ludovico.server- https://shadow-cljs.github.io/docs/UsersGuide
- Example of CLJ + CLJS => https://github.com/thosmos/riverdb?tab=readme-ov-file
- Start cljs devtools via
clj(as opposed tonpx)
clj -M -m shadow.cljs.devtools.cli clj-repl-
If you need to run the frontend on a separate port (e.g. for dev env if it gets decoupled from the backend server), you can add
:dev-http {<PORT> "public"}toshadow-cljs.edn. -
To spin a custom CLJS Repl in Intellij, edit the "Clojure REPL / Local" run config
- Type of REPL:
clojure.main - Parameters:
--main cljs.mainBy default it starts at http://localhost:9000. Validate the connection by typing(js/alert "Hello CLJS!")in the REPL.
- Type of REPL:
spec-tools.openapi.core/openapi-spec is deprecated
[]
This is an unused function in spec-tool,
the warning is due to a known CLJS issue.
It will hopefully be removed in future versions of coercion.
- Interop with JS functions will cause warnings on
js/...function calls, it might be a good idea to disableEditor -> Inspections -> Clojure -> Unresolved symbol