September 2020 Monthly Update

By Alyssa Parado

Here are the updates from our new projects.

Malli

September 1-15

Small improvements based on user feedback, finalized the EntrySchemas and drafted implementation for heterogeneous sequences, aka regex schemas.

Done stuff

Ongoing

;; given a lazy registry is provided, pulling the schemas when needed
(def Schema
  [:multi {:dispatch :Type, :lazy true}
   "AWS::ApiGateway::Stage"
   "AWS::ApiGateway::UsagePlan"
   "AWS::AppSync::ApiKey"])

(-> (m/explain
      Schema
      {:Type "AWS::AppSync::ApiKey"
       :Descriptionz "kikka"})
    (me/with-spell-checking)
    (me/humanize))
; ...loaded "AWS::AppSync::ApiKey"
; => {:ApiId ["missing required key"]
;     :Descriptionz ["should be spelled :Description"]}

(-> Schema
    (m/explain
      {:Type "AWS::ApiGatway::UsagePlan"
       :Description "kikka"
       :UsagePlanName "kukka"})
    (me/with-spell-checking)
    (me/humanize))
; => {:Type ["did you mean AWS::ApiGateway::UsagePlan"]}
;; internal api
(re/parse
  (re/* (re/cat [:prop (re/fn string?)]
                [:val (re/alt [:s (re/fn string?)]
                              [:b (re/fn boolean?)])]))
  ["-server" "foo" "-verbose" true "-user" "joe"])
;[{:prop "-server", :val [:s "foo"]}
; {:prop "-verbose", :val [:b true]}
; {:prop "-user", :val [:s "joe"]}]

; malli with named branches
[:* [:cat*
     [:prop string?]
     [:val [:alt*
            [:s string?]
            [:b boolean?]]]]]

; malli with indexed branches
[:* [:cat string? [:alt string? boolean?]]]

Misc

All old issues for first alpha are now resolved. Will release it soon, without the regexs (take some time to finish)

September 16-30

Polishing the code, updated dependencies, updated libraries using malli, helped people on slack, though about time, lot’s of small improvements, curving out bundle size on js, added type-properties, rewrote a lot of core code to use it, started to write alpha release blog post.

Done stuff

Ongoing

Misc

Thought releasing a library was easy, but want to do it too(?) right, seems to take time more than expected. Had a flu.

Practicalli

September 1-15

Invested time to understand the changes coming to the Clojure CLI tools and understand the opportunities that Clojure exec (:exec-fn & :exec-args) brings to aliases. These changes provided a catalyst to start redesigning the aliases used in practicalli/clojure-deps-edn.

Practicalli Study Group

Continuing the Banking on Clojure project, especially around database access. The database schema was refined along with improved approaches to creating database schema, using transactional updates and ensuring connections are closed. The next.jdbc friendly functions were explored and a CRUD approach implemented.

Next steps will be to use Clojure spec for generative testing with the database, add connection pooling and using lifecycle management libraries.

Practicalli WebApps

Updated sections on H2 Database and Banking on Clojure

Practicalli Clojure

Added core principles for writing effective unit tests in Clojure. Included project configuration examples of unit tests for Leiningen and Clojure CLI tools. Also included example configuration for Emacs CIDER test runner and link to the test runner configurations in practicalli/clojure-deps-edn.

Clojure deps.edn

Created a draft guide to changes in the next release of the Clojure CLI tools, to understand the significance of the changes it introduces. The -X flag for executing a function with EDN arguments (hash-map arguments) has already been introduced and the new release depreciates the generic -A alias in favor of -M. In the long term using the -X flag with functions that take a structured argument looks to be an excellent approach.

Started a redesign of practicalli/clojure-deps-edn using qualified keywords for alias names. The Library repositories keyword, :mvn/repos, is already qualified, so this redesign brings the aliases in line with that style. The alias keywords are prepended with names to communicate the category of purpose for each alias, e.g. repl, project, env, lib, inspect, build, deploy.

As part of the redesign, the new flags introduced with Clojure CLI tools, -M and -X, are used. The -X flag is the preferred Clojure command line flag to use for the aliases, where the library supports executing a function from the library that takes a hash-map of arguments. Otherwise -M flag replaces -A flag and continues to use clojure.main to call the -main function of the given main namespace.

Add project/check to give detailed report on compilation issues for a project

Practicalli Spacemacs

Resolved simple bug fixes raised by the community.

September 16-30

Practicalli Study Group

Continuing the Live broadcasts covering the development of the Banking on Clojure web application.

Practicalli Clojure

New sections and Pages:

Added Code Challenges section, covering the Clojure challenges available in 4Clojure.com, Exercism.io, CodwWars.com, ClojureScript Koans and Advent of Code. A quick guide to using each of the Code challenge websites was provided and tips to using them effectively. GitHub code repositories for the Practicalli 4Clojure guides, codewars-guides and exercism-guides were included, along with the 4Clojure guides video playlist which walks through the solution to over 60 challenges and different approaches to solving them. Several 4Clojure and Exercism challenges have been added as solution walk-through, showing the design thinking behind the solution in the website. More of these will be converted from the solution code repositories as time allows, along with a video showing the REPL driven development experience.

Added Unit testing fixtures page with examples from Banking on Clojure project. Also mentioned test selectors as a way to organize slower fixtures.

Started creating project templates for use with clj-new, to create deps.edn projects useful for beginners and experienced developers alike. A section on writing your own custom templates will be added to the Practicalli Clojure book in October.

Continuing to create scripts for video screencasts for a series on the Clojure CLI tools, covering the usage from the latest release (1.10.1.697). The series will convey the developer experience and common practices.

Continue testing Clojure CLI pre-release and enhancing the aliases in practicalli/clojure-deps-edn, no issues found so far.

Clojure WebApps

Redesign the database schema and clojure.spec specifications to simplify the use of generative testing with specifications and in general make the specifications easier to work with.

Using generative testing with the database. Specifications are used to generate random data to test the database CRUD functions, validating the results of those functions against clojure specs.

Added code to create and delete the development database which is called from fixture functions within the handler-helper-test namespace. The tests now run successfully via the CircleCI service.

Using kaocha profiles to configure different behavior in the development environment and when running on the CI server, specifically file change watcher and test output.

Practicalli Spacemacs

Now Emacs 27 is the default, trying out Ligature support in Emacs. Added the unicode layer with variables to include ligatures. Initially switching to the Fira code font which contains a wide range of ligatures in the font already.

Will try the Ligaturizer project to add Fira Code ligatures to the Ubuntu Mono font, the preferred font used by Practicalli.

Clj-kondo/babashka/sci

September 1-15

Here is an overview of the work I did per project. In the last two weeks I spent most of my time focusing on a new release for clj-kondo.

Clj-kondo

Babashka

Sci

September 16-30

Here is an overview of the work I did per project. Most of the time went into improvements to sci and a new babashka release.

Babashka

Sci

Misc

Datahike

September 1-15

Due to vacation in our team we could only work on the implementation of entity specs.

Entity Specs

The required attributes and entity predicates were implemented, added to Datahike 0.3.2-SNAPSHOT, and will be release with Datahike 0.3.2. Users can now create new specs with :db.entity/attrs and :db.entity/preds and assert entities in transactions with :db/ensure.

Beyond implementation, we cleaned out older stale branches and PRs. Also we started planning our next feature roadmap after 0.3.2 release.

September 16-30

Everybody is back from vacation now and we continued working together again on the open topics.

Release 0.3.2

We released our latest version 0.3.2 that added entity specs that were implemented in Datahike in the last iteration as well as the following updates that we worked on over the last months:

Datomic Compatibility

Within our comparison project we created a document on comparing functions from both Datahike and Datomic, and continued discussing adjustments both for signature and naming. Also we started adjusting our API documentation in order to provide better examples on how to use them.

Tuple Support

The schema definition for composite tuples was added to the transaction validation, while the definition for heterogeneous and homogeneous tuples are still drafted and tested. We started discussing the design and architecture for the search of the tuples in Datahike’s index for both read and write schema flexibility.

Beyond Clojurists Together Tasks

Within the task of porting of our own dependencies to ClojureScript, we unified the CI/CD for circleci, moving from leiningen to Clojure CLI tools. Continued with improving the upsert performance. We started discussions on features and next steps for datahike-server and possible http clients. Worked on garbage collection for our backend. Continued on the larger tasks for attribute reference support and partitions that also incorporates vast refactoring of Datahike’s tests.