32 Matching Annotations
  1. Jul 2023
    1. {:recipe/id "2" :recipe/name "Yogurt" :recipe/line-items [...]}

      This isn't really a solution because you might need a qty on this. E.g. a recipe needs four slices of bread, and you want to link to the bread recipe. You could add a virtual attribute to the recipe itself (e.g. include :line-item/qty via resolver tricks).

    2. . The EQL solution is the most straightforward and covers 95% of all cases.

      It would be nice to have an example of Categories/subcategories showing how that would be solved, or even a different recipe that you could link to.

      [:ui/children-visible? :category/id :category/label :categoy/children ...]

    3. recipe that contains other recipes

      This is the tough one, and the way to classify this one is that the recursion is not like categories or filesystems because the recursion is offset by at least one. E.g. A file IS a directory, so directories containing files can be modeled as an immediate parent/child relationship and simple recursive queries work without any effort.

      With the recipes, a recipe has line items which include a quantity, and the line item contains an ingredient or recipe...so the recursion is offset by an intermediate element.

  2. Feb 2021
    1. only Root can "see" keys at the root of the client DB

      This is only partially accurate. It is true that props are relative, and that joins on keywords are relative, but any component that has a reified data path can query by ident or link ([:root-key '_]) to see anything at the root (tables, root keys).

    1. Its flexibility and customizability is outstanding

      Perhaps: All of the critical features from network interaction to rendering optimization are easily customizable..

  3. Jan 2021
    1. load!-ing data

      You might consider talking about merge-component! first, since it is a load! without networking. Then it is easier to explain that load is just merge-component that obtains data from the remote.

    2. We can call the mutation as a function, which will simply return its name as a symbol (and the params map)

      Not quite correct. The call (m x) returns the expression itself as data. (m x) => (list 'm x)

    3. You can use it to define the state of the application before any data is loaded from the server-side.

      Interesting note: Initial state is essentially the props you want to get passed on the first frame. The fact that we have idents on components means we can normalize such a tree to get what we need.

    4. Fulcro application

      A mutation is always capable of both local and remote behavior. So, the Remote? decision isn't an "If" but more of a split where one side goes through a "Remote?" gate.

  4. Dec 2020
    1. As described there, we use the "magic" :> namespace for our "flat joins", i.e. to introduce an artificial level of structure to our flat data:

      I'd note that this is not part of Fulcro's query engine, but instead a useful invention of Pathom. As far as Fulcro is concerned this are just normal joins. It has no knowledge of the magic.

    2. They both will query the ID property and will typically request some different and some shared properties. The data of both will be stored at the same place in the DB.

      Might want to point to the portions of the book that explain the merge behavior for this case. Most ppl have not thought about this scenario very deeply, and assume Fulcro just blindly merges or overwrites, neither of which are true.

    3. you want to pre-load both the PersonView and PersonDetails of the logged-in user:

      So, my intention is for the transaction processing to be able to batch loads (which is a trivial upgrade to the current system). I consider writing a component to do that job to be a problem. I always issue separate loads in this situation. If you need request-combining, it could be a nice contribution to the lib. Be glad to explain how to do it.

    4. initial state is correctly composed

      This is only necessary if the component in question is part of the actual initial state. Components whose data is dynamically loaded typically do not have I.S.

  5. Jul 2020
  6. May 2020
    1. but with additional abilities

      They actually are react components (or if you use hooks they're functions with added attributes at the js level). Really, the main thing this does is allow you to add an open-map of options that are carried around with the component, some of which are defined/used by Fulcro itself. Primary among them will be the query/ident/initial-state entries.

  7. Nov 2019
  8. book.fulcrologic.com book.fulcrologic.com
    1. Will RAD have query definitions that both work on client and server

      The concept you're looking for are Pathom connect inputs: Declaring what data you need in order to be able to run is the correct model. It is query-like. See Pathom Connect ::pc/input.

      Pathom can then use the context of the items in context to resolve the data you need, even if it is not in the UI query.

    2. becauseit's annoying to battle the form validator only to be sent to a login form and realise youneed to login on your phone and do it all over again.

      This case is already handled by how I've modelled the controller/auth. You'll never reach a form route without first being force to authenticate.

    3. Unauthorized but because [specific reason] the correct role is not assumed?

      This is an interesting case that I see utility in for a case like "I'm an employee that wants to give a customer a refund, but I need manager approval". But again, mixing this into a single model of things makes a mess. I'd rather see us extend the map of attributes to include this on special keys like ::authorization/promotable ...

    4. good UI should not allowusers to do something they can't do

      Correct: This case is a pure security concern, and failure here indicates hacking more likely...having a server 500 is fine. Screw em.

    5. Logged out? Log in screen

      Authentication (logging in) is a separate concern, which is handled by the controller/auth system in the UI. It analyzes the query for the authorities that own the keys, and auto-trggers login before any actual queries run.

    6. Not sure how the in depth handling should work

      Remember that queries will run on resolvers, which technically resolve an edge. A single resolver could resolve one attribute or a whole subtree. As a result these kinds of protections on the server are a post-processing step that walks the entire result and redacts information.

      Validation happens at the attribute interaction layer...as events happen on the UI, or as triggered by other subgraph processing logic (full-form validation).

      Save logic needs to be applied at the server layer on a delta (flat map keyed by ident, with attribute changes).

    7. You could create a multi-method that dispatches on the guard keys

      I'd much prefer that we avoid multimethods. They cause code bloat in CLJS because they do not allow DCE...so if you had a library of them it could make builds quite large.

    8. hare the exact same problem set?

      I don't agree with this statement. They share some overlap in implementation, but are conceptually different. I'm game for considering an API that tried to eliminate boilerplate on implementation, but I'm not super excited about completely mixing these concerns.

  9. Aug 2019
    1. ook for Fulcro developers that can be used by beginners and experienced developers and covers most of the library in detail. Fulcro has a pretty extensive set of resources on the web tailored to fit your learning style. There is this book, YouTube videos, an interactive

      This para.....