@AstreaTSS Release :D
This is a big update with the library revamping to resolve many issues:
- Asynchronous functions from the client cannot be run in an API endpoint. This is because API backends really don't like it when they're not the ones controlling the event loop, and so some strange conditions arise. Needless to say, this basically ruins the point of the extension as you can't do many things with it.
- FastAPI was forced into using
uvicorn
. This may not be ideal for some users. - Flask really did not like the hacks the extension was doing. Flask wasn't well suited for async programming anyways.
- Endpoints weren't unloaded if an extension was. This may confuse many users.
- In general: a lot of control was taken away from the developer for the sake of convenience. This is nice, but it meant that developers couldn't customize their APIs to exactly how they wish to.
Version 2.0.0 attempts to do that by doing a number of things:
- Let the API backends start the bot up instead of vice versa. This allows for using your ASGI server of choice and also fixes event loop issues, allowing you to use asynchronous functions from the client.
- Make users have to make an API backend object before using the extension. This allows them greater control over it.
- Use Quart instead of Flask. It's properly asynchronous and is similar to Flask - you can even use some Flask extensions with it through a package.
- Add in unloading logic to remove endpoints from the backends.
Downsides:
- Flask is gone.
- You need to run a separate command/function to start up the bot - you can't just use the bot's start function.
- Using a custom router/blueprint per extension now requires some fiddling around in
__new__
or with a class variable, instead of being able to use__init__
. This is because extension registration was moved to the extension add event - this is more reliable than the old method, but runs just before__init__
.
New Contributors
- @AstreaTSS made their first contribution in #2
Full Changelog: 1.0.2...2.0.0