Releases: dymmond/ravyn
Releases · dymmond/ravyn
Version 3.7.0
Added
- Decorator
controller. This decorator allows to, as the name suggests, create a controller from
a normal python objects. This is a simple way of creating a controller without the need of subclassing theControllerclass. - Decorators documentation section with the available Esmerald decorators.
- Support for native caching with support for custom backends.
- Observables documentation section. This is a new feature that allows to create
observables that can be used to create a more reactive programming style.
Example
from esmerald.utils.decorators import controller
from esmerald import get, post
@controller(path="/items")
class ItemHandler:
@get("/{item_id}")
async def get_item(self, item_id: int) -> dict:
return {"item_id": item_id}
@post("/")
async def create_item(self, data: dict) -> dict:
return {"message": "Item created", "data": data}The rest remains as per normal usage of Esmerald.
Version 3.6.8
Added
-
Esmerald now allows the import of Lilya EnvironLoader directly using it directly via:
from esmerald.utils.environments import EnvironmentLoader
-
Factory now accepts
kwargsparameters. -
You can now declare dependencies without using explicitly the
Inject().
Changed
- Event lifecycle fully delegated to Lilya internals removing duplication.
- Cleanup internals for the path and delegate to Lilya.
- Background tasks pointing 100% to Lilya.
- Moved
concurrecytoesmerald.utils.concurrency. - Moved
esmerald.enumstoesmerald.utils.enums. - Refactored
parse_form_datafromesmerald.parsersinto a cleaner version.
Fixed
- Documentation pointing to the state of the CI.
Removed
- Official support for Mako template engine as previously announced.
Version 3.6.7
Added
before_requestandafter_requestWebSocketGateway handler added.before_requestandafter_requestadded as default to the settings. This was not required
as the settings loading system of Esmerald defaults values but this should be added to the settings
for consistency reasons of the framework.
Changed
- Reverse order on Gateway
after_request.
Fixed
override_settingswas not taking into account async functions.
Version 3.6.6
Added
Esmerald,Include,Host,Gateway,HTTPHandlerandRouternow supportbefore_requestandafter_request
life cycles. This can be particularly useful to those who want to perform actions before and after
a request is performed. E.g.: Telemetry.- Missing before and after request in the handler helpers.
BaseControlleralias for theView. This serves a preparation for the internal renaming.
Fixed
- Internal permission checking for Lilya and Esmerald was not extended to
Viewbase of Controllers. - Inheritance extending previous permissions on Controllers.
Version 3.6.5
Added
- Esmerald now also supports Pure ASGI Permissions. That means you can pass the same
style of permissions as the ones used in Lilya as alternative to the native Esmerald permission
system. - New Lilya permissions documentation section.
Changed
- Permissions section moved and renamed to Esmerald Permissions.
Fixed
set_cookiewas causing an issue when multiple were being generated.
Version 3.6.4
Added
- Support for
asyncjinja templates. - Missing
esmerald --versioncommand to the cli.
Changed
- Removed hard dependency of
nest_asyncio. - Use ORJSON as parsing json.
Fixed
- Internal pattern for OAuth2 form password.
- Fixed internal typings of passthrough in Response and TemplateResponse.
- Esmerald permissions on Include were being overriten by Lilya too early.
Version 3.6.3
Added
- Requires() as a new independent way to manage dependencies.
- A more thorough explanation about the Security(), how to use it and examples.
Changed
- Expose
Controllerinesmeraldas alternative toAPIView. This was already available to use but not directly
accessible viafrom esmerald import Controller.
Fixed
- Fix escaped " in TemplateResponse.
- Fix TemplateResponse's auto-detection of the media-type when used directly.
- Don't mangle strings by default for other media-types than json.
- Don't mangle returned responses.
- Reverse lookup or Class based views and nested naming using
path_for.
Version 3.6.2
Added
nameparameter to StaticFiles config allowing to reverse lookup internally.- Support for Python 3.13
- Support for
redirect_slashesin the Include. status_codeto ResponseContainer to be parameter detectable.
Changed
- Cleanup Response.
- Move
transformmethod to lilya but provide speedup in a mixin. - Esmerald
Responsebehaves likemake_responsein lilya with a plainResponse. - Special handle None (nothing is returned) in
Response. It shouldn't map tonullso not all handlers have to return a value.
Fixed
dataandpayloadspecial kwargs are now allowed when a not-bodyless method is available for the handler. They default to None.byteswon't be encoded as json when returned from a handler. This would unexpectly lead to a base64 encoding.- SessionConfig has a unneccessarily heavily restricted secret_key parameter.
- Gracefully handle situations where cookies are None in
get_cookies. - Fix validation of parameters requiring a body.
Version 3.6.1
Added
- Allow passing extensions as string.
Changed
- Change
media_typeparameter ofResponsefromMediaType.JSONtoNoneto match the default of the underlying lilya Response.
Fixed
- OpenAPI responses.
- Enum definitions.
Version 3.6.0
Added
- New
Securitysection with all the explanations how to use the internals of Esmerald. - Added new
Securityobject used for security dependencies using Esmeraldesmerald.securitypackage.
Changed
- Updates from python-jose to PyJWT as dependency contrib library.
- Remove OpenAPI security as they where redundant and not 100% compliant with OpenAPI security.
- Allow the new Lilya StaticFiles allowing to provide multiple directories with fallthrough behaviour.
- Deprecate support for Mako.
- Internal code organisation and cleaning.
Fixed
- Fix cli detection of wrapped esmerald instances or different ASGI servers.
- Allow passing multiple
StaticFilesConfigconfigurations in a tuple. - Allow passing multiple directories to
StaticFilesby removing the stringification inStaticFilesConfigso a fallthrough behavior can be established.
Note: this requires a newer lilya version.