This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-29
Channels
- # announcements (4)
- # architecture (25)
- # babashka (23)
- # beginners (56)
- # boot (4)
- # calva (1)
- # cider (1)
- # cljs-dev (15)
- # clojure (135)
- # clojure-europe (4)
- # clojure-nl (21)
- # clojure-uk (61)
- # clojurescript (47)
- # community-development (4)
- # cryogen (11)
- # cursive (11)
- # data-science (11)
- # fulcro (25)
- # funcool (5)
- # graalvm (1)
- # graphql (4)
- # kaocha (4)
- # lambdaisland (20)
- # lumo (7)
- # meander (14)
- # off-topic (9)
- # pathom (2)
- # portkey (1)
- # re-frame (5)
- # reagent (53)
- # reitit (2)
- # ring (3)
- # shadow-cljs (32)
- # spacemacs (4)
- # sql (34)
- # testing (1)
- # tools-deps (3)
so, the “easy” workaround @roklenarcic is to use component-local state for full-name
during typing, and do your state updates (transact) on blur
@holyjak I added read-only form support (::form/read-only? on RAD master forms). So, now you can treat a form like a report. I’ll add the linkify stuff to it, as soon as I get some routing stuff added.
I should probably allow forms to just switch to read only mode based on the route param passed to them as well
I just pushed 3.1.23-SNAPSHOT of Fulcro. I’ve added some long-needed bits to the dynamic router, and updated the book. This is in preparation for building more complete routing into RAD as well. The new features are:
• You can resolve the path to a target with (dr/resolve-path)
. This allows you to dynamically look up the route (a vector of strings) to a target at runtime. It does, however, require that you are careful not to use the same target in more than one place in your application’s tree. Doing so, of course, will cause it to only find one of them, and “which one” will not be obvious. RAD will use this in order to allow you to move RAD components deeper into the tree, and not just place them in the root router.
• Reworked how will-leave
works. If you don’t change your app, it should be 100% bw compatible, but the new stuff allows you to ask, anywhere in the app, if an on-screen target would block routing without potentially triggering a reaction from will-leave
. This, of course, requires you rework your targets. The new support adds a :allow-route-change?
option. See http://book.fulcrologic.com/#_targets_denying_routes_v3_1_23
This includes the new function can-change-route?
as well, and also has a new component option :route-denied
and helper retry-route!
. The book explains how to use it all.
There are probably still little bugs, so I’m not releasing this formally just yet. I don’t expect the API to change, but I have to think about the dynamic query aspects of this, and I’m not sure I got them right.
Any idea why my router is getting nil props? This is the relevant part of the Root query:
...
:tem-organization/organization-number
{:tem-organization/latest-bill-run
[:bill-run/id
{:ui/subscribers-list-router
[:com.fulcrologic.fulcro.routing.dynamic-routing/id
[:com.fulcrologic.fulcro.ui-state-machines/asm-id
:minbedrift.ui/SubscribersListRouter]
{:com.fulcrologic.fulcro.routing.dynamic-routing/current-route
[*]}
{:alt0
[{:bill-run/subscribers
[:br-subscriber/subscriber-id]}
[:ui.fulcro.client.data-fetch.load-markers/by-id _]]}]}]}]}]
but when I resolve it against the app state (`com.fulcrologic.fulcro.algorithms.denormalize/db->tree`), it completely lacks the :ui/subscribers-list-router
part. :ui/* keys are removed only from server-side queries, no? The data I get includes:
...
{:tem-organization/organization-number "979199325",
:tem-organization/latest-bill-run
{:bill-run/id 47143}}
The router is in my DB (see the thread below).
Thank you!!!Ok, the problem is that I load! data for the parent component, which did not exist before and of course thus won't have the :ui/subscribers-list-router
(which the server, providing the data, knows nothing about)
I fixed it by adding the router's initial state to the incoming data via :pre-merge
yeah that initial-state composition is easy to get wrong
happens a lot, i think that’s what @U0CKQ19AQ is hoping to address with the floating roots
Thanks, I will look at those
Hm when I use StringBufferedInput
component, the weird thing is that when the underlying model is nil
my model->string
function gets called with ""
as the argument, which seem contrary to what you’d expect, I would expect the parameter to be nil.
how would I get emacs to properly align all of fulcros element macros arguments. by default if I have the argument map next to the element, it aligns the child element against the map rather than like it does in the examples like this
(div {:className "a" :id "id" :style {:color "red"}}
(p "Hello")))
(setq clojure-indent-style 'always-indent)
Hmm, I remember this, I have it to align-arguments, I remember there being some issues. I know that you can specify how you want a macro indented, but not sure if that is externalized, I didn't want to change the style I'm used to in all cases.
There's some documentation about that here: https://docs.cider.mx/cider/config/indentation.html#_macro_indentation
Seems like kind of a pain to do this for all the fulcro dom macros, personally. I switched over to always-indent
a while back and have no regrets.
I'll try it out, I already have that setting in my config. I think align arguments is great most of the time
@U1CUUKHDL I solved this recently by adding the following to the .dir-locals.el
file at the root of my project: https://gist.github.com/cjsauer/407a02529af6871bada5bdb6515ff8ac
Using this exact file requires all elements use the aliased form (dom/div)
, but you can easily tweak it to meet your needs. You might :refer [div]
for example, so you could add div
to that file alongside dom/div
I copied the elements from here: https://github.com/fulcrologic/fulcro/blob/f3d39173362e95a28e34d1f7417b1a2cbe2f05f5/src/main/com/fulcrologic/fulcro/dom.cljs#L16 There really aren’t that many DOM elements, so it’s pretty simple to just enumerate them.
Oh nice. Does this also cover custom components?
HTML5 routing just added to the RAD demo. Not super well-tested, but seems to work really well.
See @codonnell’s Blog post for some details that help understand the implementation if you read the source. https://chrisodonnell.dev/posts/giftlist/routing/ (this is on the develop branch of RAD demo)