diff --git a/examples/flybot-site/CHANGELOG.md b/examples/flybot-site/CHANGELOG.md index 32177b7..781f85b 100644 --- a/examples/flybot-site/CHANGELOG.md +++ b/examples/flybot-site/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Bump `lasagna-remote` to 0.1.5 +- Bump `lasagna-remote` to 0.1.6 — role-gate pre-walk, CLJS Wireable/Mutable detection, and transit encoding of `/api/_schema` (Malli schemas no longer leak through `normalize-value`) ## [0.4.0] - 2026-04-14 diff --git a/examples/pull-playground/resources/version.edn b/examples/pull-playground/resources/version.edn index 81275dd..944d5a3 100644 --- a/examples/pull-playground/resources/version.edn +++ b/examples/pull-playground/resources/version.edn @@ -1 +1 @@ -{:version "0.4.4"} +{:version "0.4.5"} diff --git a/remote/CHANGELOG.md b/remote/CHANGELOG.md index 75d3b66..43bb761 100644 --- a/remote/CHANGELOG.md +++ b/remote/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.6] - 2026-04-24 + +### Fixed + +- `direct-satisfies?` regressions from 0.1.3, breaking `Wireable` / `Mutable` detection: + - CLJS: always returned false — a function wrapper hid the protocol symbol from CLJS's `satisfies?` macro. Fixed by making `direct-satisfies?` a macro. + - JVM: missed types extended via an interface (e.g. Malli schemas, reify over `malli.core.Schema`) — caused transit encoding to throw on `GET /api/_schema`. Fast path now falls through `supers` on direct-class miss. + ## [0.1.5] - 2026-04-24 ### Fixed diff --git a/remote/resources/version.edn b/remote/resources/version.edn index b726b04..807ffbc 100644 --- a/remote/resources/version.edn +++ b/remote/resources/version.edn @@ -1 +1 @@ -{:version "0.1.5"} +{:version "0.1.6"} diff --git a/remote/src/sg/flybot/pullable/remote/http.cljc b/remote/src/sg/flybot/pullable/remote/http.cljc index 2bde354..f9de645 100644 --- a/remote/src/sg/flybot/pullable/remote/http.cljc +++ b/remote/src/sg/flybot/pullable/remote/http.cljc @@ -11,24 +11,27 @@ #?(:clj [cognitect.transit :as transit]) #?(:clj [clojure.edn :as edn]) #?(:clj [clojure.java.io :as io])) + #?(:cljs (:require-macros [sg.flybot.pullable.remote.http :refer [direct-satisfies?]])) #?(:clj (:import [java.io ByteArrayInputStream ByteArrayOutputStream]))) ;;============================================================================= ;; Protocol Utilities ;;============================================================================= -(defn- direct-satisfies? - "Fast alternative to `clojure.core/satisfies?`. True when `v`'s class directly - implements the protocol interface (covers `deftype` inline and `reify`) OR is - registered in the protocol's `:impls` map (covers `extend-type` / - `extend-protocol`). - - Does not cover `:extend-via-metadata` — values whose protocol impl is attached - via metadata aren't detected." - [protocol v] - #?(:clj (or (instance? (:on-interface protocol) v) - (some? (get (:impls protocol) (class v)))) - :cljs (satisfies? protocol v))) +#?(:clj + (defmacro ^:private direct-satisfies? + "Fast path for `satisfies?`. Macro — CLJS's `satisfies?` needs the + protocol as a compile-time symbol, which a function wrapper would lose." + [protocol-sym v] + (if (:ns &env) + `(cljs.core/satisfies? ~protocol-sym ~v) + `(let [v# ~v + protocol# ~protocol-sym + impls# (:impls protocol#) + cls# (class v#)] + (or (instance? (:on-interface protocol#) v#) + (contains? impls# cls#) + (boolean (some impls# (supers cls#)))))))) ;;============================================================================= ;; Security: Safe Pattern Evaluation