Liking cljdoc? Tell your friends :D

Dev Changelog — Electric Clojure

Clojars Project

  • alpha (new feature work and enhancements in development)
  • minor breaking changes allowed at this time
  • major versions ("v2-alpha") are marketing numbers and will increment with major milestones

next up

  • low-level runtime & missionary design improvements to unblock the next Electric major version
  • Electric UI control improvements (high level UI controls with optimistic updates that account for sync/latency/failure state)
  • documentation and demos

v2-alpha-349-ge9996713 — 2023 June 19

  • fix: e/offload no longer introduces unintended re-runs of electric code
  • fix: regression on using keywords/symbols as DOM classes
  • fix: DOM class parsing
  • fix: regression on dom2/props improperly setting some DOM attributes

v2-alpha-338-geec2f3df — 2023 June 9

  • introduce new internal DOM event handling strategies, used internally by electric-dom2 and electric-ui4. This fixes long-standing bugs:
    • breaking: remove dom2/Event, dom2/event* (likely no userland impact)
    • remove dom2/on (1-arity only, other arities remain). Likely no userland impact.
    • fix: dom2/on’s e/fn callback can unintentionally see multiple events under conditions of rapid successive dom events. Note: due to the quirks of this API, userland dom2/on usages might possibly rely on the above broken behavior, which means you may need to debug some call sites.
    • fix: console error "two events in the same frame"
    • fix: ui4/input focus glitch under latency
  • fix: Two Clocks demo drains battery life even if tab is hidden.
    • Server-streamed clocks now pause when the tab is blurred, thus not holding network stream open and draining battery life on mobile when the tab is running in the background. Note, pausing network in userland based on visibility is a workaround for the underlying issue which is that websockets don't have native backpressure in all browsers yet.
  • introduce e/dom-visibility-state, used by e/system-time-ms to pause server clock streaming on tab blur.
  • introduce e/dom-mousemove singleton for current mouse coordinates. Note: for efficiency and glitch-prevention, singletons should be used for all globally shared signals like this.
  • error handling: detect missing HYPERFIDDLE_ELECTRIC_SERVER_VERSION environment variable in production build
  • fix: docker files HYPERFIDDLE_ELECTRIC_SERVER_VERSION misconfiguration
  • fix: websocket no longer fails to reconnect in presence of URL fragment
  • fix: dom :class prop prematurely removed in edge case where that prop had been shadowed from subsequent (dom/props) call
  • fix: input type range displaying knob in wrong position on max > 100
  • fix: "cannot infer target" shadow warning on js field/method interop
  • fix: TodoMVC commit edit changes on blur
  • fix: "inst_[...].lause is not a function" error on hot code reload
  • fix: missionary-contrib no longer requires core.async on classpath; this ns is used in the datomic client missionary adapters.
  • bump shadow-cljs to 2.22.10

v2-alpha-263-g89da9d11 — 2023 April 8

Warning! If you cloned the starter app before March 2, your hot code reloads are unreliable. Fix: in your user.cljs, change (ns user ^:dev/always to (ns ^:dev/always user as in this starter-app commit. We had it backwards on launch day for about two weeks. Sorry!

TLDR: Deployment, hot code reloading fixes, cljs advanced mode fixed, bugfixes. There are breaking changes, upgrade steps required!

  • deployment guide, uberjar, dockerfile, github actions CD scripts - see electric-starter-app
  • Electric support for continuous deployment
    • Fingerprinted client build output for cache busting on deploy
    • Client/server version mismatch forces client to refresh the page: screenshot
  • ClojureScript advanced mode compilation enabled for demos
  • Add support for SVG :xlink attribute alias
  • transit handlers are now configurable: demo_custom_types.cljc, todo move out of wip
  • breaking: hyperfiddle.electric-jetty-server has moved out of electric and into electric-starter-app.
  • breaking: must add "resources" to classpath and update electric-server-config, the example jetty server loads resources from classpath not filesystem now. see starter app change
  • breaking: ring-basic-auth is no longer included in electric deps. Add this to your project if you are using the example jetty server: ring-basic-authentication/ring-basic-authentication {:mvn/version "1.1.1"} (or copy/paste the example server into your project and remove basic auth)
  • breaking: move hf/http-request to e/http-request
  • breaking: remove unused electric <> core.async adapters to eliminate hard dep on core.async. the unused fns are moved to contrib.missionary-contrib and commented out until we revisit.
  • breaking: remove hyperfiddle.logger; migrate to clojure.tools.logging (which uses Log4J internally) and js/console.log; drop com.taoensso/timbre dep. note: the Jetty server example still uses log4j internally as well. So you at least need a logback.xml to silence jetty log spam.
  • fix: custom hyperfiddle.electric-client/*ws-server-url* binding is lost on reconnect
  • fix: compilation with advanced optimization
  • fix: m/sleep deadlock in missionary (impacts Two Clocks demo)
  • fix: regressions related to "reactive exceptions no longer spam the console"
  • fix: new hot-code reloading strategy breaks XTDB starter app
  • fix: ns auto reloading should not reload external libs (fixes protocol redefinition issues exhibited in XTDB-starter-app)
  • fix: ui/input glitch after blur under latency
  • fix: *ns* bound incorrectly during macroexpansion
  • fix: SVG elements don't get class prop
  • fix: async traces lose original exception on transfer
  • fix: reactive exceptions inside a dom/on callback can be silently swallowed
  • fix: shadow-css live css reload causes NPE in electric-dom
  • fix: xtdb starter app prints “Datomic libs detected: #{}” at console
  • fix: hyperfiddle.history incorrectly stacking paths on pushState and replaceState
  • fix: electric-codemirror mount/unmount handling
  • electric-codemirror upgraded to latest codemirror version. adds readonly mode and custom theme support, relax default css
  • HFQL tree grid css now uses em units to be embeddable
  • electric-starter-app: remove package.json, no more npm dependencies
  • example jetty server: better error messages on missing index.html or manifest.edn

v2-alpha-123-ga7fa624f — 2023 March 2

  • hot code reloading stability improvements. note: you MUST run Shadow and your CLJ REPL from the same JVM! Do NOT use shadow from node_modules as this results in two JVMs because your Electric client/server code versions will desync.
  • drop need for #?(:cljs (:require-macros ...)) in electric src namespaces
  • e/wrap is now e/offload, note the signature changed it takes a clojure thunk now, example
  • zero config entrypoint – please compare to the starter app entrypoint to see if any boilerplate can be removed
  • added e/on-unmount, example usage in presence demo. Notes: (a) this interface is going to change; (b) e/mount has been removed, you don't need it
  • introduced dom/on! optimized callback for fast events like mouse-move (note: usage will change soon, this atom is pure overhead)
  • legacy photon-ui and photon-dom are removed, you must upgrade
  • electric-goog-history example published, this is going to move and have breaking changes but we do commit to maintaining it somewhere
  • SVG support
  • async stack trace improvements
  • clj-kondo config is exported
  • fix: clojure deep def is now supported (for debugging)
  • fix: shadow-css is now supported
  • fix: reactive exceptions no longer spam the console
  • fix: Pending bugs

v2-alpha-0-g40c3384e — 2023 Feb 12

Initial release.

  • Production ready for, let's say back office apps, after 8 months of private user testing and extreme dogfooding in the Hyperfiddle sister project.
  • As a maturity indicator, the only low level bug in recent memory was a hash collision triggered by scrolling a server-paginated grid over thousands of server-streamed elements.
  • Stack traces aren't great; we do have async stack traces already but they need work

Current development priorities:

  • developer experience improvements
  • network planner improvements
  • language semantics improvements

To date we have focused on correct semantics over syntax and performance. Now that we are useful in production, we are using production learnings to drive our priorities.

Can you improve this documentation? These fine people already did:
Dustin Getz & xificurC
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close