fulcro

tony.kay 2025-06-15T02:49:25.291449Z

I’ve been working on React 19 compatibility. I think I have a version that works, and I’m releasing it as an rc. Try it out on your apps and tell me what you see. I had to rewrite how wrapped inputs worked, and the node function in the react dom ns no longer works (they removed the API for it) 3.9.0-rc1

🙏 1
🤘 4
🤘🏼 1
tony.kay 2025-06-26T12:38:57.328569Z

OH

tony.kay 2025-06-26T12:39:02.336959Z

Yeah, I did change input ref

tony.kay 2025-06-26T12:39:20.553639Z

are you using :ref or :inputRef?

tony.kay 2025-06-26T12:40:43.229709Z

inputRef isn’t something react itself supports…but is a common library name for it

Eric Dvorsak 2025-06-26T12:41:09.472689Z

:ref

tony.kay 2025-06-26T12:41:09.774069Z

I think my input wrappers used to proxy that, but I couldn’t figure out why, so I removed it

tony.kay 2025-06-26T12:41:31.772449Z

hm…so, yeah, I had to rewrite how the DOM inputs worked because of changes in 19

tony.kay 2025-06-26T12:42:17.785969Z

there is some chance I broke :ref, but I thought I tested it. Are you saying that with rc2 and react 18 it is OK though?

Eric Dvorsak 2025-06-26T12:43:17.289479Z

I didn't touch react version

Eric Dvorsak 2025-06-26T12:43:50.100039Z

it works with 48d7b63a1e81ca37cc965f9b0d9059b053f4db3c

tony.kay 2025-06-26T12:46:48.826539Z

ok, so yeah, I broke something about ref then

tony.kay 2025-06-26T12:47:48.546099Z

The dom ns in commit acc712caa54629bfa887273919ee72e95f1e3467 is where I had to change it to use hooks instead of older stuff that relied on API of react that they removed.

tony.kay 2025-06-26T12:48:44.204649Z

feel free to hack on it and see if you can spot the issue. You can also turn off wrapped inputs (see the docs) and use the synchronous transactions (with !! versions of mutations) and then you’ll be using the low level native inputs.

Eric Dvorsak 2025-06-26T13:25:51.953809Z

ok thanks we'll do

Eric Dvorsak 2025-06-25T19:32:12.789439Z

I've add issues with cljc files, clj part doesn't compile because it returns react-version 0

Eric Dvorsak 2025-06-25T19:34:04.074749Z

With react 18 I have a dropdown that stops working with the latest changes to fulcro:

dropdown.cljc:209 Uncaught TypeError: Cannot read properties of null (reading 'setSelectionRange')
    at eval (dropdown.cljc:209:26)
eval	@	dropdown.cljc:209

react-dom.development.js:4313 Uncaught TypeError: Cannot read properties of null (reading 'setSelectionRange')
    at eval (dropdown.cljc:209:26)
eval	@	dropdown.cljc:209

tony.kay 2025-06-26T01:47:15.442839Z

ah, should fix the compile issue 😛 The other one I don’t understand….

tony.kay 2025-06-26T01:47:25.319209Z

seems likely unrelated to Fulcro

tony.kay 2025-06-26T02:18:09.954989Z

rc2 released

🙌 1
tony.kay 2025-06-26T02:37:48.753539Z

also fixed CI problem

Eric Dvorsak 2025-06-26T06:43:38.454399Z

the dropdown error only happens with the new version of fulcro it's happening in an on-click event:

(fn [evt]
                 (evt/stop-propagation! evt)
                 (when-not open?
                   (-> input-ref
                       (.-current)
                       (.setSelectionRange 0 0)))
                 (toggle-menu))
where input-ref is a binding using a hook ^:js input-ref (hooks/use-ref)

Eric Dvorsak 2025-06-26T06:44:18.696339Z

I'd share the namespace but then it has further deps so I will need to make a minimal repro first when I'm back on fulcro's head

Jonas Rodrigues 2025-06-25T00:22:13.526229Z

@tony.kay I've been running 3.9.0-rc1 with React 18.3.1 for a couple of days without issues. Today I upgraded to React 19.1.0 and started seeing this warning at runtime:

2025-06-25T00:17:32.380Z INFO [com.fulcrologic.fulcro.algorithms.indexing:100] - component 's ident ([:page/slug nil]) has a `nil` second element. This warning can be safely ignored if that is intended. Props were {}
I also reproduced the same warning with React 19.0.0. The only change was the React version. I reviewed my app but can't find any reason for the ident to resolve to [:page/slug nil]. For reference, here's the relevant Page component:
(defsc Page [this {:ui/keys [editing] :page/keys [slug data]}]
  {:use-hooks? true
   :ident :page/slug
   :route-segment ["v" :slug]
   :query [:ui/editing :page/slug :page/data]
   :initial-state {:ui/editing false :page/slug "default" :page/data {}}
   :will-enter
   (fn [app {:keys [slug]}]
     (dr/route-deferred [:page/slug slug]
       #(df/load! app [:page/slug slug] Page
          {:post-mutation `route-success
           :post-mutation-params {:slug slug}
           :fallback `route-failure})))}
  (if editing
    (puck/editor
      {:config config
       :data data
       :onPublish (fn [data]
                    (comp/transact! this [(save-data {:page/slug slug :page/data data})])
                    (m/toggle! this :ui/editing))})
    (ui-page-content
      {:title slug
       :actions (more-actions
                  {:dropdown
                   (comp/fragment
                     (ui/menu-item
                       {:leftSection (ui/icon {:name :layout})
                        :children "Edit view"
                        :onClick #(m/toggle! this :ui/editing)}))})}
      (puck/render {:config config :data data}))))
Any ideas what might be triggering the nil in ident?

tony.kay 2025-06-25T01:53:57.500869Z

hm. THe react version affects nothing in these parts of the internals. I think you have some kind of coincidence

Jonas Rodrigues 2025-06-25T02:19:59.959009Z

I’ve tested multiple upgrade/downgrade cycles — clearing node_modules and rebuilding from scratch each time — to rule out caching issues or transient build artifacts. The results are consistent: the warning only appears with React 19, never with React 18. It makes me wonder if this is related to stricter timing or lifecycle changes introduced in React 19. I’ll dig a bit deeper and try to put together a minimal reproducible example.

tony.kay 2025-06-25T02:49:28.704239Z

So, the warning you are seeing might be related to a change in rendering speed I guess. The props are empty it seems, which indicates a render before the initialization, which should be impossible

Eric Dvorsak 2025-08-25T10:02:39.946219Z

Seems like this fixes it for us https://github.com/fulcrologic/fulcro/pull/570

tony.kay 2025-08-25T12:15:49.440369Z

Thank you. I have not had time to look into it.