--
- 🚀 [FEATURE] Adds support for
Symbol#to_procsyntax in fields and identifiers. See #546. Thanks to @tob1k. - 🚀 [FEATURE] Adds support for Proc in association
:optionsparameter, enabling dynamic options based on the parent object. See #579. Thanks to @lessthanjacob. - 🐛 [BUGFIX] Passes options as keywords during block extraction. See #521. Thanks to @tylerhunt.
- 🐛 [BUGFIX] Ensures
Deprecationmodule gets loaded before it's used. See #549. Thanks to @jhollinger. - 🐛 [BUGFIX] Fixes
ViewCollectioncache invalidation after view block evaluation, preventing silent loss of mutations whenreflectionstriggers early cache compilation. See #579. Thanks to @lessthanjacob. - 🚜 [REFACTOR] Caches
ViewCollectionand transformers to reduce object allocations and improve rendering performance. See #566. Thanks to @lessthanjacob.
- 🐛 [BUGFIX] Adds back
Blueprinter.preparemethod with a deprecated warning. This method was previously public, but was removed as part of 1.2.0.
‼️ [BREAKING] Drops support for Ruby 3.0. See #496- 💅 [ENHANCEMENT] Allows for the current view to be accessible from within the
optionshash provided to thefieldblock. See #503. Thanks to @neo87cs. - 🐛 [BUGFIX] Fixes an issue where specifying fields using a mix of symbols and strings would cause an
ArgumentErrorwhen rendering. See #505. Thanks to @lessthanjacob. - 🚜 [REFACTOR] Reorganizes rendering/serialization logic and removes
BaseHelpermodule. See #476. Thanks to @lessthanjacob.
- 🐛 [BUGFIX] Fixes an issue where a
Blueprinter::BlueprinterErrorwould be raised on render when providingview: nil, instead of falling back on the:defaultview. See #472. Thanks to @lessthanjacob.
- 🐛 [BUGFIX] Fixes an issue when when calling
.rendermultiple times on a Blueprint using the sameoptionshash, which would result in theoptionschanging unexpectedly between calls. See #453. Thanks to @ryanmccarthypdx. - 🐛 [BUGFIX] Fixes an issue when passing in a
Symbol(representing a method) to theif:condition on an association. The providedSymbolwould be erroneously sent to the association's Blueprint, instead of the Blueprint in which the association was defined within. See #464. Thanks to @lessthanjacob.
‼️ [BREAKING] Drops support for Ruby 2.7. See #402. Thanks to @jmeridth- 🚜 [REFACTOR] Cleans up Blueprint validation logic and implements an
Associationclass with a clearer interface. See #414. Thanks to @lessthanjacob. - 💅 [ENHANCEMENT] Updates Transform Classes documentation to provide a more understandable example. See #415. Thanks to @SaxtonDrey.
- 💅 [ENHANCEMENT] Implements field-level configuration option for excluding an attribute from the result of a render if its value is
nil. See #425. Thanks to jamesst20. - 🚜 [REFACTOR] Adds explicit dependency on
jsonwithinBlueprinter::Configuration. See #444. Thanks to @lessthanjacob. - 🚜 [REFACTOR] Alters file loading to leverage
autoloadinstead ofrequirefor (future) optional, top-level constants. See #445. Thanks to @jhollinger.
- 🐛 [BUGFIX] [BREAKING] Fixes an issue with reflection where fields are incorrectly override by their definitions in the default view. Note: this may be a breaking change for users of the extensions API, but restores the intended functionality. See #391. Thanks to @elliothursh.
- 🐛 [BUGFIX] Fixes an issue where serialization performance would become degraded when using a Blueprint that leverages transformers. See #381. Thanks to @Pritilender.
‼️ [BREAKING] Allow transformers to be included across views. See README, PR #372 and issue #225 for details. Note this changes the behavior of transformers which were previously only applied to the view they were defined on. Thanks to @njbbaer and @bhooshiek-narendiran.- 🚀 [FEATURE] Introduce extension API, with initial support for pre_render hook. See #358 for details. Thanks to @jhollinger.
- 💅 [ENHANCEMENT] Add reflection on views, fields, and associations. See PR #357, and issue #341 for details. Thanks to @jhollinger.
- 🚀 [FEATURE] Allow configuring custom array-like classes to be treated as collections when serializing. More details can be found here. Thanks to @toddnestor.
- 💅 [ENHANCEMENT] Reduce object allocations in fields calculations to save some memory. More details can be found here. Thanks to @nametoolong.
- 💅 [ENHANCEMENT] Introduce rubocop
- 💅 [ENHANCEMENT] if/:unless procs with two arguments and invalid empty type deprecations are now removed
‼️ [BREAKING] Transition to GitHub Actions from CircleCI and update to handle Ruby versions 2.7, 3.0, 3.1, 3.2. Drop support for any ruby version less than 2.7. See #307
- 🐛 [BUGFIX] Fixes issue where fields and associations that are redefined by later views were not properly overwritten. See #201 thanks to @Berardpi.
- 🚀 [FEATURE] Make deprecation behavior configurable (
:silence,:stderror,:raise). See #248 thanks to @mcclayton.
- 🐛 [BUGFIX] Raise Blueprinter::BlueprinterError if Blueprint given is not of class Blueprinter::Base. Before it just raised a generic
undefined method 'prepare'. See #233 thanks to @caws.
- 🚀 [FEATURE] Enable default
Blueprinter::Transformers to be set in the global configuration. #222. Thanks to @supremebeing7.
- 🚀 [FEATURE] Add an
optionsoption to associations to facilitate passing options from one blueprint to another. #220. Thanks to @mcclayton.
- 🚀 [FEATURE] Public class method
has_view?on Blueprinter::Base subclasses introduced in #213. Thanks to @spencerneste.
- 🐛 [BUGFIX] Fixes issue where
excludefields in deeply nested views were not respected. Resolved issue 207 in #208 by @tpltn.
- 🐛 [BUGFIX] Fixes issue where fields "bled" into other views due to merge side-effects. Resolved issue 205 in #204 by @trevorrjohn.
- 🐛 [BUGFIX] Fixes #172 where views would unintentionally ignore
sort_fields_by: :definitionconfiguration. Resolved in #197 by @wlkrw.
- 🚀 [FEATURE] Configurable default extractor introduced in #198 by @wlkrw. You can now set a default extractor like so:
Blueprinter.configure do |config|
config.extractor_default = MyAutoExtractor
end
- 🚀 [FEATURE] Add rails generators. See
rails g blueprinter:blueprint --helpfor usage. Introduced in #176 by @wlkrw.
- 🚀 [FEATURE] Ability to specify
default_iffield/association option for more control on when the default value is applied. 191. Thanks to @mcclayton.
-
🚀 [FEATURE] Ability to include multiple views in a single method call with
include_views. 184. Thanks to @narendranvelmurugan. -
💅 [ENHANCEMENT] Update field-level conditional settings to reflect new three-argument syntax. 183. Thanks to @danirod.
-
💅 [ENHANCEMENT] Modify Extractor access control in documentation. 182. Thanks to @cagmz.
-
💅 [ENHANCEMENT] Fix the Transformer example documentation. 174. Thanks to @tjwallace.
- 🚀 [FEATURE] Added ability to specify transformers for Blueprinter views to further process the resulting hash before serialization. #164. Thanks to @amalarayfreshworks.
⚠️ [DEPRECATION] :if/:unless procs with two arguments are now deprecated. These procs now take in three arguments (field_name, obj, options) instead of just (obj, options). In order to be compliant with the the next major release, all conditional :if/:unless procs must be augmented to take in three arguments instead of two. i.e.(obj, options)to(field_name, obj, options).
-
🐛 [BUGFIX] Fixing view: :identifier including non-identifier fields. #154. Thanks to @AllPurposeName.
-
💅 [ENHANCEMENT] Add ability to override :extractor option for an ::association. #152. Thanks to @hugopeixoto.
- 🚀 [FEATURE] Add ability to exclude multiple fields inline using
excludes. #141. Thanks to @pabhinaya.
- 🚀 [FEATURE] Add ability to pass in
datetime_formatfield option as either a string representing the strftime format, or a Proc which takes in the Date or DateTime object and returns the formatted date. #145. Thanks to @mcclayton.
- 🐛 [BUGFIX] Replacing use of rails-specific method
Hash::exceptso that Blueprinter continues to work in non-Rails environments. #140. Thanks to @checkbutton.
- 💅 [MAINTENANCE | ENHANCEMENT] Cleaning up the
include_associationssection. This is not a documented/supported feature and is callingrespond_to?(:klass)on every object passed to blueprinter. #139. Thanks to @ritikesh.
- 🚀 [FEATURE] Added an option to render with a root key. #135. Thanks to @ritikesh.
- 🚀 [FEATURE] Added an option to render with a top-level meta attribute. #135. Thanks to @ritikesh.
- 🐛 [BUGFIX] Fix boolean
falsevalues getting serialized asnull. Please see PR #132. Thanks to @samsongz.
- 🚀 [FEATURE] Enables the setting of global
:field_defaultand:association_defaultoption value in the Blueprinter Configuration that will be used as default values for fields and associations that evaluate to nil. #128. Thanks to @mcclayton.
- 🚀 [FEATURE] Enables the setting of a global
:if/:unlessproc in the Blueprinter Configuration that will be used to evaluate the conditional render of all fields. #127. Thanks to @mcclayton.
- 🚀 [FEATURE] Association Blueprints can be dynamically evaluated using a proc. #122. Thanks to @ritikesh.
- 🚀 [FEATURE] Added a
render_as_jsonAPI. Similar torender_as_hashbut returns a JSONified hash. Please see pr #119. Thanks to @ritikesh. - 🚀 [FEATURE] Sorting of fields in the response is now configurable to sort by definition or by name(asc only). Please see pr #119. Thanks to @ritikesh.
- 💅 [ENHANCEMENT] Updated readme for above features and some existing undocumented features like
exclude fields,render_as_hash. Please see pr #119. Thanks to @ritikesh.
- 🚀 [FEATURE] Extend Support for other JSON encoders like yajl-ruby. Please see pr #118. Thanks to @ritikesh.
- 🐛 [BUGFIX] Do not raise error on null date with
date_formatoption. Please see pr #117. Thanks to @tpltn. - 🚀 [FEATURE] Add
defaultoption tofields which will be used as the serialized value instead ofnullwhen the field evaluates to null. Please see pr #115. Thanks to @mcclayton. - 🐛 [BUGFIX] Made Base.associations completely private since they are not used outside of the Blueprinter base. Please see pr #112. Thanks to @philipqnguyen.
- 🐛 [BUGFIX] Fix issue where entire Blueprinter module was marked api private. Please see pr #111. Thanks to @philipqnguyen.
- 🚀 [FEATURE] Allow identifiers to be defined with a block. Please see pr #110. Thanks to @hugopeixoto.
- 💅 [ENHANCEMENT] Update docs regarding the args yielded to blocks. Please see pr #108. Thanks to @philipqnguyen.
- 💅 [ENHANCEMENT] Use
fieldmethod in fields. Please see pr #107. Thanks to @hugopeixoto.
- [FEATURE] Allow associations to be defined with a block. Please see pr #106. Thanks to @hugopeixoto.
- [FEATURE] Inherit view definition when using inheritance. Please see pr #105. Thanks to @hugopeixoto.
- 🚀 [FEATURE] Add
date_timeformat as an option tofield. Please see pr #68. Thanks to @njbbaer. - 🚀 [FEATURE] Add conditional field support
:unlessand:ifas an option tofield. Please see pr #86. Thanks to @ojab. - 🐛 [BUGFIX] Fix case where miscellaneous options were not being passed through the
AutoExtractor. See pr #83.
- 🚀 [FEATURE] Add
defaultoption toassociationwhich will be used as the serialized value instead ofnullwhen the association evaluates to null. See PR #78 by @vinaya-procore.
- 🚀 [FEATURE] Add
render_as_hashwhich will output a hash instead of a JSON String. See PR #76 by @amayer171 and Issue #73.
field or identifier such as:
field(:first_name, serializer: CustomSerializer)
Please rename that to:
field(:first_name, extractor: CustomExtractor)
- 💅 [ENHANCEMENT] Renamed Serializer classes to Extractor. See #72.
- 💅 [ENHANCEMENT] Updated README. See pr #66, #65
association :comments, blueprint: CommentsBlueprint
- 🐛 [BUGFIX] Remove Optimizer class. See #61.
- 🐛 [BUGFIX] Require associated objects to have a Blueprint, so that objects will always serialize properly. See #60.
- 🚀 [FEATURE] Initial release of Blueprinter