verloop / twirpy

Twirp's python implementation
The Unlicense
99 stars 20 forks source link

Consider dropping Twirpy middlewares #42

Open ofpiyush opened 2 years ago

ofpiyush commented 2 years ago

One can use middlewares from https://www.starlette.io/middleware/

Our middlewares act more like a decorator on the actual method than a real middleware. I believe we had added them internally when we didn't have hooks, but I can't remember for sure.

To avoid confusion with Starlette's middlewares, we can drop them from a future version.

As for immediate next step, maybe we can deprecate them in the next version and wait for users to tell us if they're using it?

If no one shows up for the next 2 versions, we can drop support?

jacobe commented 2 years ago

Good idea. It's confusing and also undocumented, so I had to reverse engineer how to add middlewares to an instance of TwirpASGIApp when the Starlette-compatible middlwares didn't work.