Skip to content

AKA Almost 1.0

Compare
Choose a tag to compare
@foca foca released this 15 Mar 08:08

This marks the last general release before we release 1.0 πŸŽ‰ πŸŽ‰ πŸŽ‰

The API should be considered stable and public. Basically, it shouldn't change after this release. The notable changes are:

These changes are backwards-incompatible πŸ’₯

  • Serializer#attributes was renamed to Serializer#serialized. See commit.
  • The rack helper is now called #granola. So in Cuba you'd do: halt granola(current_user, with: SessionSerializer), for example. Thanks @djanowski for the idea πŸ’™ See commit.
  • Granola::Rack no longer cares about checking freshness of a response. Instead, it makes the body defer to the call to each before actually calling #to_json. This means that you can put Rack::ConditionalGet in the middleware stack and use that to make the response 304 to clients. See commit.

These are backwards-compatible πŸ‘Œ

  • Allow passing default headers to the rack helper. Thank @lucasefe for this one πŸ’œ. See commit.
  • Don't hate so much on MultiJson ❀️ As @luislavena put it, the performance problems alluded to in v0.0.4 have been fixed. We still default to our own way of configuring the JSON backend, but if MultiJson is available then we use that. See commit.
  • Open the road for multiple formats (such as serializing to YAML or MsgPack right from Granola). The rack helper now includes an as: keyword that specifies the format to render (defaults to :json). As long as you define Serializer::MIME_TYPES[format] and a #to_#{format} method in your serializers, then you can just granola(object, as: <format>). See commit

Thanks to everyone who offered suggestions and feedback for making this possible. I πŸ’— you.