Fun with Stamps. Episode 20. Stampit v4

Vasyl Boroviak
3 min readNov 9, 2017

Hello. I’m developer Vasyl Boroviak and welcome to the twentieth episode of Vasyl Boroviak presents Fun with Stamps.

TL;DR

To migrate to stampit v4 most likely you won’t need to do any changes to your codebase. Also, stampit min.js bundle got twice smaller.

Please note that NPM registry do not have stampit v4.0.0, instead use v4.0.2. Sorry about that. The v4.0.0 npm bundle was missing a file.

BRAKING CHANGES

  • Removed the previously deprecated refs. Please, use props instead.
    (Please note, if you are migrating from stampit v2 to v4 you would need to rename props -> deepProps, and then refs -> props. Sorry for the inconvenience. But it looks like the last rename in stampit’s life.)
  • Removed stampit/* utility functions.
    Please use @stamp/is/stamp instead of stampit/isStamp, @stamp/is/composable instead of stampit/isComposable, and @stamp/compose instead of stampit/compose.
  • The composers are now stored in Stamp.compose.composers metadata instead of Stamp.compose.deepConfiguration.composers.
    Should you care? Probably not. Good thing is — this makes stampit fully compatible with @stamp/* modules ecosystem.

Other notable changes

  • Stampit is fully compatible with @stamp/* modules ecosystem now.
  • The .min.js bundle is now twice smaller (2.7KB), the gzipped size is 40% smaller — 1.3KB.
  • We run tests in browsers now too.
  • Fixed a bug: none of the stampit.FUNC were working in browsers.
  • Stampit was rewritten in ES5 which allowed the three items above.
  • Updated all the documentations we have in this repo.

Difference between stampit v4 and @stamp/it v1

The stampit and @stamp/it have same API. Do we need both?

Porque no los dos? :)

  1. stampit is mainly for browsers. It has both node and browser builds. Whereas @stamp/it is node CommonJS only.
  2. stampit is 2.7KB min.js (1.3KB gzipped). It is what most of people need in browsers. Whereas @stamp/it don’t even have a minified bundle.
  3. stampit source code is unreadable due to various size optimisations. Whereas @stamp/it source code is easy to read and understand.

Latest download stats from NPM

Find the graphs here.

NPM downloads of stampit per week. From Jan 2015 till Oct 2017.

Have fun with stamps!

--

--