Comment by digianarchist

1 month ago

I can’t help but feel some of these decisions are made because it’s what is best for Vercel and not what’s best for the framework.

I don't see how this particular case makes anything better or worse for Vercel. It's just a poor developer experience to need to come up with your own composeMiddlewares function (or find one of the many that people have posted in various threads).

  • They validated this on the thread. They made an architectural decision to run middleware only on edge.

    • That's unrelated to the complaint I'm responding to, which is simply that you can only provide a single middleware file. This is merely a DX problem. You absolutely can develop your own composeMiddlewares function and import different middleware functions from different modules. It's just on you to do that, and to reimplement some basic functionality for each composable middleware function (like matcher regexes).

      1 reply →