Releases: sanic-org/sanic
Releases · sanic-org/sanic
Version 22.6.2
#2522 Always show server location in ASGI
Full Changelog: v22.6.1...v22.6.2
Version 22.6.1
Resolves #2477 and #2478
See also #2495 and GHSA-8cw9-5hmv-77w6
Full Changelog: v22.6.0...v22.6.1
Version 21.12.2
Resolves #2477 and #2478
See also #2495 and GHSA-8cw9-5hmv-77w6
Full Changelog: v21.12.1...v21.12.2
Version 20.12.7
Resolves #2477 and #2478
See also #2495 and GHSA-8cw9-5hmv-77w6
Full Changelog: v20.12.6...v20.12.7
Version 22.6.0
Features
- #2378 Introduce HTTP/3 and autogeneration of TLS certificates in
DEBUG
mode- 👶 EARLY RELEASE FEATURE: Serving Sanic over HTTP/3 is an early release feature. It does not yet fully cover the HTTP/3 spec, but instead aims for feature parity with Sanic's existing HTTP/1.1 server. Websockets, WebTransport, push responses are examples of some features not yet implemented.
- 📦 EXTRA REQUIREMENT: Not all HTTP clients are capable of interfacing with HTTP/3 servers. You may need to install a HTTP/3 capable client.
- 📦 EXTRA REQUIREMENT: In order to use TLS autogeneration, you must install either mkcert or trustme.
- #2416 Add message to
task.cancel
- #2420 Add exception aliases for more consistent naming with standard HTTP response types (
BadRequest
,MethodNotAllowed
,RangeNotSatisfiable
) - #2432 Expose ASGI
scope
as a property on theRequest
object - #2438 Easier access to websocket class for annotation:
from sanic import Websocket
- #2439 New API for reading form values with options:
Request.get_form
- #2445 Add custom
loads
function - #2447, #2486 Improved API to support setting cache control headers
- #2453 Move verbosity filtering to logger
- #2475 Expose getter for current request using
Request.get_current()
Bugfixes
- #2448 Fix to allow running with
pythonw.exe
or places where there is nosys.stdout
- #2451 Trigger
http.lifecycle.request
signal in ASGI mode - #2455 Resolve typing of stacked route definitions
- #2463 Properly catch websocket CancelledError in websocket handler in Python 3.7
Deprecations and Removals
- #2487 v22.6 deprecations and changes
- Optional application registry
- Execution of custom handlers after some part of response was sent
- Configuring fallback handlers on the
ErrorHandler
- Custom
LOGO
setting sanic.response.stream
AsyncioServer.init
Developer infrastructure
Improved Documentation
- #2461 Update example to match current application naming standards
- #2466 Better type annotation for
Extend
- #2485 Improved help messages in CLI
New Contributors
- @azimovMichael made their first contribution in #2432
- @amitay87 made their first contribution in #2461
- @zozzz made their first contribution in #2451
- @kijk2869 made their first contribution in #2466
- @timmo001 made their first contribution in #2448
Full Changelog: v22.3.1...v22.6.0
Version 22.3.2
Full Changelog: v22.3.1...v22.3.2
- Resolve warning issue with error handler mismatch warning
3a1a9f0
Version 22.3.1
What's Changed
Full Changelog: v22.3.0...v22.3.1
Version 22.3.0
Version 22.3.0
Features
- #2347 API for multi-application server
- 🚨 BREAKING CHANGE: The old
sanic.worker.GunicornWorker
has been removed. To run Sanic withgunicorn
, you should use it thruuvicorn
as described in their docs. - 🧁 SIDE EFFECT: Named background tasks are now supported, even in Python 3.7
- 🚨 BREAKING CHANGE: The old
- #2357 Parse
Authorization
header asRequest.credentials
- #2361 Add config option to skip
Touchup
step in application startup - #2372 Updates to CLI help messaging
- #2382 Downgrade warnings to backwater debug messages
- #2396 Allow for
multidict
v0.6 - #2401 Upgrade CLI catching for alternative application run types
- #2402 Conditionally inject CLI arguments into factory
- #2413 Add new start and stop event listeners to reloader process
- #2414 Remove loop as required listener arg
- #2415 Better exception for bad URL parsing
- sanic-routing#47 Add a new extention parameter type:
<file:ext>
,<file:ext=jpg>
,<file:ext=jpg|png|gif|svg>
,<file=int:ext>
,<file=int:ext=jpg|png|gif|svg>
,<file=float:ext=tar.gz>
- 👶 BETA FEATURE: This feature will not work with
path
type matching, and is being released as a beta feature only.
- 👶 BETA FEATURE: This feature will not work with
- sanic-routing#57 Change
register_pattern
to accept astr
orPattern
- sanic-routing#58 Default matching on non-empty strings only, and new
strorempty
pattern type- 🚨 BREAKING CHANGE: Previously a route with a dynamic string parameter (
/<foo>
or/<foo:str>
) would match on any string, including empty strings. It will now only match a non-empty string. To retain the old behavior, you should use the new parameter type:/<foo:strorempty>
.
- 🚨 BREAKING CHANGE: Previously a route with a dynamic string parameter (
Bugfixes
- #2373 Remove
error_logger
on websockets - #2381 Fix newly assigned
None
in task registry - sanic-routing#52 Add type casting to regex route matching
- sanic-routing#60 Add requirements check on regex routes (this resolves, for example, multiple static directories with differing
host
values)
Deprecations and Removals
- #2362 22.3 Deprecations and changes
debug=True
and--debug
do NOT automatically runauto_reload
- Default error render is with plain text (browsers still get HTML by default because
auto
looks at headers) config
is required forErrorHandler.finalize
ErrorHandler.lookup
requires two positional args- Unused websocket protocol args removed
- #2344 Deprecate loading of lowercase environment variables
Developer infrastructure
- #2363 Revert code coverage back to Codecov
- #2405 Upgrade tests for
sanic-routing
changes - sanic-testing#35 Allow for httpx v0.22
Improved Documentation
- #2350 Fix link in README for ASGI
- #2398 Document middleware on_request and on_response
- #2409 Add missing documentation for
Request.respond
Miscellaneous
Version 20.12.6
What's Changed
Full Changelog: v20.12.5...v20.12.6
Version 20.12.5
#2366 Upgrade websockets
version - SECURITY UPDATE