Skip to content

Instantly share code, notes, and snippets.

@ikitommi
Last active December 31, 2023 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikitommi/a1e62b3a35359259bfef94433ec2730b to your computer and use it in GitHub Desktop.
Save ikitommi/a1e62b3a35359259bfef94433ec2730b to your computer and use it in GitHub Desktop.
Clojurists Together Project Updates 2023

Clojurists Together Project Update, 01-02/2023, Tommi Reiman

Spend a lot of time with Malli and Reitit for revisiting, priorising and designing the essential missing core features.

For Malli, my top priority is to resolve the derivation and declaration of effective types, which will simplify library internals, writing schema extensions and makes CLJS bundle size smaller. Might have to break the protocol-api for this.

For Reitit, drafting a proper plugin system, have studied how this is solved in other ecosystems (e.g. fastify, phoenix). Reitit is powerful, proper plugin system makes it much more approachable.

Have also reviews lot's of PRs, helped people online and pushed out some smaller features and release the following:

Malli

0.10.1 (2023-01-21)

  • Strip-extra-keys should not break on non-map values #818

0.10.0 (2023-01-12)

  • New optional time-schemas for the JVM on top of java.time:
    • :time/duration, :time/instant, :time/local-date, :time/local-date-time, :time/local-time, :time/offset-date-time, :time/offset-time, :time/zone-id, :time/zone-offset, :time/zoned-date-time, see README
  • automatic type inferring with :enum and := with malli.transform and malli.json-schema - detects homogenous :string, :keyword, :symbol, :int and :double), #782 & #784
  • New malli.core/coercer and malli.core/coerce to both decode and validate a value, see Docs
  • New malli.core/-no-op-transformer
  • BREAKING: new implemenation for :map-of inferring via malli.provider/provide:
    • Option :malli.provider/map-of-threshold default dropped (was 3)
    • New and configurable (malli.provider/map-of-accept) function of stats -> boolean for identifying :map-of
  • BREAKING: Prefer to real Schemas instead of predicates in inferring (e.g. :int over 'int?)
  • Adds :pred option to m/-map-schema #767
  • New :some schema (like some?)
  • New malli.experimental.describe to describe Schemas in english:
* (require '[malli.experimental.describe :as med])

(med/describe [:map {:closed true} [:x int?]])
; => "map where {:x -> <integer>} with no other keys"

Reitit

0.6.0 (2023-02-21)

  • Add reitit-frontend support for fragment string #581
  • reloading-ring-handler #584
  • Remove redundant s/and #552
  • FIX: redirect-trailing-slash-handler strips query-params #565
  • BREAKING: Drop tests for Clojure 1.9, run tests with 1.10 & 1.11
  • NEW option :meta-merge on a router for custom merge strategy on route data
  • Swagger: support operationId in generated swagger json #452 & #569
  • Update documentation and link to the startrek project #578
  • Upgrade jackson for CVE-2022-42003 and CVE-2022-42004 #577
  • Improved coercion errors perf #576
  • Add example for Reitit + Pedestal + Malli coercion #572
  • Handle empty seq as empty string in query-string #566
  • Polish pedestal chains when printing context diffs #557
  • Updated dependencies:
[metosin/ring-swagger-ui "4.15.5"] is available but we use "4.3.0"
[metosin/jsonista "0.3.7"] is available but we use "0.3.5"
[metosin/malli "0.10.1"] is available but we use "0.8.2"
[fipp "0.6.26"] is available but we use "0.6.25"
[ring/ring-core "1.9.6"] is available but we use "1.9.5"
[com.fasterxml.jackson.core/jackson-core "2.14.2"] is available but we use "2.14.1"
[com.fasterxml.jackson.core/jackson-databind "2.14.2"] is available but we use "2.14.1"

Something else

Spring is coming :)

spring-fi

Clojurists Together Project Update, 03-04/2023, Tommi Reiman

Malli

  • pushed out 3 patch and 1 minor releases (0.10.2, 0.10.3, 0.10.4 and 0.11.0) with lot's of stuff in

Reitit

  • mostly reviewing and helping with upcoming OpenAPI3 release, releasing it next month

New stuff

  • worked on metosin/viesti and the attached state machine abstraction, something have used in project, planning to push as open source.
  • created metosin/ctrl-merge, a fork of weavejester/meta-merge with breaking changes needed to simplify reitit interanls. Rationale on fork here.

Malli CHANGELOG

0.11.0 (2023-04-12)

  • BREAKING: remove map syntax: mu/from-map-syntax, mu/to-map-syntax. Note that AST syntax and lite syntax remain unchanged.
  • BREAKING: walking a :schema with an id no longer passes [id] instead of children to the walker function #884
  • Support converting recursive malli schemas to json-schema #464 #868
  • Add cherry as alternative CLJS evaluator #888
  • Replace goog/mixin with Object.assign #890
  • Simplify uuid regex for accept non-standard and zero uuids #889
  • Fix clj-doc API import #887

0.10.4 (2023-03-19)

  • FIX malli.swagger ns, broken test on reitit.

0.10.3 (2023-03-18)

  • Add support for default branch ::m/default for :map schema #871, see docs.
(m/validate
 [:map
  [:x :int]
  [:y :int]
  [::m/default [:map-of :string :string]]]
 {:x 1, :y 2, "kikka" "kukka"})
; => true
  • mt/strip-extra-keys-transformer works with :map-of.
(m/decode
 [:map-of :int :int]
 {1 1, 2 "2", "3" 3, "4" "4"}
 (mt/strip-extra-keys-transformer))
; => {1 1}
  • m/default-schema to pull the ::m/default schema from entry schemas
  • m/explicit-keys to get a vector of explicit keys from entry schemas (no ::m/default)
  • Simplify content-dependent schema creation with m/-simple-schema and m/-collection-schema via new 3-arity :compile function of type children properties options -> props. Old 2-arity top-level callback function is m/deprecated! and support for it will be removed in future versions. #866
  • FIX Repeated calls to malli.util/assoc-in referencing non-existing maps fail #874
  • Updated dependencies:
borkdude/edamame 1.1.17 -> 1.3.20

0.10.2 (2023-03-05)

  • Implement malli.experimental.time schemas for clojurescript using js-joda #853
  • Allow instrumenting external functions #841
  • Add clj-kondo support for cljs function schemas #833
  • Turn on instrumentation for mx/defn with :malli/always meta #825
  • Support type-properties in m/-map-schema, m/-map-of-schema and m/-tuple-schema #856
  • FIX: properly compose interceptors in :map-of json-transformer #849
  • FIX: error paths for :multi schemas when value is not a map #845
  • FIX: Malli generates :nilable/any which is not a valid type in clj-kondo #821
  • FIX: mi/collect! without args doesn't work properly #834
  • Updated dependencies:
mvxcvi/mvxcvi 2.0.0 -> 2.1.0
borkdude/edamame 1.0.0 -> 1.1.17

Something else

Retuning from my first Conj, really enjoyed the trip!

conj

Clojurists Together Project Update, 05-06/2023, Tommi Reiman

Had a busy 2 months and did not have enough focus time to deliver the things I planned on OS. Just started my 9 week summer vacation, will be few weeks off the grid, but then will jump back into OS.

Malli

  • Continued with the new effective type system - WIP
  • Working with Schema inheritance (optional, solving real-world problems), WIP

Reitit

Something else

Summer.

summer

Clojurists Together Project Update, 07-08/2023, Tommi Reiman

I was off the grid on July, back to OS on August.

Malli

0.12.0 (2023-08-31)

  • FIX: retain order with :catn unparse, fixes #925
  • BREAKING: Do not require timezone data directly for cljs #898 with malli.experimental.time
  • Remove non-root swagger definitions #900
  • FIX: malli.core/-comp keeps interceptor order with long chains #905
  • FIX: malli.dev/start! exception does not contain source #896
  • FIX: don't add extra :schema nil to swagger :parameters #939
  • Add :gen/return support in malli.generator #933
  • Make uuid transformer to be case insensitive #929
  • Add :default/fn prop for default-value-transformer #927
  • Updated dependencies:
borkdude/edamame 1.3.20 -> 1.3.23

Reitit

  • OpenApi3-support ended to be a a much bigger change than anticipated, still alpha
  • Got the big refactor done
  • Paired with Joel on remaining issues & reviewed lot of issues, soon....

Spec-tools

  • First new release in 30 months! 0.10.6

Something else

The coffee store is closed -look

image

Clojurists Together Project Update, 09-10/2023, Tommi Reiman

Working mostly with Malli and Reitit. Will do an open source retreat to get planned things out in 2023.

Malli

0.13.0 (2023-09-24)

  • BREAKING Fallback to use result of first branch when decoding :or and :orn, #946
  • BREAKING: decode for :double and double? in cljs doesn't allow trailing garbage any more #942
  • Faster generators for :map, #948 & #949
  • FIX: :altn can't handle just one child entry when nested in sequence schema #945
  • Officially drop Clojure 1.10 support. Tests haven't passed for some time with Clojure 1.10, but this was not noticed due to a faulty CI setup.
  • Use type inferrer when encoding enums #951
  • Use bound-fn in malli.dev/start! to preserve *out* #954
  • FIX: Malli generates invalid clj-kondo type spec for [:map [:keys [:+ :keyword]]] #952
  • FIX: malli.experimental.describe descriptions of :min and :max are backwards #959
  • FIX: Malli tuple should generate clj-kondo seqable #962

Reitit

0.7.0-alpha7 (2023-10-03)

  • Revert the group id change from alpha6
  • New release to bring alpha6 changes to the old group id
  • Updated dependencies:
[metosin/ring-swagger-ui "4.19.1"] is available but we use "4.18.1"

0.7.0-alpha6 (2023-09-11)

  • BREAKING: require Clojure 1.11, drop support for Clojure 1.10
  • BREAKING: new syntax for :request and :response per-content-type coercions. See coercion.md. #627
  • BREAKING: replace the openapi :content-types keyword with separate :openapi/request-content-types and :openapi/response-content-types. See openapi.md
  • NOTE!: all reitit libraries are now under the fi.metosin group on clojars instead of metosin. Use fi.metosin/reitit in your dependencies instead of metosin/reitit to get new versions.
    • Reverted in alpha7 due to problems with renaming artifacts

Jsonista

  • A maintanance release

Something else

We had a family vacation in the Rhodes Island, which had massive wildfires earlier this year

image

Clojurists Together Project Update, 11-12/2023, Tommi Reiman

Many improvements are in the works, but no releases on libraries. My work spread over the following:

  • working with Malli
    • enchanced development mode, new extension apis & pretty printing everything possible (screenshots below)
    • little progress on the new effective type system
    • thinking about schemas and global identity, entities and values. Goal is to allow decomplecting maps/keys/values with using local data / schema properties
    • learning how to program with TypeScript Types
  • drafting a Clojure spesification for a 1:1 x-state compatible FSM implementation(xstate v5 released in december)
    • why? have used FSMs for 10+ years with Clojure with great results, mostly copy-pasting the project-spesific engine from one project to another
    • we have already many great FSM libraries for Clojure, but all differ with design objectives. I'll reach out to the library maintainers, e.g. could we have one new/great tool instead of many small ones? we have already depreceated tilakone.
  • organizing open source & stable libraries in general - getting new maintainters for some of the projects
  • reviewing and merging pull requests

Malli Development Mode

Coercion

coercion

Schema creation

schema-creation

Something else

Looking forward to 2024! Lot's of interesting things in the OS pipeline and thanks to new long-term funding, will continue to work on them. Also, New year starts with crispy -20 (in Celcius).

tampere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment