reitit

Casey 2024-05-13T15:25:06.363729Z

Is it possible to use reitit.ring.malli/temp-file-part to accept multiple files from a ? I naively tried :parameters {:multipart [:map [:vector [:file reitit.ring.malli/temp-file-part]]]} but malli isn't happy with the schema. (I'm using the reitit.http.interceptors.multipart interceptor)

Casey 2024-05-13T15:32:23.410609Z

Doh 🤦 of course the schema is not write.. it should be [:map [:file [:vector reitit.ring.malli/temp-file-part]]]}` now it works as expected!

2024-06-12T07:03:02.727219Z

Di you manage to add a "description" to your :fileparameter ?

Chase 2024-05-13T16:48:19.093959Z

I've set up front end routing using this example: https://github.com/metosin/reitit/tree/master/examples/frontend-re-frame but I'm trying to separate into a views.cljs file and a router.cljs file but keep getting stuck with a circular dependency error. Is there any way around this or do I need to keep the routing and views in the same file?

Chase 2024-05-13T16:54:35.772729Z

I have to create the circular dependency in the routes def where {:name ::home :view home-page ...} would have ::home namespaced to :routes/home but the home-page component is in views.cljs and in views.cljs I need to call out to the router namespace as :routes/home keyword in my re-frame/dispatch call

wevrem 2024-05-13T17:31:49.482869Z

If all you need is the keyword in view.cljs then maybe you can use as-alias:

(ns view
  (:require [routes :as-alias routes]))

(def routes [["home" {:name ::routes/home ...}] ...])
or something like that. I’m just sort of fudging the route syntax.

✅ 1
wevrem 2024-05-13T17:38:02.257339Z

I went back and looked and that is exactly how I’m doing it in my project. I have a router high-level namespace that requires a lot of sub-level namespaces, but inside each I use :as-alias so I can access the subscriptions and events defined in router. It works because re-frame references are all via keywords.

Chase 2024-05-13T18:30:14.849039Z

ahh ok, thank you, I'll try and get it sorted that way