Skip to content

v1.4.0 - 2015 Mar 9

Compare
Choose a tag to compare
@ptaoussanis ptaoussanis released this 01 Mar 14:33
· 402 commits to master since this release

This is a major BREAKING release. Biggest change is added support for web servers besides http-kit (only Immutant for now). A big thanks to @tobias for his assistance with the Immutant support.

  • BREAK: added support for web servers besides http-kit (see migration instructions) [@tobias #2]
  • BREAK: removed support for nil user-id broadcasts (previously deprecated in v1.3.0) [#85] [1]
  • Fix: temporary workaround for core.async router error-catching issues [@shaharz #97]
  • New: throw clear compile-time exception on encore dependency issues
  • New: enable clients to distinguish between auto/manual reconnects [@sritchie #105] [2]
  • New: allow arbitrary user-provided handshake data with :chsk/handshake events [@whodidthis #110 #111] [3]
  • Ref example: some clarifications re: how to authenticate users

Notes

[1]: Server-side (chsk-send! <user-id> <event>) calls used to broadcast to all nil-uid users when <user-id> was nil. Now you must use the special :sente/all-users-without-uid keyword for these cases. The new behaviour helps prevent unintentional broadcasting.

[2]: :chsk/state event data now contains :requested-reconnect? val.

[3]: Server-side make-channel-socket! fn now takes an optional :handshake-data-fn (fn [ring-req]) opt and client-side's ch-recv now receives [:chsk/handshake [<?uid> <?csrf-token> <?handshake-data>]] events.

MIGRATION INSTRUCTIONS (from any version < v1.4.0)

  1. Http-kit is no longer an automatic Sente dependency. To continue using http-kit, add [http-kit "2.1.19"] to your project.clj :dependencies.
  2. Your Clojure-side make-channel-socket! call must now take a web server adapter as first argument. To continue using http-kit, add [taoensso.sente.server-adapters.http-kit] to your Clojure-side ns form's :require entries and pass taoensso.sente.server-adapters.http-kit/http-kit-adapter as the first arg to make-channel-socket!.

So:

[http-kit "2.1.19"] ; <--- Add to project.clj :dependencies

(ns my-clj-ns
  (:require
    ;; Other stuff
    [taoensso.sente.server-adapters.http-kit] ; <--- Add this entry
    ))

;; (sente/make-channel-socket! <opts-map>) ; Old Clojure-side chsk constructor
(sente/make-channel-socket!
  taoensso.sente.server-adapters.http-kit/http-kit-adapter ; <--- Add this arg
  <opts-map) ; NEW Clojure-side chsk constructor

This change is a once-off nuisance that'll allow us the freedom of supporting a wide range of web servers in the future. Interested in a web server besides http-kit or Immutant? Am now welcoming PRs to support additional web servers.

Finally, please see the updated reference example project for instructions on switching to an alternative web server like Immutant.

/ Peter Taoussanis

[com.taoensso/sente "1.4.0"]