Api Transformer for AdonisJs Framework
SLDataSerializer
that only adds the data
keyword on the first level, #72
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! :clap:
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']
}
}
Adonis/Addons/Bumblebee/TransformerAbstract
class now has an optional shorter alias to Bumblebee/Transformer
. [#29]toArray()
method was marked as deprecated. [#29]toArray()
was renamed to toJSON()
.defaultInclude
& availableInclude
methods to static getterAdonis/Addons/Bumblebee/TransformerAbstract
class now has a shorter alias to Bumblebee/Transformer
.toArray()
method was marked as deprecated.adonis make:transformer
command that caused it to generate invalid transformers, #26 (by @vincentducorps)