| Nim under the existing UI, not instead of it 56551a8 nandi yesterday | 1 | (ns frq.main-nim |
| 2 | "The real app, with the Nim core underneath it. |
| 3 | |
| 4 | `frq.main` with one line changed: `frq.net.nim/install!` where it says |
| 5 | `frq.net.dart/install!`. Everything else is shared with it — `bind!` and |
| 6 | `start!` are its own, the screens are `common/frq/screens/`, the state is |
| 7 | `frq.cells`, the actions are `frq.actions`. Nothing was reimplemented and |
| 8 | nothing was moved. |
| 9 | |
| 10 | A second entry namespace rather than a flag inside `frq.main`, for the |
| 11 | reason `frq.main-web` is one: `clojure -M:cljd compile` walks out from a |
| 12 | single namespace, so what `frq.main` requires is what every target compiles. |
| 13 | `frq.net.nim` reaches `package:frq_core`, which is `dart:ffi`, which the web |
| 14 | target has no library for — requiring it from `frq.main` would break the |
| 15 | build that works to serve the one being tried. |
| 16 | |
| 17 | Built as `flutter build linux -t lib/main_nim_app.dart`; see `just nim-app`." |
| 18 | (:require ["package:path_provider/path_provider.dart" :as pp] |
| 19 | [frq.main :as app] |
| 20 | [frq.io :as _io] |
| 21 | [frq.io.dart :as host] |
| 22 | [frq.net.nim :as net-nim] |
| 23 | [frq.oauth.dart :as oauth-dart] |
| 24 | [frq.atproto.dart :as atproto-dart] |
| 25 | [frq.pictures.dart :as pictures-dart])) |
| 26 | |
| 27 | (defn ^:async main [] |
| 28 | (app/bind!) |
| 29 | (host/install! (.-path (await (pp/getApplicationSupportDirectory)))) |
| 30 | ;; The one line that differs from `frq.main/main`. |
| 31 | (net-nim/install!) |
| 32 | (oauth-dart/install!) |
| 33 | (atproto-dart/install!) |
| 34 | (pictures-dart/install!) |
| 35 | (await (app/start!))) |