hyperfiddle

braai engineer 2025-12-28T13:11:40.407339Z

For those who want to upgrade the Electric Clojure v3 starter to Ring 1.15.3 (deps.edn: ring/ring {:mvn/version "1.15.3"}), Jetty 12 now supports built-in websocket config (note :ws-idle-timeout etc.), e.g. in file src-dev/dev.cljc:

#?(:clj
   (defn start-server! [port]
     (ring/run-jetty
       (-> (fn [ring-request] (-> (ring-response/resource-response "index.dev.html" {:root "public/myproject"}) (ring-response/content-type "text/html")))
         (wrap-resource "public/myproject")
         (wrap-content-type)
         (electric-ring/wrap-electric-websocket (fn [ring-request] (myproject.main/electric-boot ring-request)))
         (wrap-demo-authentication)
         ; note: no rejection here for stale Electric client
         (cookies/wrap-cookies) ; order?
         (wrap-params))
       ; relevant config below:
       {:host "localhost"
        :port port
        :join? false
        :ws-idle-timeout (* 60 1000) ; 60 seconds in milliseconds
        :ws-max-binary-size (* 100 1024 1024) ; 100M
        :ws-max-text-size (* 100 1024 1024)})))

πŸ‘€ 1
πŸ”₯ 4
βœ… 1
noonian 2026-02-01T20:34:30.601259Z

I ran into this today. In ring 1.15.3 the approach in the starter app and datomic browser will throw java.lang.ClassNotFoundException for org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer and the fix is to replace usage of the configurator with the keyword options to run-jetty

πŸ‘€ 1
Dustin Getz (Hyperfiddle) 2026-02-01T20:44:15.847159Z

ok, we have a new release coming soon, i will make a note to consider upgrading ring

πŸ‘ 1
Dustin Getz (Hyperfiddle) 2025-12-28T18:15:11.835089Z

I am trying to understand what this is "Jetty 12 now supports built-in websocket config" and what it has to do with Ring 1.15.3

Dustin Getz (Hyperfiddle) 2025-12-28T18:15:32.065719Z

I see here https://github.com/ring-clojure/ring/blob/master/CHANGELOG.md RIng 1.14 "Added Jetty option :ws-idle-timeout for setting idle timeout (#513)"

Dustin Getz (Hyperfiddle) 2025-12-28T18:15:49.006349Z

I see Ring 1.14 is the first version supporting jetty 12

Dustin Getz (Hyperfiddle) 2025-12-28T18:16:33.425119Z

I see electric-starter-app uses ring 1.11 https://github.com/hyperfiddle/electric3-starter-app/blob/main/deps.edn

Dustin Getz (Hyperfiddle) 2025-12-28T18:19:19.892039Z

Ring 1.14 was launched in April 2025, here is the previous thread https://clojurians.slack.com/archives/C7Q9GSHFV/p1744227345619169

Dustin Getz (Hyperfiddle) 2025-12-28T18:20:36.967429Z

I see we have an internal ticket to upgrade to Jetty 12 which we have not done yet. I recall that the reason is because enterprise users mostly hadn't upgraded and we can't drop support for older versions

Dustin Getz (Hyperfiddle) 2025-12-28T18:23:57.282099Z

I see this comment from our jetty 12 discovery work: β€’ ;; ring/ring {:mvn/version "1.14.1"} ; jetty 12, works but message payload size tunning API has changed, we need to upgrade it.

Dustin Getz (Hyperfiddle) 2025-12-28T18:26:43.681919Z

Ok, I think what you're telling me is that you upgraded to Ring 1.14, and therefore you had to update the "ws message payload size tuning", and the config map you provided shows us how you did that

Dustin Getz (Hyperfiddle) 2025-12-28T18:28:24.851749Z

Just for full context and XY problem etc, what problem were you facing that made you do this? Was this because security audits flag Jetty versions prior to 12 as EOL? Or did you need Jetty 12 features?

braai engineer 2025-12-28T23:09:58.375609Z

I added dep https://github.com/latacora/mcp-sdk to a project, which bumps Ring, but the electric starter template is not compatible with that version and I don’t know how to deal with multiple versions of libraries in the same project. I regard that as a deficiency in both Java and Clojure.

πŸ‘ 1
πŸ‘πŸ» 1
Dustin Getz (Hyperfiddle) 2025-12-29T02:33:55.786639Z

you can force it to downgrade, chatgpt knows how

Geoffrey Gaillard 2026-02-05T10:30:43.473509Z

https://clojurians.slack.com/archives/C7Q9GSHFV/p1770287316819369

πŸ‘ 2