3.x Changelog¶
3.0.0¶
Released: 2024-08-30Features¶
- Remove deprecated
litestar.contrib.prometheus
module#breaking Remove the deprecated
litestar.contrib.prometheus
module. Code still using imports from this module should switch to usinglitestar.plugins.prometheus
.References: https://github.com/litestar-org/litestar/issues/4305, https://github.com/litestar-org/litestar/pull/4328
- Make
AsyncTestClient
async-native#breaking Re-implement
AsyncTestClient
to be async-native, i.e. use the currently running event loop to run the application, instead of running a separate event loop in a new thread. Additionally, a newAsyncWebSocketTestSession
has been introduced, providing an async testing utility for WebSockets.To ensure consisten behaviour across
TestClient
andAsyncTestClient
, all testing utilities have been rewritten to be async first, with their synchronous counterparts proxying calls to the async implementation, which they run internally within a dedicated thread + event loop.References: https://github.com/litestar-org/litestar/issues/1920, https://github.com/litestar-org/litestar/pull/4291
- Remove deprecated plugin properties from
Litestar
#breaking Remove deprecated
<plugin_type>_plugins
properties fromLitestar
.Removed
Use instead
Litestar.openapi_schema_plugins
Litestar.plugins.openapi_schema
Litestar.cli_plugins
Litestar.plugins.cli
Litestar.serialization_plugins
Litestar.serialization.cli
References: https://github.com/litestar-org/litestar/pull/4297
- Remove deprecated
allow_reserved
andallow_empty_value
property fromResponseHeader
andOpenAPIHeader
#breaking Remove the deprecated properties
allow_reserved
andallow_empty_value
fromResponseHeader
andOpenAPIHeader
.References: https://github.com/litestar-org/litestar/pull/4299
- Remove deprecated
traceback_line_limit
parameter ofLoggingConfig
#breaking The
traceback_line_limit
parameter ofLoggingConfig
has been removed. This parameter had no effect since version2.9.0
, so it can be removed safely from applications without any change in behaviour.References: https://github.com/litestar-org/litestar/pull/4300
- Remove deprecated
litestar.middleware.cors
module#breaking Remove the deprecated
litestar.middleware.cors
module andlitestar.middleware.cors.CORSMiddleware
. To configure the CORS middleware, useCORSConfig
.References: https://github.com/litestar-org/litestar/pull/4309
- Remove deprecated
encoded_headers
parameter from ASGI response classes andto_asgi_response
methods#breaking The deprecated
encoded_headers
parameter has been removed from the following clases:Existing code still using
encoded_headers
should be migrated to using theheaders
parameter instead.References: https://github.com/litestar-org/litestar/pull/4311
- Remove deprecated
LitestarType
#breaking Remove the deprecated
litestar.types.internal_types.LitestarType
type alias. In its stead,type[Litestar]
can be used.References: https://github.com/litestar-org/litestar/pull/4312
- Remove deprecated
TemplateContext
#breaking Remove the deprecated
litestar.template.base.TemplateContext
type. Its usages should be replaced withcollections.abc.Mapping
.References: https://github.com/litestar-org/litestar/pull/4313
- Remove deprecated
ASGIResponse.encoded_headers
property#breaking Remove the deprecated
ASGIResponse.encoded_headers
property. Instead,encode_headers()
should be used.References: https://github.com/litestar-org/litestar/pull/4314
- Remove deprecated
pydantic_get_unwrapped_annotation_and_type_hints
#breaking Remove the deprecated
pydantic_get_unwrapped_annotation_and_type_hints
function.References: https://github.com/litestar-org/litestar/pull/4315
- Remove deprecated
litestar.contrib.attrs
module#breaking Remove the deprecated
litestar.contrib.attrs
module. Code still using imports from this module should switch to usinglitestar.plugins.attrs
.References: https://github.com/litestar-org/litestar/issues/4302, https://github.com/litestar-org/litestar/pull/4322
- Remove deprecated
litestar.contrib.jwt
module#breaking Remove the deprecated
litestar.contrib.jwt
module. Code still using imports from this module should switch to usinglitestar.security.jwt
.References: https://github.com/litestar-org/litestar/issues/4304, https://github.com/litestar-org/litestar/pull/4333
- Remove deprecated
litestar.contrib.repository
module#breaking Remove the deprecated
litestar.contrib.repository
module. Code still using imports from this module should switch to usinglitestar.repository
.References: https://github.com/litestar-org/litestar/issues/4307, https://github.com/litestar-org/litestar/pull/4337
- Remove deprecated
litestar.contrib.pydantic
module#breaking Remove the deprecated
litestar.contrib.pydantic
module. Code still using imports from this module should switch to usinglitestar.plugins.pydantic
.References: https://github.com/litestar-org/litestar/issues/4306, https://github.com/litestar-org/litestar/pull/4339