Sanic Versions Save

Accelerate your web app development | Build fast. Run fast.

v22.6.0

1 year ago

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 the Request 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 no sys.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
    1. Optional application registry
    2. Execution of custom handlers after some part of response was sent
    3. Configuring fallback handlers on the ErrorHandler
    4. Custom LOGO setting
    5. sanic.response.stream
    6. AsyncioServer.init

Developer infrastructure

  • #2449 Clean up black and isort config
  • #2479 Fix some flappy tests

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

Full Changelog: https://github.com/sanic-org/sanic/compare/v22.3.1...v22.6.0

v22.3.2

2 years ago

v22.3.1

2 years ago

What's Changed

Full Changelog: https://github.com/sanic-org/sanic/compare/v22.3.0...v22.3.1

v22.3.0

2 years ago

Version 22.3.0

Features

  • #2347 API for multi-application server
    • 🚨 BREAKING CHANGE: The old sanic.worker.GunicornWorker has been removed. To run Sanic with gunicorn, you should use it thru uvicorn as described in their docs.
    • 🧁 SIDE EFFECT: Named background tasks are now supported, even in Python 3.7
  • #2357 Parse Authorization header as Request.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.
  • sanic-routing#57 Change register_pattern to accept a str or Pattern
  • 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>.

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
    1. debug=True and --debug do NOT automatically run auto_reload
    2. Default error render is with plain text (browsers still get HTML by default because auto looks at headers)
    3. config is required for ErrorHandler.finalize
    4. ErrorHandler.lookup requires two positional args
    5. Unused websocket protocol args removed
  • #2344 Deprecate loading of lowercase environment variables

Developer infrastructure

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

  • #2376 Fix typing for ListenerMixin.listener
  • #2383 Clear deprecation warning in asyncio.wait
  • #2387 Cleanup __slots__ implementations
  • #2390 Clear deprecation warning in asyncio.get_event_loop

v20.12.6

2 years ago

What's Changed

Full Changelog: https://github.com/sanic-org/sanic/compare/v20.12.5...v20.12.6

v20.12.5

2 years ago

#2366 Upgrade websockets version - SECURITY UPDATE

v21.12.1

2 years ago
  • #2349 Only display MOTD on startup
  • #2354 Add config.update support for all config values
  • #2355 Ignore name argument in Python 3.7

v21.12.0

2 years ago

Features

  • #2260 Allow early Blueprint registrations to still apply later added objects
  • #2262 Noisy exceptions - force logging of all exceptions
  • #2264 Optional uvloop by configuration
  • #2270 Vhost support using multiple TLS certificates
  • #2277 Change signal routing for increased consistency
    • BREAKING CHANGE: If you were manually routing signals there is a breaking change. The signal router's get is no longer 100% determinative. There is now an additional step to loop thru the returned signals for proper matching on the requirements. If signals are being dispatched using app.dispatch or bp.dispatch, there is no change.
  • #2290 Add contextual exceptions
  • #2291 Increase join concat performance
  • #2295, #2316, #2331 Restructure of CLI and application state with new displays and more command parity with app.run
  • #2302 Add route context at definition time
  • #2304 Named tasks and new API for managing background tasks
  • #2307 On app auto-reload, provide insight of changed files
  • #2308 Auto extend application with Sanic Extensions if it is installed, and provide first class support for accessing the extensions
  • #2309 Builtin signals changed to Enum
  • #2313 Support additional config implementation use case
  • #2321 Refactor environment variable hydration logic
  • #2327 Prevent sending multiple or mixed responses on a single request
  • #2330 Custom type casting on environment variables
  • #2332 Make all deprecation notices consistent
  • #2335 Allow underscore to start instance names

Bugfixes

  • #2273 Replace assignation by typing for websocket_handshake
  • #2285 Fix IPv6 display in startup logs
  • #2299 Dispatch http.lifecyle.response from exception handler

Deprecations and Removals

  • #2306 Removal of deprecated items
    • Sanic and Blueprint may no longer have arbitrary properties attached to them
    • Sanic and Blueprint forced to have compliant names
      • alphanumeric + _ + -
      • must start with letter or _
    • load_env keyword argument of Sanic
    • sanic.exceptions.abort
    • sanic.views.CompositionView
    • sanic.response.StreamingHTTPResponse
  • #2320 Remove app instance from Config for error handler setting

Developer infrastructure

  • #2251 Change dev install command
  • #2286 Change codeclimate complexity threshold from 5 to 10
  • #2287 Update host test function names so they are not overwritten
  • #2292 Fail CI on error
  • #2311, #2324 Do not run tests for draft PRs
  • #2336 Remove paths from coverage checks
  • #2338 Cleanup ports on tests

Improved Documentation

Miscellaneous

v21.9.3

2 years ago

Rerelease of v21.9.2 with some cleanup