This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-02
Channels
- # adventofcode (286)
- # aws (3)
- # beginners (243)
- # calva (4)
- # cider (51)
- # cljs-dev (8)
- # clojure (74)
- # clojure-conj (1)
- # clojure-france (1)
- # clojure-italy (1)
- # clojure-spec (21)
- # clojure-uk (22)
- # clojurescript (25)
- # clojurex (6)
- # code-reviews (5)
- # core-async (3)
- # cursive (1)
- # defnpodcast (1)
- # fulcro (29)
- # mount (1)
- # off-topic (85)
- # onyx (5)
- # other-languages (7)
- # pathom (6)
- # pedestal (6)
- # re-frame (20)
- # reagent (2)
- # reitit (8)
- # ring-swagger (10)
- # shadow-cljs (53)
- # spacemacs (8)
- # tools-deps (34)
Incubator 0.0.22 released to clojars with the new UI routing and documentation. The macros could use a bit of a tweak, things are lightly tested, and the algorithms are not as nice as I’d like, but a full-blown demo works, so I figured it was time to let others play with it. I don’t have a lot of time coming up, so be wary of using it in production until you test it a bit. They rely on dynamic queries, which is a feature I had to rewrite from Om Next, and it is not heavily used by anyone that I know (including myself). Therefore there could be deep bugs lurking in the shadows from long ago. That said, I think this version of routing is a heck of a lot easier to understand and use, and it has some cool features that co-located queries and idents make easy. Of particular note is the fact that the “path” to a router can be derived from the query, making the structure of the UI automatically construct your “URI paths”. This composition should hold up very well under refactoring, and “aliasing” paths is a simple transform on a vector of path components. I got all of the features in I could think of needing: - Composition and refactoring of UI “paths” without the need for any non-ui declarations. - Deferred routes to allow for loading (including for code splitting) - Custom UI for what to show on deferred and “failed” routes - The ability for an on-screen route target to “cancel” a new route (e.g. to prevent unsaved changes being lost) - Direct code navigation. Routers are linked together in an obvious composition that IDEs can easily navigate. - Declaration macros that minimize typing and do some error checking for you. The docs are here: https://github.com/fulcrologic/fulcro-incubator/blob/develop/dynamic-routing.adoc
Hi @U0CKQ19AQ, FYI, the embedded table UI diagram and the favicon reference are returning 404s.
Live demo at https://fulcrologic.github.io/fulcro-incubator/ (see the routing-ws demo card, and read the output in js console as you route)
BTW, state machine docs also converted to HTML at https://fulcrologic.github.io/fulcro-incubator/state-machines.html
Thanks @claudiu and @pvillegas12 and others for suggestions…and complaining about the less-than-ideal UI routers in Fulcro itself 🙂
What should I use in fulcro for <svg><image> tags? I only see <img> in fulcro.client.dom
could be a missing tag…if you look at the source you can just build your own…but I’m glad to add anything that is missing that is “official”
You can use incubator’s UI helper function fulcro.incubator.ui.core/component-factory
to create a function that will work just like the built-in DOM helpers in Fulcro…which is just a wrapper around a utility function fulcro.client.dom/macro-create-element
.
http://book.fulcrologic.com/#_queries_on_idents This shows that I can query for a specific table entry in an ident. How can I make the query dynamic? Rather than hard-coding [:person/by-id 1], I want to receive the person-id as a prop.
You can get what you want by creating a comp with that ident and using it just for getting the query (need to se the indent in the appdb)
On the phone now, hard to find :) but basically where you can find an example with a listing + view page.
If you look in fulcro inspect you will see something like {:my-page :singleton {:current-image [:image/by-id 5 }}
to navigate you just write a mutation that sets :current-image
@U06ANT2JK there is an implementation in the bootstrap stuff (its with the old defui interface) https://github.com/fulcrologic/fulcro/blob/86e68249e62b5ca091fbe68c107f5e8270adc85d/src/main/fulcro/ui/bootstrap3.cljc#L1144
Thanks, the bootstrap example’s a bit much but going through the normalization section again helped.