🚀
ShipClojure
  • README
  • Development
    • Getting Started
    • REPL Workflow
    • AI Development with ShipClojure
    • Getting Updates
    • Formatting code
    • ShipClojure Guiding Principles
  • Backend
    • Migrations
    • Secrets
    • Routing
    • ShipClojure Blog
    • Email
  • Frontend
    • UIx + re-frame
    • HTTP Requests with Re-frame
    • Frontend Navigation with Re-frame
    • Toast Notifications
    • Icons
  • Server Side Rendering
    • Static/Landing pages
  • Auth
    • How Auth works
    • Oauth2 providers
  • Deployment
    • Deployment
  • Decisions
    • 001 - Cookie Sessions
    • 002 - Single Page Application Architecture
    • 003 - Re-frame instead of Refx
    • 003 - Move from cookie sessions to JWT Access + refresh tokens
Powered by GitBook
On this page
  • Pre requisites
  • Clojure REPL
  • ClojureScript REPL
  1. Development

REPL Workflow

PreviousGetting StartedNextAI Development with ShipClojure

Last updated 9 days ago

Most cljure devs work with the REPL through a reloadable lifecycle system. If you don't know what a REPL workflow is I mandate that you read through and watch all the associated videos.

Pre requisites

  1. npm install - shadow-cljs will need the npm dependencies to compile the clojurescript to js

  2. From root of shipclojure repo:

$ cp saas-secrets.example.edn  resources/.dev-secrets.edn

to have development secrets ready for starting the REPL. After that make sure resources/.dev-secrets.edn contain the correct secrets for development, especially the DB connection

See for more information

Clojure REPL

ShipClojure supports starting all of the dev-related processes through the REPL workflow. loads the runtime dependencies.

Steps:

  1. Start the Clojure REPL using your editor's way of starting an NREPL server with the aliases dev,test (needed for development goodies).

$ bb repl-dev # starts the REPL with dev,test aliases for remote connection
  1. When the REPL booted up call (user/reset) (or just (reset)) directly from the REPL or from the namespace itself. If everything succeeded, you should see :resumed in your REPL

  2. (Optional) Bind calling (user/reset) to a keybind so you can call it often as it is handy to reset your live dependencies. See for community explanations of binding a key to a clojure fn call - People in the replies contributed with the way to do it for most editors.

  3. Done! You have everything you need to start hacking on ShipClojure from clojure side.

ClojureScript REPL

NOTE: You don't need a CLJS REPL to work on shipclojure. Live reload of the changes in the .cljs files are already compiled and reflected in the browser. If that is enough for you, don't start a CLJS REPL. The CLJS REPL is a nice-to-have and useful for people who are used to it.

Before starting the ClojureScript REPL, you need start the clojure REPL and call (user/reset) and see :resumed in your REPL window.

Steps:

  1. Use remote clojure connection to connect to the nREPL server started on localhost:7002

    • for emacs this means Mx cider-connect-clj and typing localhost:7002 when prompted for the repl address

    • for intellij there is a run configuration already defined called CLJS REPL, just run that one

    • for VSCode calva: Connect to Running REPL server, not in the project, Select project type Generic, add localhost:7002 when prompted for hostname:port

    • for VIM/NVIM please contact me to update the docs, I'm not familiar with this setup - basically you need to do a remote connection to a CLJ (not CLJS) nREPL on localhost:7002

  2. From the new connected REPL, call (user/cljs-repl)

  3. If everything worked correctly, you should see [:selected :app]

  4. You are done! You now have a running CLJ REPL and a CLJS repl

The clojure REPL starts REPL on port 7002. You can change the port this from the config file in the [:nrep :port] section

REPL Driven Development
secrets management
Integrant
this tweet
shadow-cljs
shadow-cljs.edn