Skip to content

Separate the middleware to a builder #600

Description

@xsawyerx

In a discussion on plugins (#599), we raised the idea of using a Plack::Builder all the time, and then allow plugins to add middlewares.

I know exactly how I want to implement it, in this case:
Have a Builder attribute and add handles to the add_middleware method and have that available in the DSL.

This is a two part process. This issue is the first one. I'm opening another issue for the second one.

Activity

  1. veryrusty commented on Jun 4, 2014

    @veryrusty
    Member

    @xsawyerx I'd been thinking about something similar (as a result of working on #590).

    If you are considering only adding middleware, as in $builder->wrap($psgi_coderef) (which can be done without a Plack::Builder object), or did you have in mind being able to use other parts of the Plack::Builder API, such as possibly having a plugin mount another psgi app ?

  2. self-assigned this
    on Jun 4, 2014
  3. dams commented on Jun 4, 2014

    @dams
    Contributor

    Agreed with @veryrusty, while we are at it, we could provide a full access to the $builder, provided it offers a sane and easy to use interface (not familiar with Plack::Builder)

  4. xsawyerx commented on Jun 7, 2014

    @xsawyerx
    MemberAuthor

    One thing I'm afraid of is getting back to the plack_middlewares option from D1. I don't want people to build their PSGI app in Dancer. I want them to add Dancer to a PSGI app they're building.

    The difference in this issue is that it raises the option of allowing developers (specifically plugin developers) to add middlewares, rather than allow users to add middlewares.

  5. xsawyerx commented on Sep 20, 2016

    @xsawyerx
    MemberAuthor

    Renewed position: Middlewares are not application level and we shouldn't confuse them. Closing this issue. IF someone still sees this as a valued enhancement, please reopen.

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions