Closed davorg closed 1 year ago
Do you actually need to subclass for other reasons? Because we can change it to a sub callback then you could supply your custom attributes without creating a subclass.
Well, I'm currently using doing stuff with a subclass (https://github.com/davorg/plack-app-directoryindex) which adds support for index.html to Plack::App::Directory. But I wouldn't need to use that subclass if you merged https://github.com/plack/Plack/pull/654 :-)
Oh wait. Looks like my previous PR has got somewhat corrupted. Let me clean it up and resubmit it.
Well yeah that's orthogonal :) For Plack app/middleware I generally prefer setting these things via callback attributes rather than requiring to subclass it.
Ok. Do you have a good example of how you've used callback attributes elsewhere? I'll crib off that and submit a new PR.
Replaced by https://github.com/plack/Plack/pull/695
I wanted to change the HTML/CSS in a subclass of this class, but using lexical variables makes it too hard. I worked around it, but a change like this would make it easier in the future.