Fork me on GitHub
#fulcro
<
2020-10-20
>
Mr. Savy02:10:41

when you define the initial state of a router in a component, it's different depending on whether you use template or lambda, is there a reason for this? will provide example in a bit.

Mr. Savy02:10:40

so I guess what i'm asking is, in the lambda case, what's the problem with just saying :outer/router {} as with the template?

Jakub Holý (HolyJak)17:10:20

because the template magic only works in the template form. With lambda you must do it manually. Notice the two are strictly equivalent (well, the template also has extra checks but functionally they are)

Mr. Savy03:10:26

ok, thanks!

vaedasynapse21:10:13

I’m venturing an update of the fulcro-native-template dependencies. I have managed to get the expo app running. But when I log in I’m getting the following error

ERROR [com.fulcrologic.fulcro.networking.http-remote:344] - 
#error {:message "Remote Error", :data {:outgoing-request {:headers {"Content-Type" "application/transit+json"}, :body "[[\"~#cmap\",[[\"~#list\",[\"~$app.model.session/login\",[\"^ \",\"~:username\",\"user\",\"~:password\",\"letmein\"]]],[\"~:session/valid?\",\"~:account/name\"]]]]", :url "", :method :post, :response-type :default}, :original-transaction [{(app.model.session/login {:username "user", :password "letmein"}) [:session/valid? :account/name]}], :headers {}, :body "", :status-code 500, :status-text nil, :error :network-error, :error-text "undefined [0]"}}
- node_modules/react-native/Libraries/LogBox/LogBox.js:148:8 in registerError
...
Any ideas on how I might go about figuring out what I need to change to get this to work? Here’s the files I’ve tweaked thus far - deps.edn
{:paths   ["src/main" "resources"]
 :deps    {org.clojure/clojure                 {:mvn/version "1.10.1"}
           org.clojure/clojurescript           {:mvn/version "1.10.773"}
           com.fulcrologic/fulcro              {:mvn/version "3.4.3"} ;;{:local/root "../../../localothers/fulcro"}
           com.fulcrologic/fulcro-native       {:mvn/version "0.0.8"}             ;{:local/root "../../../localothers/fulcro-native"}
           com.fulcrologic/fulcro-garden-css   {:mvn/version "3.0.8"}
           com.fulcrologic/guardrails          {:mvn/version "0.0.12"}
           garden                              {:mvn/version "1.3.10"}
           com.fulcrologic/semantic-ui-wrapper {:mvn/version "1.0.1"}
           edn-query-language/eql              {:mvn/version "1.0.0"}
           org.clojure/core.async              {:mvn/version "1.3.610"}
           com.wsscode/pathom                  {:mvn/version "2.3.0-alpha15"}

           ;; mock database
           datascript                          {:mvn/version "1.0.1"}

           ;; web server
           http-kit                            {:mvn/version "2.5.0"}
           bk/ring-gzip                        {:mvn/version "0.3.0"}
           bidi                                {:mvn/version "2.1.6"}
           hiccup                              {:mvn/version "1.0.5"}
           mount                               {:mvn/version "0.1.16"}
           ring/ring-core                      {:mvn/version "1.8.2"}
           javax.servlet/servlet-api           {:mvn/version "2.5"}
           ring/ring-defaults                  {:mvn/version "0.3.2"}
           metosin/reitit                      {:mvn/version "0.5.6"}

           ;; logging
           com.taoensso/timbre                 {:mvn/version "4.10.0"}}

 :aliases {:cljs {:jvm-opts   ["-DSENTE_ELIDE_JS_REQUIRE=true"]
                  :extra-deps {com.cognitect/transit-cljs          {:mvn/version "0.8.264"}
                               com.fulcrologic/semantic-ui-wrapper {:mvn/version "1.0.1"}
                               binaryage/devtools                  {:mvn/version "1.0.2"}}}
           :dev  {:extra-paths ["src/dev"]
                  :extra-deps  {org.clojure/tools.namespace {:mvn/version "1.0.0"}
                                thheller/shadow-cljs        {:mvn/version "2.11.5"}}}}}
package.json

Jakub Holý (HolyJak)17:10:30

good luck! Did you see any related logs on the server side? If it returned 500 then there must be a log about it? Little confused by the "undefined [0]", what could that mean?

vaedasynapse21:10:13

{
    "name": "app",
    "version": "1.0.0",
    "description": "",
    "private": true,
    "dependencies": {
        "highlight.js": "^10.3.1",
        "react-grid-layout": "^1.1.1",
        "react-icons": "^3.11.0",
        "reakit": "^0.16.0"
    },
    "scripts": {
    },
    "devDependencies": {
        "intl-messageformat": "^9.3.11",
        "karma": "^5.2.3",
        "karma-chrome-launcher": "^3.1.0",
        "karma-cljs-test": "^0.1.0",
        "npm-run-all": "^4.1.5",
        "react": "^16.14.0",
        "react-dom": "^16.14.0",
        "shadow-cljs": "^2.11.5",
        "showdown": "^1.9.1"
    },
    "author": "",
    "license": "MIT"
}
mobile/package.json
{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
  },
  "dependencies": {
    "expo": "^39.0.3",
    "expo-asset": "~8.2.0",
    "expo-barcode-scanner": "~9.0.0",
    "expo-blur": "~8.2.0",
    "expo-constants": "~9.2.0",
    "expo-file-system": "~9.2.0",
    "expo-font": "~8.3.0",
    "expo-haptics": "~8.3.0",
    "expo-image-picker": "~9.1.1",
    "expo-keep-awake": "~8.3.0",
    "expo-permissions": "~9.3.0",
    "expo-secure-store": "~9.2.0",
    "@expo/vector-icons": "~10.2.1",
    "native-base": "^2.13.12",
    "react": "16.14.0",
    "react-icons": "^3.11.0",
    "react-native": "",
    "react-native-gesture-handler": "~1.7.0",
    "react-native-modal-datetime-picker": "^9.0.0",
    "react-native-qrcode-svg": "^6.0.6",
    "react-native-svg": "^12.1.0",
    "reakit": "^1.2.5"
  },
  "devDependencies": {
    "babel-preset-expo": "^8.3.0",
    "socket.io-client": "2.3.1"
  },
  "private": true
}
mobile/app.json
{
  "expo": {
    "name": "Attendance",
    "slug": "ucv-attendance",
    "privacy": "unlisted",
    "entryPoint": "./app/index.js",
    "sdkVersion": "39.0.0",
    "platforms": [
      "ios",
      "android"
    ],
    "scheme": "ucvattendance",
    "version": "1.0.0",
    "orientation": "portrait",
    "primaryColor": "#cccccc",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "cover",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true
    },
    "description": ""
  }
}