Skip to content

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[0.3.1] - 2024-03-11

Github release

Changed

  • AsyncMiddleware is now called LifespanStateMiddleware, the original name was too generic (it was a copy-paste from the Django documentation). The original name will remain as an alias for LifespanStateMiddleware, so existing installations should not be affected.

[0.3.0] - 2024-03-05

Github release

Added

  • Lifespan async context managers are now supported (inspired by Lifespan events in FastAPI). Global variables are no longer necessary for the state management; objects required throughout the application lifecycle are now held in the lifespan scope state. Further details can be found in the ASGI spec. Previous signals (startup and shutdown) remain supported with no plans for their removal. The new, preferred method to manage state is via an async context manager.
  • All major ASGI servers have been tested, an overview of their support is in separate page. It is worth mentioning that the gunicorn+uvicorn combo is now working without problems.
  • Development: Add support for pre-commit.

Changed

  • More tests.
  • Better documentation.

Breaking changes

  • Drop support for Django >=4.0.0, <4.2.0 and >=5.0.0, <5.0.3. Supported versions include ^4.2 || ^5.0.3 (^4.2 is LTS).
  • If lifespan signals fail, two new events are sent to the ASGI server: lifespan.startup.failed and lifespan.shutdown.failed. This could stop servers, like uvicorn, from starting if a lifespan.startup.failed event happens. This update makes it easier to find and fix errors, as they are not hidden anymore.

[0.2.0] - 2024-02-09

Github release

Added

[0.1.0] - 2022-08-03

Github release

  • Initial release.