Didn’t we agree to keep an optional b/c layer for 7.0+ (potentially in a separate package).
Main issue is the chain. Middleware does not have a chain (pre, process, post) as we do with http components.
Yes. The code I have to wrap a component in a middleware works well for the pre and post chains with distinct wrappers. But there is still the unsolved issue of wrapping a “process” component correctly, which seems to be not quite as easy. So the question is: Is that really worth the effort?
As Soren suggested, maybe can we extract the component chain into an own package that we provide as a middleware (6.3 ComponentChainMiddleware
), but keeping the ComponentChainMiddleware
is only a weak b/c layer, because no component will be able to act before(pre)/after(post) the place where the ComponentChainMiddleware is inserted into the middleware chain. So it would need to wrap the middleware chain. But that is not working well with “process” components and would dictate us to keep creating a blank “Http Response” early just to pass it along through the incoming components. Which was the reason why it is currently at the “end” of the middleware chain in the first place.
Also any third-party componentst that are currently registered at a specific position (e.g. “after sessionCookie”, “before setHeaders”), which are arguably nearly all, would break with that anyway.
So how should we deal properly with the upcoming breakyness, or should we just accept it?
Maybe the poll with a yes/no/neither option was too simplistic to capture the decision we actually need to make?