reitit

Jack Arrington 2026-02-26T17:06:11.145609Z

Bit of a weird problem. I've got a UIx React app set up with SSR. On the server side, I'm getting the route with (match-by-path), which returns me a map like this:

;; (match-by-path routes (:uri request))
reitit.core.Match
{:template    "/"
   :data        {:name :upload
                 :view upload-page[]}
   :result      nil
   :path-params {}
   :path        "/"}
Then the frontend is using reitit.frontend.easy, which populates my match atom with something like this:
{:controllers  []
 :data         {:name :upload
               :view jarrington.repeatrr.pages.up...[]}
 :fragment     nil
 :parameters   {:path {} :query {} :fragment nil}
 :path         "/"
 :path-params  {}
 :query-params {}
 :result       nil
 :template     "/"}
Still the correct :name, but the fact that they don't match exactly causes me hydration errors on the frontend :/. Is there something else I should be using instead of (match-by-path) on the CLJ side to make them match? There's also the fact that I'm storing a reference to the view functions directly inside the route which could also prove problematic, since the identities will not match between CLJ and CLJS.

juhoteperi 2026-02-27T08:11:44.604089Z

No experience on such cases. We don't have Clj version of the frontend match functions currently. Maybe we should have, but the current version does use JS interop.

Jack Arrington 2026-02-27T12:19:05.709599Z

When you say, "the current version does use JS interop," I assume you mean the current frontend match functions use JS interop, which is why they're not available in / easy to port to the Clj version?

Jack Arrington 2026-02-27T12:24:49.293889Z

yeah, makes sense

Jack Arrington 2026-02-27T12:25:36.665709Z

I'll have to go the other route, and see if I can get the hydration to ignore the mismatched value of my match atom on the server vs the client

Jack Arrington 2026-02-27T12:25:58.855099Z

Thanks for the input, both of you 👍

opqdonut 2026-02-27T06:40:38.704829Z

That's a good question! @juhoteperi might be able to tell you more about SSR / isomorphic reitit use.