Skip to content
Henry Widd edited this page Jun 11, 2021 · 4 revisions

Future Direction for Cross-Platform Date-time Library wrt Temporal

;tl;dr

Temporal, the new JS platform Date-Time lib has been considered for use as an alternative basis of this library instead of js-joda, but although it has some overlap with java.time, Temporal is different enough that implementing cljc.java-time would be very difficult. For a dependency-free Clojure(Script) date-time API, see Tempo

Older notes (now out of date)

How long until Temporal a) done, b) requires polyfill?

Ideal API:

I think having an API that mirrors another, such as java.time has value because:

  • No need to document it
  • Tests - copy existing test suites?

Other goals

  • dependency free or fully cljs minifiable

java.time on jvm and Temporal on js

Not the same, but similar: http://widdindustries.com/ecma-temporal-vs-java-time/

options

  • keep js-joda

good: api is already done. little mismatch on platforms bad: code not readily minifiable - will they use Temporal underneath?

  • just use Temporal

cljs just has methods we implement aim to implement everything, but start with a subset? need to have more tests etc how will ppl include polyfill? foreign-lib aargh! :0

  • just use Temporal... but have a more temporal focused api

ie not a java.time mirror, but Temporal mirror - and use java.time on jvm see https://github.com/henryw374/Temporal.jvm

  • minimal cross platform clojure api: https://github.com/henryw374/tempo this will be much easier to write and support than a 'java.time on js' impl - so taking this direction unless more time/funding comes my way