nandi/frqpublic Fork 0
36bdfc5f7539b88587f3ce83e2701a6bc844f191
Commits
Clone
git clone https://git.rickub.com/nandi/frq.git
git clone ssh://git@rickub.com/nandi/frq.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Nim under the existing UI, not instead of it 56551a8 · on 36bdfc5f7539b88587f3ce83e2701a6bc844f191 · nandi · yesterday
main_nim.cljd · 35 lines · 1.5 KBText Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(ns frq.main-nim
  "The real app, with the Nim core underneath it.

  `frq.main` with one line changed: `frq.net.nim/install!` where it says
  `frq.net.dart/install!`. Everything else is shared with it — `bind!` and
  `start!` are its own, the screens are `common/frq/screens/`, the state is
  `frq.cells`, the actions are `frq.actions`. Nothing was reimplemented and
  nothing was moved.

  A second entry namespace rather than a flag inside `frq.main`, for the
  reason `frq.main-web` is one: `clojure -M:cljd compile` walks out from a
  single namespace, so what `frq.main` requires is what every target compiles.
  `frq.net.nim` reaches `package:frq_core`, which is `dart:ffi`, which the web
  target has no library for — requiring it from `frq.main` would break the
  build that works to serve the one being tried.

  Built as `flutter build linux -t lib/main_nim_app.dart`; see `just nim-app`."
  (:require ["package:path_provider/path_provider.dart" :as pp]
            [frq.main :as app]
            [frq.io :as _io]
            [frq.io.dart :as host]
            [frq.net.nim :as net-nim]
            [frq.oauth.dart :as oauth-dart]
            [frq.atproto.dart :as atproto-dart]
            [frq.pictures.dart :as pictures-dart]))

(defn ^:async main []
  (app/bind!)
  (host/install! (.-path (await (pp/getApplicationSupportDirectory))))
  ;; The one line that differs from `frq.main/main`.
  (net-nim/install!)
  (oauth-dart/install!)
  (atproto-dart/install!)
  (pictures-dart/install!)
  (await (app/start!)))