Skip to content

Releases: interactions-py/restful

Release 2.0.0

11 Aug 05:52
30003b4
Compare
Choose a tag to compare

@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

Full Changelog: 1.0.2...2.0.0

Release 1.0.2

28 Apr 07:58
Compare
Choose a tag to compare
  • Add support for the sync functions
  • Fixed bug with unexcepted name when use fastapi

Full Changelog: 1.0.1...1.0.2

Release 1.0.1

28 Apr 07:19
Compare
Choose a tag to compare
  • Included missed MANIFEST.in file.
  • Add py.typed file

Full Changelog: 1.0.0...1.0.1

1.0.0

12 Apr 17:03
Compare
Choose a tag to compare

Rewrited from scratch. No migration docs. Read readme