Fork me on GitHub
Eccentric J03:04:38

I’m a little more familiar with SQL than graphing. The sample:

(fdn/db->tree [{:friends [:list/label]}] (comp/get-initial-state app.ui/Root {}) {})
Is kind of like?
SELECT label FROM (SELECT friends FROM state) list


i think that's a fair comparison. the other piece is that in fulcro you'll get back a tree of data (nested maps) instead of a table with foreign keys that you'd have to turn into a tree with the sql

Eccentric J20:04:29

Ah I see, so it's almost like including SQL JOIN statements?


i suppose you could think of it like that, but eventually the comparisons run out because it's a different paradigm. it's a graph db, some similar ideas are things like

Eccentric J21:04:56

Fair enough, will just have to let go of the comparisons and treat it as something new.


in the fulcro 3 docs for mutations it says this

but Fulcro 3 includes a way to declare them so that they auto-quote themselves for convenience 


does this mean we no longer have to use (declare-mutation blah `blah) anymore ? I think it does


you don't need to quote them if there are no circular dependencies (mostly would happen with a component that uses the mutation and a mutation that uses a component ns) that section has the info on a mutation now returning itself as a list when call as a function


gotcha .. @danvingo thanks .. i read that and was just confused a bit but happy to do longer have to use that declare-mutation anymore


I am trying to use the external react component ‘material-table’ in my app, but I am getting the following error:

Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Here is a summary of how I am using it:
(:require ["material-table" :refer [MaterialTable]])
(def mtable (interop/react-factory MaterialTable))
(mtable ...)
For testing purpose, I have also tried to import a VictoryChart component as shown in the Fulcro book and that works. What am I doing wrong with material-table?


I would try

(:require ["material-table" :default MaterialTable])


Yes, it fixed it. Thank you very much @UH9091BLY.


are there any best practices for encoding errors from server responses? Specifically for validation and auth sort of concerns - do you just come up with a well-known key in your all your server responses :server/message :server/error or something and then pull that out of the :result of the env? It would be great to use returning but then you'd need every component to know about the server interaction field


i think this has what i'm looking for

👍 1

Does workspaces work with Fulcro 3? can’t get it to detect any cards


are you using ?


or browser



i think the custom target broke with the recent shadow and/or cljs release


This is my setup


:workspaces  {:target     :browser
                        :modules    {:main {:entries [app.demo-ws] :init-fn app.demo-ws/main}}
                        :ns-regexp  "-(test|ws)$"
                        :output-dir "resources/public/workspaces/js"
                        :asset-path "/workspaces/js"
                        :devtools   {:preloads           [com.fulcrologic.fulcro.inspect.preload]
                                     :http-root          "resources/public/workspaces"
                                     :http-port          8023
                                     :http-resource-root "."}}


this is from the fulcro template, I updated it to this and it's working


but for me, the build was failing completely, so i'm not sure you're having the same issue

Björn Ebbinghaus21:04:19

The key for root is wrong You are using ::f.portal/root it should be: ::ct.fulcro/root


@U4VT24ZM3 Updated to ct.fulcro and still not loading the card


Updated to ::ct.fulcro/root but still blank


@grierson hello, are you requiring the file? you can use the workspaces target to automatically load, otherwise you have to require the namespaces yourself


Fixed it. Just needed to delete js files. Thanks! 🙂


@grierson Yes, but it pulls in F2 deps, so I don’t recommend using the nubank one


I’ve published an alternate fork version that is written in F3


At some point I expect Wilker might merge that back as official, but he was still so heavily using F2 that he has not.