Skip to content

2.0.0

Compare
Choose a tag to compare
@rhwilr rhwilr released this 22 Mar 20:29
· 26 commits to master since this release
32ec6be

The developer experience release!

With this release, we improved the integration of Bumblebee into your application by allowing you to pass the Transformer by name, while also improving performance by changing the defaultInclude & availableInclude methods to static getters. For a complete list of all changes, see the changelog below.

An absolutely huge thank goes to @RomainLanz, who suggested and implemented many of the features we have in this release. Great work man! 👏

Breaking Changes

  • The toArray() was renamed to toJSON() to be consistent with the rest of the framework. If you use the toArray() method, you should rename this it to toJSON(). The signature and returned value remain the same. [#29]

  • Changed defaultInclude & availableInclude methods to static getter for better performance. [#29]

    // before
    class BookTransformer extends TransformerAbstract {
      defaultInclude () {
        return ['author']
      }
    }
    
    // after
    class BookTransformer extends TransformerAbstract {
      static get defaultInclude () {
        return ['author']
      }
    }

Added

  • Transformers can now be automatically resolved when passed by name. [#33]
  • Multiple transform methods can be defined and used with the new Transformer Variants feature. [#32]
  • The Adonis/Addons/Bumblebee/TransformerAbstract class now has an optional shorter alias to Bumblebee/Transformer. [#29]

Deprecated

  • The toArray() method was marked as deprecated. [#29]