Fork me on GitHub
#clojurescript
<
2020-01-21
>
Rory01:01:43

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 https://www.youtube.com/channel/UCfBUN43AQoyGiQxmCIDZe2w

👍 4
Filipe Silva15:01:35

is there a channel for clojure.spec?

bortexz15:01:32

#clojure-spec

Filipe Silva15:01:13

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

Aleed22:01:52

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)

darwin22:01:22

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

👍 4
lilactown22:01:08

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

lilactown22:01:49

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

lilactown22:01:08

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
Aleed22:01:10

regarding persistent storage, any solution you would recommend?

lilactown22:01:03

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

lilactown22:01:01

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
lilactown22:01:00

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

lilactown22:01:39

or just using the create element macro $ :

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

lilactown22:01:02

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

👀 4