This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-16
Channels
- # announcements (11)
- # beginners (184)
- # calva (91)
- # cider (68)
- # cljdoc (42)
- # cljs-dev (44)
- # clojure (228)
- # clojure-dev (1)
- # clojure-europe (3)
- # clojure-italy (4)
- # clojure-losangeles (6)
- # clojure-nl (9)
- # clojure-spec (73)
- # clojure-uk (19)
- # clojurescript (61)
- # core-async (6)
- # cursive (2)
- # datomic (11)
- # fulcro (28)
- # hyperfiddle (16)
- # leiningen (2)
- # luminus (3)
- # off-topic (19)
- # om-next (1)
- # re-frame (2)
- # reagent (12)
- # reitit (4)
- # ring-swagger (5)
- # shadow-cljs (14)
- # slack-help (6)
- # spacemacs (2)
- # tools-deps (40)
- # vim (15)
- # yada (4)
@tony.kay Silly question, but can't put my finger on the internals. m/set-value
requires a component, also transact!
& df/load
have logic for refreshing the ui if I send a component (as far as I can tell). If I'm in a static context but I have: component, it's intial state, reconciler, app-intial-state. Is there any way that I can generate a "component" that would work with those methods the same as if I would use it in the render with this
?
Can’t you pass in the reconciler?
for the fulcro incubator defextended-defsc
. would you be interested in a PR that updates the macro to take a third argument for extend "mandatory" ? Now it validates the implementation, what I would need for my mini-projects is to have 4-5 new keywords that are optional (like defsc).
@tony.kay are there some known issues with state machines, aliases and deeply nested components? I’ve got an actor that has a component inside (so without denormalization, it has an ident as a property) and the aliases don’t seem to go past that ident.
That is correct @levitanong: The state machine code expects actors to have properties at the moment, not children. If there is a normalized child, then it also needs to be a component. To-many relations are not yet implemented as well.
If this is the case, then would it make sense to let plugins have access to a derefed version of the app state, so that manual denormalization can happen?
@claudiu if you’re writing library code you’ll often have to go beyond the simple public interface. set-value is one such case: It requires a component because it needs to calculate the ident…but that is convenience for the user in a particular context. Transact works with a reconciler, but all you get from using a component is refresh (which you can also get by adding the ident as a follow-on read)…so I think that is what you’re asking: how to refresh UI from reconciler???
You can also search for Untangled. There were articles written back when it was called that…for example on the AdStage blog (where they now use Fulcro). https://medium.com/adstage-engineering/tagged/untangled
@tony.kay nope I get that. It's not actually a problem, trying to understand the internals and if there is room for improving some things in the lib i'm trying to build
(defsc-route LibrariesPage [this props]
{...
:componentWillMount (fn []
; both work
(m/set-value! this :test 1)
(df/load this :libraries Library {}))
:before-enter (fn [{:keys [::nav-router/reconciler] :as router-data}]
; will not work
(m/set-value! this :test 1)
(df/load this :libraries Library {})
;can be replaced with this
(df/load reconciler :libraries Library {}))}
...)
I get that this
in the context of componentWillMount is different than the static one generated by defsc for :before-enter
. But I was thinking if it's possible to make the this behave the same for df/load
, transact! & m/set-value!.
So basically if i have: component + reconciler + initial state ... can I get something that would work like this with the fulcro state & network utils ?
Is there a way to do a load with (df/load ...)
and not want to normalize? ie. not passing a component to df/load
what would the query
even be?
I just need the data blob to be placed in a specific target
I can do it with a mutation, but I would think using load
would be better (from a semantics point of view)
ahh oky 🙂 got it 🙂 http://book.fulcrologic.com/#_the_ui_and_post_mutation the autocomplete stuff has something like that I think
(df/load component :autocomplete/airports nil {...}
` that’s the first thing I tried and failed. Once I had everything working with a placeholder component,
nil
works
@tony.kay I have successfully removed the file middleware madness I was doing by removing the serial?: false
, the api remote waits for the file remote to finish now