status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.88k stars 983 forks source link

[Meta] switch to shadow-cljs #8950

Closed yenda closed 3 years ago

yenda commented 4 years ago

WIP branch https://github.com/status-im/status-react/tree/shadow-cljs

Problem

Nix has made setting up the project much easier for new comers, but there are still some serious rough edges.

Currently our tool stack is quite complicated. In cljs world alone we use a dependency called clj-rn which used to be maintained by Julien and is now kind of abandoned. Then have some complex dev setup that starts figwheel together with re-frisk to get hot reloading and some HUD for debugging. Re-frisk easily crashes the repl whenever it encounters custom types which happens every time you use chats in debug.

Implementation

We can replace re-frisk with re-frame latest debug features, and all the rest with shadow-cljs. Shadow-cljs takes care of compiling only the right files through dependency graph, which allows us to have a simpler code base. It takes care of hot reloading and will replace clj-rn entirely, so we will also have a simpler tool stack. It makes npm imports much easier through a nice syntax and provides tooling to determine which parts of js dependencies are used, allowing selective imports which avoid bundling a lot of js in the final package. Finally it is actually maintain and we could approach it's maintainer to help us improve our code base and use of it.

Future Steps

flexsurfer commented 4 years ago

we just got rid of Leiningen , and it's great that we don't need any tools to buld our project, clj-rn it's just a clj library

yenda commented 4 years ago

So is shadow-cljs, except that it is well maintained and has a growing strong community