Fork me on GitHub

@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?


yep sending reconciler works for transact! & load. But not for set-value! .


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).


Sure, it’s incubator and that macro was mainly for you 😉


@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.

👌 4

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?


And alias is to an ident/field.


@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???


Are there any talks/articles on fulcro from the community? (other than @tony.kay)


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).


@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


have you tried with a component that just has query (no ident) ?


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 🙂 the autocomplete stuff has something like that I think

(df/load component :autocomplete/airports nil {...}


Yep. nil for the component.


facepalm 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