fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
tony.kay 2021-02-03T02:48:38.225800Z

There is an integration library for stock Fulcro fulcro-css that lets you co-locate CSS rules on components that will end up component-namespaced. That is the limit of the real offerings around “styling” components in a Fulcro-reusable way; Otherwise, it’s just your normal toolchain you’d use with any other UI project (e.g. less, sass, etc.).

👍 1
tony.kay 2021-02-03T02:50:32.226Z

good question….js ecosystem is very much more unstable than the JVM ecosystem. I have mostly switched to using yarn. In this case it looks like one of the deps in the template still REQUIRES react 16, but the template has been updated to 17. Yarn perhaps doesn’t treat that as a hard error. Either way, you could either update react-icons or downgrade react/dom.

tony.kay 2021-02-03T02:52:29.226200Z

Yeah, that’s basically the approach. You could literally copy SUI plugin and sub out formatting in every function and largely just keep the structure in tact. RAD itself calls just a few top-level entry points. The actual code structure that a UI plugin uses is up to the plugin. I will not claim that the SUI one is pretty….I have not refined it for “excellence”, I consider it more of a “something to get us started” with hopes that the community will step up with better things.

👍 1
Björn Ebbinghaus 2021-02-03T15:53:12.231100Z

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.

wilkerlucio 2021-02-03T15:58:40.232200Z

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

Björn Ebbinghaus 2021-02-03T17:44:16.232700Z

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

wilkerlucio 2021-02-03T17:45:47.232900Z

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

Björn Ebbinghaus 2021-02-03T17:50:13.233100Z

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ý 2021-02-03T19:32:38.233900Z

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

❤️ 4
xceno 2021-02-04T09:47:23.236100Z

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 Rendtslev 2021-02-04T10:21:54.242300Z

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

Aleksander Rendtslev 2021-02-04T10:28:57.243600Z

On his point, and seeing this, it might be helpful to make some recommendations about "to RAD or not": https://www.reddit.com/r/Clojure/comments/kibrfs/fulcro_as_fullstack_framework_or_else/ggvwry3/?utm_source=share&utm_medium=ios_app&utm_name=iossmf&context=3

tony.kay 2021-02-04T14:07:17.244100Z

to @rob703’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.