Fork me on GitHub

Wow, that was fun. Turns out your callback won’t be called unless the target namespace requires cljs.loader…even though it doesn’t use it


I’ve verified this is an expected behavior. Not too excited about that


Dynamic routing demo just pushed on develop! Documentation pending, but this will make it much easier to code-split applications with very little effort


I think I might have a little more work to do on the routing tree, but at least the basics are there. This is not production ready yet 😉


OK, I fixed it up a bit more. DynamicRouter should be working on 1.0.0-beta8-SNAPSHOT. See the demo for documentation and a working example. Dynamic and normal UI routers should work with each other, and should be able to be nested. If a route requires more than one thing to be loaded, it should also work. The nesting is untested, but the code for it is rather small and uses the same code path as the unnested case.


Added a demo to beta8 (develop) that shows how to use defrouter as a detail screen for heterogenous object selection


Is there a easy way to have access to the fulcro-router current page, in a component ?


So far this is the only thing that I came up with that works:


(defui ^:once Header  
  static om/IQuery
  (query [this] [{[:fulcro.client.routing.routers/by-id '_] [{:page-router [:current-route]}]}])
  (render [this]
    (let [current-route (get-in (om/props this) [:fulcro.client.routing.routers/by-id :page-router :current-route])]


@claudiu That is the best way if you want to look at it directly. Routes are somewhat of a denormalized thing, in that if you’re using HTML5 routing you have the “current page” in the URI


I mean, you could create a graph edge in your database that points to the router in your header object


they your query would be nicer


The router has a query and ident. You could just put the ident in your header’s initial state, and the query into your query. The the router would appear locally in props without the link query.


Just as a note to those playing with the dynamic loading stuff: I’ve been having a discussion on the clojurescript channel about some problems I’m seeing. It looks like the design for module loading is slightly busted, and will be changing slightly. Never hurts to have real code being written against it to find issues 🙂 The stuff I’m building in Fulcro should isolate you from those concerns, but it does mean that any dynamic loading stuff is going to be of alpha quality and a little unstable until they get it fixed completely in the compiler.


thank you for sharing. Really interesting chat on clojurescript channel 🙂