Fork me on GitHub
#fulcro
<
2021-02-03
>
Björn Ebbinghaus15:02:12

Hey, Workspaces question here. Is there an easy way to wrap the render of cards (or even the whole workspaces UI)? I have a React provider for theming, that I want to apply to all cards.

wilkerlucio15:02:40

there are some lifecycle hooks, or you can make your own card type, has you checked the workspaces docs?

Björn Ebbinghaus17:02:16

Yes. I did, but I can't get it to work. The render function gets a HTML node, which is used to mount the fulcro app. I can't get it to render a react provider around the mountpoint of the app..

wilkerlucio17:02:47

I suggest you can try copying to code for the react card, and make your adjustments

Björn Ebbinghaus17:02:13

I tried to copy the fulcro-card, but I just can't get it to work...

(defn fulcro-theme-card-init [card config]
  (let [{::wsm/keys [render] :as react-card} (ct.fulcro/fulcro-card-init card config)]
    (assoc react-card
      ::wsm/render
      (fn [node]
        (let [id (str (random-uuid))]
          (js/ReactDOM.render
            (styles/theme-provider {:theme themes/light-theme} (dom/div {:id id}))
            node)
          (render (.getElementById js/document id)))))))

(defn fulcro-theme-card [config]
  {::wsm/init
   #(fulcro-theme-card-init % config)})

Jakub Holý (HolyJak)19:02:38

I have put down a first draft of the rationale for Fulcro, to add to the minimalist tutorial. Thoughts? https://gist.github.com/holyjak/7aa35046166b46734d48642eb51d5086

❤️ 12
xceno09:02:23

Minor nitpick: > related things are located together and it is easy to navigate (Command/Control-click) to all important code artifacts It's true, but someone who has never seen fulcro won't know what this means. I think clarifying it with a simple example (def bla :bla) would be enough (http://hypothes.is seems nice btw)

Aleksander Rendtslev10:02:54

I think this is great! As a newcomer this definitely gives a nice simple overview. One thing though: "business applications". I get that Fulcro RAD is perfect for just this use case, but reading that, a voice pops up in me saying: "wait, does that mean it's a poor fit for b2c applications? And consumer scale?" I don't think that's the case, and if it isn't I just wanted to mention that. I'm building a consumer scale application and I'm basing my mobile app on Fulcro. So far it's been amazing. Positioning RAD as the business application arm and Fulcro as everything else covered in the "rationale" would feel less alienating for someone like me. Just a thought

tony.kay14:02:17

to @U012ADU90SW’s point: I’m not sure that clarification is ideal. In RAD I do a bit of keyword naming so we get docstrings, so your example is true, but mutations are the central thing I was talking about. Instead of having things like events or even js strings as reducer actions (where grep is now your nav) you have something that looks like a function, for which IDEs can nav. I realize that better IDEs are starting to do decent things around event stuff in re-frame, but when I was building out Fulcro things were way more limited. If it didn’t look somewhat like a def of a symbol you were just screwed.