Use Conn#config
instead of Conn#bag
to store values needed by the extensions
#29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This stops polluting
Conn#bag
hash keys.Conn#bag
is intended for application level values, whileConn#config
should contain configuration values that extensions may need.This breaks
:container
,:dry_view
and:dry_schema
extensions, which were currently reading:container
,:view_context
and:param_sanitization_handler
keys fromConn#bag
. Besides,:view_context
should now be a lambda accepting theConn
instance at the momentConn#view
is executed.Specialized plugs for those three extensions which were used just for the purpose of adding needed keys to
#bag
have been removed. Instead, aWebPipe::Plug::Config
now exists which can set in a single shot all settings provided: