Skip to content

Releases: dymmond/esmerald

Version 3.2.0

21 May 19:21
0c5d4b3
Compare
Choose a tag to compare

Added

  • settings_module also supports import as string.
  • New encoders to Esmerald settings and instance parameters.
  • New register_encoder encoder in any Esmerald and ChildEsmerald instances.
  • New encoders to Esmerald responses. This allows to use any Response as ASGI application.
    with unique custom encoders.
  • Encoders documentation.

Changed

  • Internal refactor of the classmethods of the TransformerModel. The class methods
    are now normal python functions.
  • Unifying the transformers in the signature model.
  • Rename EsmeraldSignature to SignatureModel.

Version 3.1.5

09 May 11:25
880d493
Compare
Choose a tag to compare

Added

This change was supposed to be shipped in the version 3.1.4 but it missed the release.

  • Printing the stack trace when an Esmerald application is in debug=True providing a deeper
    level of understanding the source of the errors.

Version 3.1.4

09 May 11:25
7c92fd5
Compare
Choose a tag to compare

Fixed

  • AsyncExitMiddleware raising exception.
  • OpenAPI error when generating the parameters with dependencies.
  • OpenAPI security schemes.

Version 3.1.3

02 May 11:05
8f402a2
Compare
Choose a tag to compare

Changed

  • Internal support for hatch and removed the need for a Makefile.
  • Internals for Directives. #308 by @devkral.
  • Documentation references and refinements #311 by @paolodina.
  • WSGIMiddleware is now pointing to Lilya.

Version 3.1.2

11 Apr 16:58
b16806b
Compare
Choose a tag to compare

Fixed

  • Regression with typing_extensions.

Version 3.1.1

10 Apr 19:02
40f93a8
Compare
Choose a tag to compare

Added

  • --with-basic-controller flag in createapp directive. #PR 284 by @tarsil.

Changed

  • Documentation improvements.

Fixed

  • Typo in the create project directive urls file descripton.
  • operation_id being generated to include the class based view name when coming from class based views handlers. #PR 289 by @tarsil.

Version 3.1.0

04 Apr 15:15
f028d62
Compare
Choose a tag to compare

Added

  • settings_module when passed in the instance of Esmerald will take precedence
    over the global settings, removing the need of using constantly the ESMERALD_SETTINGS_MODULE.
  • ApplicationSettingsMiddleware as internal that handles with the settings_module provided and maps
    the context of the settings.

Example of the way the settings are evaluated

from esmerald import Esmerald, EsmeraldAPISettings, Gateway, Include, JSONResponse, get, settings


@get()
async def home() -> JSONResponse:
    return JSONResponse({"title": settings.title})


class NewSettings(EsmeraldAPISettings):
    title: str = "Main app"


class NestedAppSettings(EsmeraldAPISettings):
    title: str = "Nested app"


app = Esmerald(
    settings_module=NewSettings,
    routes=[
        Gateway("/home", handler=home),
        Include(
            "/child",
            app=Esmerald(
                settings_module=NestedAppSettings,
                routes=[
                    Gateway("/home", handler=home),
                ],
            ),
        ),
    ],
)

In the context of the controller home, based on the path being called, it should return the
corresponding value of the title according to the settings of the app that is included.

Changed

  • createapp directive views.py file generated renamed to controllers.py.
  • Make the EsmeraldAPISettings hashable.
  • Remove settings_config in favor of the settings_module.
  • Bump Lilya version to 0.3.3.

Fixed

Version 3.0.0

25 Mar 10:25
be3e27e
Compare
Choose a tag to compare

Changed

  • Moved from beta v3 version to the official v3 of Esmerald fully supporting Lilya.

Version 3.0.0b2

12 Mar 17:11
d18e321
Compare
Choose a tag to compare

Added

  • Allow the use from lilya.middleware import Middleware as alternative to DefineMiddleware,

Changed

  • Cleaned the ServerErrorMiddleware from the lilya import.

Version 3.0.0b1

12 Mar 14:02
11f8976
Compare
Choose a tag to compare

!!! Warning
This is a major release and it will be under the the version 3 of Esmerald.
You should not be affected but in case you are, please report any issues
so we can correct it.

Added

  • Support for Lilya and drop Starlette.

Changed

  • CSRFConfig cookie_secure renamed to secure.
  • CSRFConfig httponly renamed to httponly.
  • CSRFConfig cookie_samesite renamed to samesite.
  • CSRFConfig cookie_domain renamed to domain.
  • CSRFConfig cookie_secure renamed to secure.
  • Removed support for the BasicMiddleware as this can be imported from any other ASGI application.

Internal

In the past, Middleware was being used but with the introduction of Lilya, now is DefineMiddleware that
is applied.

from lilya.middleware import DefineMiddleware
  • The PlainTextResponse was renamed to PlainText.