Skip to content

Releases: stampit-org/stampit

55 bytes or 4% smaller bundle if Gzipped

30 Mar 03:22
Compare
Choose a tag to compare
  • 60 bytes smaller GZIP size 262b89c
  • Fix badge - bundle size c6baa48
  • README refresh: remove bower, use latest data and fancier API 6615a58
  • Simplify one of the build scripts 4a58250

v4.3.1...v4.3.2

Minor but important - improved TypeScript support

04 Dec 23:27
Compare
Choose a tag to compare

This whole release is @PopGoesTheWza work on fixing and improving the d.ts files. See "types": "./types/index.d.ts", line in the package.json and the Pull Requests #348 #350

Getters and Setters built in support

15 Sep 10:28
Compare
Choose a tag to compare

JavaScript getters and setters are now no different to string or Symbol properties. This means that you can have getters in methods, properties, static properties, configuration, etc.

Example:

const HasFullName = compose({
  properties: {
    firstName: "",
    lastName: ""
  },
  methods: {
    get fullName() {
        return this.firstName + " " + this.lastName;
    },
    set fullName(name) {
        var words = name.toString().split(" ");
        this.firstName = words[0] || "";
        this.lastName = words[1] || "";
    }
  }
});

const developer = HasFullName();
developer.fullName = "Vasyl Boroviak";
console.log(developer.firstName); // "Vasyl"
console.log(developer.lastName); // "Boroviak"  
console.log(developer.fullName); // "Vasyl Boroviak"

name: "MyStampName" in stampit arguments

15 Sep 10:11
Compare
Choose a tag to compare

Now you can pass "name" property to stampit. It will automatically give your stamp (aka factory) the name. E.g.

const StripeService = stampit({
  name: "StripeService",
  init(_, {stamp}) {
    console.log("Creating an object from the stamp named", stamp.name);
  }
});

const SomeStamp = StripeService;

console.log(SomeStamp.name); // "StripeService"

See this blog post.

Added stampit.version

08 Mar 22:59
Compare
Choose a tag to compare

The stampit.version is now a string which represents its NPM version. E.g. "4.1.1".

Not so breaking release

09 Nov 12:00
Compare
Choose a tag to compare

To migrate to stampit v4 most likely you won't need to do any changes to your codebase.

Please note that NPM registry do not have stampit v4.0.0, instead use v4.0.2. Sorry about that.

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 few bugs - #317 #304 #68
  • Stampit was rewritten in ES5 which allowed the three items above.
  • Updated all the documentations we have in this repo.

Bug in the ES5 compatibility code

04 Sep 14:03
Compare
Choose a tag to compare

The assign implementation didn't work sometimes.

Added support of IE11 and all (old) versions of node.js

01 Sep 02:50
Compare
Choose a tag to compare

Community asked. We replied. Support all ES5-compatible environments!

Basically, we added an internal polyfil to not rely on global Object.assign anymore. This added +100 bytes to the stampit.min.js bundle (or +40 gzipped).

Do not use `Array.prototype.includes()` in code

30 Apr 15:30
Compare
Choose a tag to compare

The Array.prototype.includes() was not polifilled/traspiled. But stampit was using it. Thus, failing to work in some cases under node v4 and IE environments.

Composers fixes

25 Jan 13:18
Compare
Choose a tag to compare

The new Composers feature fixes.

  1. The composers array was not deduplicated. Now it is.
  2. In case of stamp.compose() syntax the stamp was never passed to composers. Fixed too.