Praxis 0.10 is out!

4 views
Skip to first unread message

Josep Blanquer

unread,
Sep 29, 2014, 12:36:58 PM9/29/14
to praxis-de...@googlegroups.com, praxis-...@googlegroups.com
All,

 We've cut a new version of Praxis. It contains a lot of improvements and several new features. We've kept it 0.10 as we believe that we're not ready to make it 1.0 until a couple important things can be done (like plugins and a better doc browser...) plus we need to have some more production tested apps before we get there.
 Keeping it 0.x also gives us more flexibility to introduce features and fix things faster as it allows us to worry a little less about small incompatibilities (without bumping the major version). Something that we'll be much more strict about once we're in 1.0.

I'm attaching a copy of the Changelog for the changes below, but most notably the new features to point out are:
  • Introduction of "around" filters in controllers
  • Callbacks can shortcut the request processing by returning a Response object
  • Request headers are now backed by Hash (so its accessing is more what people are used to doing) and its access is case sensitive
    • Note: this is a small backwards incompatible change. Just make sure that when you define Headers you now do it with Strings instead of symbols, and that you're accessing the headers in the controllers with the same case sensitivity you have defined them with.
  • Hashes (including headers) can now accept "extra" keys that are not defined in its schema


0.10.0
  • Avoid loading responses (and templates) lazily as they need to be registered in time
  • Fix: app generator's handling of 404. @magneland Issue #10
  • Fix: Getting started doc. @WilliamSnyders Issue #19
  • Controller filters can now shortcut the request lifecycle flow by returning a Response:
    • If a before filter returns it, both the action and the after filters will be skipped (as well as any remaining filters in the before list)
    • If an after filter returns it, any remaining after filters in the block will be skipped.
    • There is no way for the action result to skip the :after filters.
  • Refactored Controller module to properly used ActiveSupprt concerns. @jasonayre Issue #26
  • Separated the controller module into a Controller concern and a separable Callbacks concern
  • Controller filters (i.e. callbacks) can shortcut request lifecycle by returning a Response object:
    • If a before filter returns it, both the action and the after filters will be skipped (as well as any remaining before filters)
    • If an after filter returns it, any remaining after filters in the block will be skipped.
    • There is no way for the action result to skip the :after filters.
    • Fixes Issue #21
  • Introduced around filters using blocks:
    • Around filters can be set wrapping any of the request stages (load, validate, action...) and might apply to only certain actions (i.e. exactly the same as the before/after filters)
    • Therefore they supports the same attributes as before and after filters. The only difference is that an around filter block will get an extra parameter with the block to call to continue the chain.
  • Fix: Change :created response template to take an optiona ‘location’ parameter (instead of a media_type one, since it doesn’t make sense for a 201 type response) Issue #26
  • Make the system be more robust in error reporting when controllers do not return a String or a Response
  • Fix: ValidationError not setting a Content-Type header. Issue #39
  • Relaxed ActiveSupport version dependency (from 4 to >=3 )
  • Fix: InternalServerError not setting a Content-Type header. Issue #42
  • A few document browser improvements:
    • Avoid showing certain internal type options (i.e. reference).
    • Fixed type label cide to detect collections better, and differentiate between Attributor ones and MediaType ones.
    • Tweaked _example.html template to be much more collapsed by default, as it is not great, but makes it easier to review.
    • Enhanced _links.html template to use the rs-type-label, and rs-attribute-description directives.
    • Small design improvements on the home page for showing routes and verbs more prominently.
  • Mediatype documentation improvements:
    • Make Links always list its attributes when describe (never shallow)
    • refactored MediaTypeCollection to store a member_attribute (instead of a member_type), and report it in describe much like attributor collections do.
  • MediaTypeCollection. See volume_snapshot in the specs for an example.
    • Added member_view DSL to define a view that renders the collection's members with the given view.
    • Change: Now requires all views to be explicitly defined (and will not automatically use the underlying member view if it exists). To define a view for member element (wrapping it in a collection) one can use the new member_view.
  • Application.setup now returns the application instance so it can be chained to other application methods.
    • This allows a more compact way to rackup the application: run Praxis::Application.instance.setup.
  • Request headers are now backed by Attributor::Hash rather than (Structs) ** Header keys are case sensitive now (although Praxis gracefully allows loading the uppercased RACK names )
  • Added tests for using Attributor::Hash attributes that can accept "extra" keys: ** See the bulk_create action for an example applied to Praxis::Multipart (which derives from Attributor::Hash) payload here.

Thank you very much to all of you that have contributed to it.
Cheers and happy Praxing!

Josep M.

Reply all
Reply to author
Forward
0 new messages