Fork me on GitHub

ok, no need to document my steps because @tkjone’s video series had me up and running super fast! definitely worth sharing with people like me who come in wanting help starting from scratch

👍 4
Filipe Silva15:01:35

is there a channel for clojure.spec?



Filipe Silva15:01:13

oh wow, it didn't show up on the search... thanks


my only remaining resistance to CLJS for front-end development is overhead of converting data structures from CLJS to JS back and forth. in real world apps w lots of data, do people experience problems w this? to what extent does it hurt initial launch/startup time? (i'm specifically looking to create a react-native app, using sqlite for offline storage)


are you aware of cljs-bean? that could help quite a bit

👍 4

this depends a lot on your app and what systems it’s interacting with. if you’re using a lot of external JS libs/components that requires you to deeply convert a lot of CLJS structures to JS in order to interop, then you might have a less than good experience


this is where things like cljs-bean like darwin suggested can help, but it’s not as nice as using JS


however, if most of your app is CLJS then you shouldn’t see a lot of overhead converting data structures. you should almost always pass around immutable data and serialize them using EDN/transit

👍 4

regarding persistent storage, any solution you would recommend?


I haven’t done RN in many years so not sure what state of the art is


if you’re going to use SQLite you’re going to be serializing tabular data to something more structured anyway, so the diff between serializing to/from JSON and to/from EDN shouldn’t be that big I would expect

👍 4

helix’s method of creating macros for native components can help a lot here. E.g. if for React Native you had a macro:

(Text {:foo-bar "baz"})
that rewrote {:foo-bar "baz"} to #js {:fooBar "baz"} that gets rid of 90% of the times when you need to convert to and from at runtime IME


or just using the create element macro $ :

($ ^:native Text {:foo-bar "baz"})
;; rewrites to `(react/createElement Text #js {:fooBar "baz"})


it would be pretty awesome if someone wrote a library of macros for interoping with React Native 😄

👀 4