Skip to content

0.8.0

Latest

Choose a tag to compare

@bbatsov bbatsov released this 29 Jun 05:32

Changes

  • Bump the minimum dependencies to Clojure 1.12 and ClojureScript 1.12.
  • Bump http-kit to 2.8.1 and (dev-only) piggieback to 0.6.0.
  • The REPL client now talks over the platform's native WebSocket instead of
    the legacy goog.net.WebSocket / clojure.browser.net machinery. As a
    result the client runs in any modern JavaScript runtime (browsers, Node 22+,
    Deno, Bun, web/service workers), not just the browser. Two consequences worth
    calling out:
    • The weasel.impls.websocket namespace, previously a goog.net-based
      protocol implementation, is now a small functional wrapper. Code that
      depended on its old vars (websocket-connection, the IConnection
      protocol, etc.) needs updating.
    • The objects passed to the :on-error and :on-close callbacks are now
      native WebSocket events rather than goog.net.WebSocket events.

Enhancements

  • The client now reconnects automatically when the connection drops (page
    reload, server restart, flaky network) using an exponential backoff. It is
    on by default and tunable via the :reconnect?, :reconnect-delay and
    :max-reconnect-delay options. Call weasel.repl/disconnect to close the
    connection and stop reconnecting.
  • Added an optional application-level heartbeat (:ping/:pong) that detects a
    silently dead connection and triggers a reconnect. It is off by default and
    enabled via the :heartbeat-interval option; it never disrupts a server that
    doesn't answer pings.
  • The server no longer rejects a second client. Several clients may be connected
    at once; evaluations go to the most recently connected one (so a new client
    takes over the REPL) while the others stay connected and their output still
    reaches the REPL. An evaluation whose target client disconnects mid-flight now
    reports an error instead of hanging the REPL.
  • The server now validates the Origin header of incoming WebSocket
    connections. By default only local origins (localhost, 127.0.0.1, [::1])
    are accepted, closing a hole where any page open in the developer's browser
    could connect to the REPL. Use the new :allowed-origins repl-env option (a
    collection of origins, a predicate, or :all) to widen it. Non-browser
    clients send no Origin header and are unaffected.
  • Ship a deps.edn so the library can be consumed via the Clojure CLI / tools.deps.
  • Add a GitHub Actions CI pipeline and a basic test suite, including a Node
    round-trip integration test that exercises the full eval cycle over a real
    WebSocket.