3.x Changelog¶
3.0.0¶
Released: 2024-08-30Features¶
- Make
AsyncTestClientasync-native#breaking Re-implement
AsyncTestClientto 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 newAsyncWebSocketTestSessionhas been introduced, providing an async testing utility for WebSockets.To ensure consisten behaviour across
TestClientandAsyncTestClient, 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>_pluginsproperties fromLitestar.Removed
Use instead
Litestar.openapi_schema_pluginsLitestar.plugins.openapi_schemaLitestar.cli_pluginsLitestar.plugins.cliLitestar.serialization_pluginsLitestar.serialization.cliReferences: https://github.com/litestar-org/litestar/pull/4297
- Remove deprecated
allow_reservedandallow_empty_valueproperty fromResponseHeaderandOpenAPIHeader#breaking Remove the deprecated properties
allow_reservedandallow_empty_valuefromResponseHeaderandOpenAPIHeader.References: https://github.com/litestar-org/litestar/pull/4299
- Remove deprecated
traceback_line_limitparameter ofLoggingConfig#breaking The
traceback_line_limitparameter ofLoggingConfighas 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.corsmodule#breaking Remove the deprecated
litestar.middleware.corsmodule andlitestar.middleware.cors.CORSMiddleware. To configure the CORS middleware, useCORSConfig.References: https://github.com/litestar-org/litestar/pull/4309
- Remove deprecated
encoded_headersparameter from ASGI response classes andto_asgi_responsemethods#breaking The deprecated
encoded_headersparameter has been removed from the following clases:Existing code still using
encoded_headersshould be migrated to using theheadersparameter instead.References: https://github.com/litestar-org/litestar/pull/4311
- Remove deprecated
LitestarType#breaking Remove the deprecated
litestar.types.internal_types.LitestarTypetype 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.TemplateContexttype. Its usages should be replaced withcollections.abc.Mapping.References: https://github.com/litestar-org/litestar/pull/4313
- Remove deprecated
ASGIResponse.encoded_headersproperty#breaking Remove the deprecated
ASGIResponse.encoded_headersproperty. 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_hintsfunction.References: https://github.com/litestar-org/litestar/pull/4315