athena v0.9.0 Release Notes

Release Date: 2020-06-10 // over 1 year ago
  • ๐Ÿ“š This release focuses on refining the foundational concepts of Athena as well as some QoL improvements and bug fixes along the way. See the linked sections in the API documentation for more details/examples.

    โฌ†๏ธ Dependency Upgrades

    โž• Additions

    • โž• Add NotImplemented and BadGateway exception classes
    • ๐Ÿ‘ Allow layouts to be used with ECR (#52)
    • Introduce concept of ART::Response::Writer to control how the response content is written to the response IO
      • By default it is written directly, but can be changed to enable compression for example
    • ๐ŸŒฒ Implement logging based on the new Log module
      • Logs matched routes are logged with the route, method, and path/query arguments via the RoutingListener
      • Logs any exceptions that happen via the ErrorListener
    • Introduce concept of Arguments::Resolvers::ArgumentValueResolverInterface
      • Handle resolving the arguments for a controller action from a request, or other source.
    • Introduce route collision detection
      • A compile time error is raised if two routes share the same path; either statically, or with path arguments in the same locations.
    • โž• Add a built in ART::TimeConverter that converts a date(time) string into a Time instance

    ๐Ÿ”„ Changes

    • โ™ป๏ธ Refactor ART::Response to allow writing directly to the response IO
    • (breaking-change) Change ART::Exceptions::HTTPException order
      • Makes message required and first
    • (breaking-change) Updates for the new Athena::DependencyInjection version
      • include ADI::Service is no longer required within custom listeners
      • Arguments are now resolved automatically
      • See the DI changelog for more details
    • Manually defines initializers for child HTTPException types
      • Makes it easier to extend non ART::Exceptions::HTTPExceptions for custom exception types
    • (breaking-change) Changed the implementation of HTTP::Request#attributes monkey patch to use ART::ParameterBag
      • The parameter bag is more flexible, allowing the storage of arbitrary data, not restricted to the union of the hash
      • An optional type can be provided when setting a value to get type safety on the value
    • (breaking-change) Refactored how ART::ParamConverterInterface work
      • Param converters no longer return the converted value
      • It should most commonly be stored within the request's ART::ParameterBag
      • An additional ART::ParamConverterInterface::ConfigurationInterface argument is also provided to support variable configuration on a per converter basis
      • Param converters are now services and can now use other services as dependencies

    Removals

    • (breaking-change) Removed HTTP::Request#path_params monkey-patch
      • This data is now stored within the the request's ART::ParameterBag
    • (breaking-change) The ADI::Injectable module is now removed in favor of directly registering controllers as services in order to use other service dependencies
      • Allows making use of more advanced DI features
      • Controllers MUST be declared as public services, e.x. @[ADI::Register(public: true)]
      • A compile time error is raised if they are not
    • (breaking-change) Removed the ssl option from ART.run
      • Would be better to have nginx, or something similar, sitting in front of the server
      • Could be reimplemented in the future if so desired

    ๐Ÿ›  Fixes

    • Correctly return a 405 if the route exists but not for the used HTTP method
    • ๐Ÿ‘‰ Use HTTP::Headers#[]= versus #add to avoid creating an array of the same header
    • ๐Ÿ‘‰ Use correct #to_json overload for ART::Exceptions::HTTPException