Hacker News new | past | comments | ask | show | jobs | submit login

I delived a service in 2019 that was written 100% written in clojure. ReactNative app + SPA Web app + Server all sharing the same code.

The developer experience was great. I get subsecond hot-reload on all plataforms (app emulator/app on-device/web/server).

The same UI components was shared between ReactNative and ReactDOM. All App issues are reproducible in Web, then I fix in web and I'm sure that App is working.

Even SSR was possible, with some tweaks.




Got a public repo to share that would show how you pulled this off?

Barring that, as a sibling comment asks, what specific framework and/or libraries did you use to achieve the holy grail of sharing-all-the-things? (thought ReactNative required implementing separate UI for iOS and Android).

Sub second hot reload sounds amazing, btw.


Not sure this will help: ClojureScript RN app: (I think has desktop and all that as well) https://github.com/status-im/status-react


Would love to see a breakdown of your setup for this :)


Not OP but to achieve this in clojure you could use something like:

For builds and dependency management: Leiningen, boot or deps.edn

For the front-end (clojurescript): Shadow-cljs + reagent

For the backend (clojure): Nrepl and nrepl.cmdline, Ring, jetty + compojure for a REST API

Frontend and backend can share code with .cljc files that work on all clojure dialects. https://clojure.org/guides/reader_conditionals

Both nrepl and shadow-cljs support code reloading through the REPL connection.

You can compile to a jar file and deploy that, build a docker image, or compile to a native executable with graalvm, or deploy on Aws lambda with Cljs+Lambada. Lots of options.


Thank you sir. I am just learning Clojure right now , coming from JS and GO world.


What framework and libraries did you use?




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: