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

Separate the middleware to a builder #600

Closed
xsawyerx opened this issue Jun 4, 2014 · 4 comments
Closed

Separate the middleware to a builder #600

xsawyerx opened this issue Jun 4, 2014 · 4 comments
Assignees

Comments

@xsawyerx
Copy link
Member

xsawyerx commented Jun 4, 2014

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.

@veryrusty
Copy link
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 ?

@xsawyerx xsawyerx self-assigned this Jun 4, 2014
@dams
Copy link
Contributor

dams commented Jun 4, 2014

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)

@xsawyerx
Copy link
Member Author

xsawyerx commented Jun 7, 2014

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.

@xsawyerx
Copy link
Member Author

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
Projects
None yet
Development

No branches or pull requests

3 participants