Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injecting middlewares #11

Merged
merged 3 commits into from
Jul 16, 2019
Merged

Injecting middlewares #11

merged 3 commits into from
Jul 16, 2019

Conversation

waiting-for-dev
Copy link
Owner

Allow injecting middlewares

This is a breaking change which forces middlewares to be named:

use :cookies, Rack::Session::Cookie, key: 'key', secret: 'top_secret'

Now, they can be injected at initialization time:

App.new(middlewares: {
  cookies: [AnotherMiddlewareForCookies]
})

This also forces another breaking change: plug injections must be the
value of plugs: kwarg:

App.new(plugs: {
  nothing: ->(conn) { conn }
})

This is a breaking change which forces middlewares to be named:

```ruby
use :cookies, Rack::Session::Cookie, key: 'key', secret: 'top_secret'
```

Now, they can be injected at initialization time:

```ruby
App.new(middlewares: {
  cookies: [AnotherMiddlewareForCookies]
})
```

This also forces another breaking change: plug injections must be the
value of `plugs:` kwarg:

```ruby
App.new(plugs: {
  nothing: ->(conn) { conn }
})
@waiting-for-dev waiting-for-dev merged commit 5fd2b31 into master Jul 16, 2019
@waiting-for-dev waiting-for-dev deleted the injecting_middlewares branch July 16, 2019 12:06
@waiting-for-dev waiting-for-dev added the enhancement New feature or request label Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant