cljsrn

https://github.com/drapanjanas/re-natal | https://github.com/drapanjanas/re-natal/wiki/FAQ | https://github.com/condense/mercury-app/wiki | https://github.com/seantempesta/expo-cljs-template/ https://www.npmjs.com/package/create-expo-cljs-app
zendevil 2021-02-28T06:05:50.048700Z

@raspasov the problem was with keyExtractor. I was using random-uuid wehereas I had to use a key that won’t change for each item

raspasov 2021-02-28T06:08:54.049300Z

@ps awesome, glad it worked out 🙂 I knew it had to be on of the properties…

zendevil 2021-02-28T06:10:06.050Z

However, even low resolution images are taking long to show in the first place

raspasov 2021-02-28T06:10:18.050200Z

;needs to return a key as string :keyExtractor (fn [[_ idx]] (str idx)) If I put a comment there, I probably struggled with it, lol

raspasov 2021-02-28T06:11:02.050400Z

What is “low resolution”? Are you loading from the web?

raspasov 2021-02-28T06:11:18.050600Z

There’s ways to mitigate that with UI effects, have the image fade-in on load, etc

raspasov 2021-02-28T06:12:07.050800Z

https://github.com/expo/react-native-fade-in-image (this lib solves a bunch of edge cases around images loading nicely)

raspasov 2021-02-28T06:12:34.051100Z

Or you can use something like https://github.com/oblador/react-native-animatable (but you’d have to tinker more with it, but it’s more customizable)

raspasov 2021-02-28T06:13:06.051400Z

For highest performance there’s this https://github.com/software-mansion/react-native-reanimated (esp the v2 version) but it’s harder to use from ClojureScript

zendevil 2021-02-28T06:18:23.052Z

I’m loading from aws cloudfront

zendevil 2021-02-28T06:18:47.052200Z

which I think is a cached aws s3 bucket

zendevil 2021-02-28T06:21:32.052400Z

@raspasov react-native-fade-in-image is awesome!

raspasov 2021-02-28T06:25:41.052600Z

Works well? 🙂

zendevil 2021-02-28T07:04:16.053200Z

Is there a way to know how much progress have been made in sending a multipart request?

zendevil 2021-02-28T07:04:59.053700Z

I have the following re-frame handler that sends a multipart request:

(reg-event-fx
 :upload-video
 (fn [cofx [_ navigation]]
   (let [body (js/FormData.)
         file (clj->js {:uri (-> cofx :db :uri) :name "movie.mov" :type "video/quicktime"})
         thumbnail (clj->js {:uri (-> cofx :db :thumbnail-uri) :name "thumbnail.png" :type "img/png"})]
     (prn "file is" file)
     (prn "uploader is " (-> cofx :db :_id))
     (.append body "video" file)
     (.append body "thumbnail" thumbnail)
     (.append body "title" (-> cofx :db :video-name))
     (.append body "uploader" (-> cofx :db :_id))
     {:db (->
           (assoc (:db cofx) :uploading-progress true)
           (assoc :upload-error false))
      :http-xhrio {:method :post
                   :uri (str server-uri "/api/upload-video")
                   :body body
                   :on-success [:upload-success navigation]
                   :on-failure [:upload-error navigation]
                   :format (json-request-format)
                   :response-format (raw-response-format) #_(edn/edn-response-format)}})))

zendevil 2021-02-28T07:05:59.054200Z

it is sending a video and an image. I want to know how much progress has been made in the upload

naomarik 2021-02-28T12:26:34.054700Z

Are people using krell or re-natal nowadays?

2021-02-28T12:30:34.054900Z

shadow-cljs

naomarik 2021-02-28T12:32:37.055100Z

shadow-cljs for react native development?

naomarik 2021-02-28T12:33:36.055300Z

had no idea it could do that, thanks!

pez 2021-02-28T13:16:52.056500Z

I do think you can also use figwheel-main without re-natal these days.

raspasov 2021-02-28T13:39:21.057300Z

I use figwheel-main

raspasov 2021-02-28T13:39:30.057800Z

No re-natal needed these days, that’s correct

naomarik 2021-02-28T13:39:39.058Z

I love shadow-cljs, will try this out first. re-natal was such a headache back in the day.

raspasov 2021-02-28T13:39:57.058200Z

https://figwheel.org/docs/react-native.html

raspasov 2021-02-28T13:42:04.058900Z

Both should work pretty well (shadow-cljs and figwheel-main)

pez 2021-02-28T13:57:29.059700Z

I am also in love with shadow-cljs. Just relaying that, because I need to. 😍

zendevil 2021-02-28T18:56:32.060Z

I’m adding a DateTimePicker into my app like so:

zendevil 2021-02-28T18:56:37.060400Z

[:> DateTimePicker
    {:testId :dateTimePicker
     :value (Date. 1598051730000)
     :mode :date
     :is24Hour false
     :display :default
     }]

2021-03-01T13:09:29.063200Z

Give js/Date a try.

zendevil 2021-02-28T18:57:08.060900Z

According to the docs https://www.npmjs.com/package/@react-native-community/datetimepicker#rn--060 which use

new Date()

zendevil 2021-02-28T18:57:16.061300Z

But I’m getting the following error:

zendevil 2021-02-28T18:57:41.061400Z