fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
xceno 2020-09-24T14:45:48.003400Z

Can I just nest dynamic-routers (`com.fulcrologic.fulcro.routing.dynamic-routing/defrouter`) with RAD forms like one can compose legacy-routers as described here? http://book.fulcrologic.com/#_composing_routers Couldn't figure it out by myself yet. I basically wan't some forms to be accessible as dedicated page like in the RAD example, but also as a pop-over/modal on another page

tony.kay 2020-09-24T14:47:52.004500Z

A form/report is just a component; however, if it isn’t used as a route target then you will need to call the form/report startup stuff that is in the will-enter of either (see source of macros)

tony.kay 2020-09-24T14:48:13.005Z

of just look in docstrings of form/report ns and find the right function

tony.kay 2020-09-24T14:48:18.005200Z

don’t remember names off top of head

xceno 2020-09-24T14:51:15.007300Z

Ah yes the form/create! calls, I've seen them. Yeah that should work. I was trying to make the same form a router-target in the top-level and the nested router, assuming the nested router could add a prefix somehow. so e.g. /element/edit/xxxx and in the nested router: /nested/element/edit/xxxx

tony.kay 2020-09-24T15:58:07.007700Z

nesting like that is fine, and is done in the demo

tony.kay 2020-09-24T17:40:50.014600Z

I’m happy to announce a better extensible type system for Fulcro’s on-the-wire protocol. Fulcro uses transit, but because so many functions have to create readers/writers it can be really hard to make sure all parts of the stack get extended properly when you want to add custom readers/writers for transit. Fulcro 3.3.6 now includes a custom type registry where you can specify how to encode/decode things (using a unified API) for CLJC. Fulcro Websockets was also updated (version 3.2.0) to support the type registry All other libraries use facilities that were already baked into these two libraries, so the entire Fulcro ecosystem should “just work” with extended data types on the wire now (handle-api-request for server middleware, http remote, transit-clj->str, transit-str->clj, etc). The book (and websockets README) have been updated to reflect the new usage. http://book.fulcrologic.com/#_custom_type_support This is a NON-breaking change (though 3.2.0 of websockets requires 3.3.6+ of Fulcro, of course). Anything you’re currently doing to add transit stuff to Fulcro is still there, just no longer necessary. I plan on also adding some cool extended support in the next big release of Inspect: Inspect runs in a different VM, so I can’t see your custom type handlers, BUT I can see your custom tag names and the “ground data” that is used to build up a given type. Thus, I should be able to install cljs readers that will allow you to use your custom types in the “Query” tab. For example:

(deftype Point [x y])

(transit/install-type-handler!
    (transit/type-handler Point "geo/point"
      (fn [^Point p] [(.-x p) (.-y p)])
      (fn [[x y]] (Point. x y))))
is what you’d use (in CLJC) to install support for a Point. Inspect query should then let you do this:
#geo/point [22 44]
to input a Point

🎉 8
tony.kay 2020-09-24T17:44:01.016400Z

I should probably also fix Inspect’s query tab to be an EQL tab that supports mutations…so that then this will work perfectly:

(create-rectangle {:upper-left #geo/point [1 1] :lower-right #geo/point [100 100]})

tony.kay 2020-09-24T17:45:05.016700Z

This will be in Inspect 3.0, which is not yet available.