Skip to content

v3.0.1

Choose a tag to compare

@rendro rendro released this 22 Jul 18:34
· 1 commit to master since this release

Compatibility release. If you are on 3.0.0, upgrade.

Two things 3.0.0 broke relative to 2.2.0, found by running real 2.x usage patterns against the packed tarball.

Fixed

  • data-date lost to the date option in the jQuery plugin. 2.x did if ($el.data('date')) { options.date = $el.data('date'); } — the attribute won, which is the entire point of it: one call configuring many elements, each with its own date. 3.0.0 reversed the precedence, so a shared date silently overrode every element's attribute. This repo's own examples page was affected. Also, the caller's options object is no longer mutated — in 2.x that leaked the first element's date onto every later element that had none.
  • The 2.x dest/ filenames were gone. 2.2.0 published dest/countdown.js, dest/countdown.min.js and the jQuery pair; 3.0.0 built to dist/ with .cjs extensions, which 404s every unpkg / jsDelivr URL and <script src> written against 2.x. Both layouts ship now, and the legacy paths are mapped in exports onto CommonJS twins so require('easy-countdown/dest/countdown.js') resolves as CommonJS rather than being parsed as ESM.
  • ./package.json is exported, which some bundlers and test resolvers read.

Testing

test/compat.test.ts pins the 2.x contract — data-date precedence, the no-mutation guarantee, the diff field names, leadingZeros(num, length), chainability, non-ISO date strings, and callback binding. Verified against the packed tarball with real jQuery in jsdom.