I have been mulling around the ideas of what should be our priorities in 2021. As always, of course, speed and stability are paramount. Sanic is not a framework about throwing a lot of built in features. It is not opinionated, and meant to provide flexibility. With that in mind, here are some thoughts I had in the general strategy.
- Let’s get
streamingmerged and out the door for 21.3.
- Testing - Also close to completion and should be in 21.3 is ripping out testing and releasing in its own package.
- Routing - there’s no lack of discussion and I have been saying this for several years now. This is next on my list. Why? Because it will help in both of the next two items.
- Signals - this is a potential huge win for flexbility. And, without the bloat of another package, I think we can leverage the new router (or a subclass of it) for handling the dispatching of events.
- Streamlining - One of the core ideas of the new router will be to build at runtime an executable call chain for parsing and delivering a route to the handler. I think this can be extended (and indeed with some nice performance increases in rudimentary testing). I know this is something @vltr has wanted for a while. Basic idea would be to create a single call stack to wrap applicable routing, middleware, handling, etc into one single executable at runtime. One challenge here will be not expending too much memory, but there could be some nice performance gains. And, when we are talking about potentially adding more complexity to a route with signals, this could mitigate that. This is in early thoughts. An RFC to come later.
- Caching - One thing we do not do is cache responses. This could be an easy win. It is a standard in a lot of other frameworks, so we should at least provide an opt-in pattern.
With this in mind, a general plan for 2021:
21.3 - streaming all responses, removing testing, maybe routing
21.6 - routing (if not already), signals, streamlining
21.9 - cleanup
21.12 - release Sanic with level 5 - Stable
Where should caching go? It is sort of outside of the building blocks of the above items. It could probably go at any time after