This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-22
Channels
- # announcements (2)
- # beginners (137)
- # chlorine-clover (13)
- # clj-kondo (3)
- # cljsrn (4)
- # clojure (52)
- # clojure-australia (3)
- # clojure-dev (2)
- # clojure-europe (34)
- # clojure-nl (1)
- # clojure-sg (3)
- # clojure-spec (1)
- # clojure-uk (12)
- # clojurescript (2)
- # clojureverse-ops (7)
- # code-reviews (3)
- # conjure (2)
- # cursive (18)
- # datavis (21)
- # datomic (34)
- # exercism (1)
- # figwheel-main (6)
- # graphql (3)
- # helix (21)
- # introduce-yourself (1)
- # jackdaw (1)
- # jobs (4)
- # jobs-discuss (32)
- # juxt (14)
- # leiningen (6)
- # lsp (35)
- # meander (19)
- # nrepl (2)
- # off-topic (37)
- # portal (40)
- # quil (5)
- # re-frame (45)
- # reagent (10)
- # releases (1)
- # remote-jobs (4)
- # reveal (15)
- # sci (7)
- # shadow-cljs (40)
- # spacemacs (3)
- # tools-build (2)
- # vim (17)
- # xtdb (11)
Newbie here. Inspired by https://www.lucacambiaghi.com/posts/react-native-cljs.html i have converted a basic clock example from the https://reagent-project.github.io/ page to react native using figwheel.main:
(ns fig.main
(:require [reagent.core :as r]
[reagent.react-native :as rrn]
[clojure.string :as str]))
(defonce timer (r/atom (js/Date.)))
(defonce time-color (r/atom "#f34"))
(defonce time-updater (js/setInterval
#(reset! timer (js/Date.)) 1000))
(defn greeting [message]
[rrn/text message])
(defn clock []
(let [time-str (-> @timer .toTimeString (str/split " ") first)]
[rrn/view
{:style {:color @time-color}}
time-str]))
(defn color-input []
[rrn/view
"Time color: "
[rrn/text-input {:type "text"
:default-value @time-color
:on-change #(reset! time-color (-> % .-target .-value))}]])
(defn hello []
[rrn/view {:style {:flex 1 :align-items "center" :justify-content "center"}$
[rrn/text "Hello world, it is now"]
[clock]
[color-input]])
(defn renderfn [props]
(r/as-element [hello]))
(defn figwheel-rn-root []
(renderfn {}))
The repo is https://github.com/ronnac/clock-rrn. It runs fine when I run it in the expo web emulator with expo start --web
after having applied the https://github.com/bhauman/figwheel-main/issues/304. However, when I build an apk with clj -m figwheel.main -O advanced -bo android
and expo build:android -t apk
and install I on my phone, it only shows:"waiting for figwheel to load files". I would have thought that figwheel removes itself from a production build? What am I doing wrong?
I’m trying to debug a figwheel config on a legacy Om Next app. I’ve got things compiling on file changes, but the web page itself actually takes 30+ additional seconds before it shows the little clojure icon and becomes responsive again. Any tips?