Hanami v2.0.0.alpha1 Release Notes

Release Date: 2019-01-30 // almost 3 years ago
  • ➕ Added

    • [Luca Guidi] Implemented from scratch hanami version
    • [Luca Guidi] Implemented from scratch hanami server
    • 🔧 [Luca Guidi] Main configuration is opinionated: when a setting is not specified in generated code, it uses a framework default.
    • 🔧 [Luca Guidi] Main configuration setting environment: to yield env based settings (e.g. config.environment(:production) { |c| c.logger = {...} })
    • [Luca Guidi] Main configuration setting base_url: to set the base URL of the app (e.g. config.base_url = "https://example.com")
    • 🔧 [Luca Guidi] Main configuration setting logger: to set the logger options (e.g. config.logger = { level: :info, format: :json })
    • 🔧 [Luca Guidi] Main configuration setting routes: to set the path to routes file (e.g. config.routes = "path/to/routes")
    • 🔧 [Luca Guidi] Main configuration setting cookies: to set cookies options (e.g. config.cookies = { max_age: 300 })
    • 🔧 [Luca Guidi] Main configuration setting sessions: to set session options (e.g. config.sessions = :cookie, { secret: "abc" })
    • [Luca Guidi] Main configuration setting default_request_format: to set the fallback for request format (aka MIME Type) (e.g. config.default_request_format = :json)
    • [Luca Guidi] Main configuration setting default_response_format: to set the default response format (aka MIME Type) (e.g. config.default_response_format = :json)
    • 🔧 [Luca Guidi] Main configuration setting middleware to mount Rack middleware (e.g. config.middleware.use MyMiddleware, "argument")
    • 🔒 [Luca Guidi] Main configuration setting security to set security settings (see below)
    • 🔧 [Luca Guidi] Main configuration setting inflections to configure inflections (e.g. config.inflections { |i| i.plural "virus", "viruses" })
    • [Luca Guidi] Main configuration security setting x_frame_options: defaults to "deny" (e.g. config.security.x_frame_options = "sameorigin")
    • [Luca Guidi] Main configuration security setting x_content_type_options: defaults to "nosniff" (e.g. config.security.x_content_type_options = nil)
    • [Luca Guidi] Main configuration security setting x_xss_protection: defaults to "1; mode=block" (e.g. config.security.x_xss_protection = "1")
    • 🔒 [Luca Guidi] Main configuration security setting content_security_policy: defaults to "form-action 'self'; frame-ancestors 'self'; base-uri 'self'; default-src 'none'; script-src 'self'; connect-src 'self'; img-src 'self' https: data:; style-src 'self' 'unsafe-inline' https:; font-src 'self'; object-src 'none'; plugin-types application/pdf; child-src 'self'; frame-src 'self'; media-src 'self'" (e.g. config.security.content_security_policy[:style_src] += " https://my.cdn.example" to add another source) (e.g. config.security.content_security_policy[:plugin_types] = nil to override the settings)

    🔄 Changed

    • 💎 [Luca Guidi] Drop support for Ruby: MRI 2.3, and 2.4.
    • [Luca Guidi] Hanami::Application must be used as superclass for main application under config/application.rb (e.g. Bookshelf::Application)
    • 🔧 [Luca Guidi] Main configuration is available at config/application.rb instead of config/enviroment.rb
    • 🔧 [Luca Guidi] Removed Hanami.configure in favor of main application configuration (e.g. Bookshelf::Application.config)
    • [Luca Guidi] Removed DSL syntax for main configuration (from cookies max_age: 600 to config.cookies = { max_age: 600 })
    • [Luca Guidi] Per enviroment settings must be wrapped in a block (e.g. config.enviroment(:production) { |c| c.logger = {} })
    • 🌐 [Luca Guidi] Concrete applications are no longer supported (e.g. Web::Application in apps/web/application.rb)
    • 🔧 [Luca Guidi] Main routes must be configured at config/routes.rb: ```ruby