Breaking Changes

This document lists breaking changes between Azu versions and migration guides.

Version 0.5.x

0.5.28

No breaking changes. This version includes documentation improvements.

0.5.0

Endpoint Type Parameters

The Endpoint module now requires explicit type parameters:

# Before (0.4.x)
struct MyEndpoint
  include Azu::Endpoint

  def call
    # ...
  end
end

# After (0.5.x)
struct MyEndpoint
  include Azu::Endpoint(MyRequest, MyResponse)

  def call : MyResponse
    # ...
  end
end

Migration:

  1. Add request type as first parameter (use EmptyRequest for no body)

  2. Add response type as second parameter

  3. Add return type annotation to call

Request Access

Request objects are now accessed via generated methods:

Version 0.4.x

0.4.0

Handler Interface

Handlers now use call_next instead of next.try &.call:

Configuration

Configuration moved from class methods to block syntax:

Version 0.3.x

0.3.0

Router Changes

Route registration moved to macros:

Response Objects

Responses now implement Azu::Response module:

Version 0.2.x

0.2.0

WebSocket Channels

Channel API changed from callback-based to method-based:

Deprecation Notices

Deprecated in 0.5.x

  • Azu::Handler::Base#next - Use call_next(context) instead

  • Implicit request types - Always specify request type parameter

Removed in 0.5.x

  • Azu::Endpoint without type parameters

  • Azu.start without handler array

Migration Tools

Checking for Deprecations

Run the compiler in strict mode:

Version Compatibility

Azu Version
Crystal Version

0.5.x

1.0.0 - 1.17.x

0.4.x

0.35.0 - 1.0.0

0.3.x

0.35.0 - 0.36.x

Getting Help

If you encounter issues during migration:

Last updated

Was this helpful?