Skip to content

Releases: sanic-org/sanic

Version 24.6.0

30 Jun 12:16
a1f5118
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v23.12.0...v24.6.0

Version 23.12.2

30 Jun 12:14
Compare
Choose a tag to compare

What's Changed

Full Changelog: v23.12.1...v23.12.2

Version 23.12.1

09 Jan 17:47
cf71fc7
Compare
Choose a tag to compare

What's Changed

Full Changelog: v23.12.0...v23.12.1

Version 23.12.0

31 Dec 09:38
f06d75f
Compare
Choose a tag to compare

Version 23.12.0

Current version

Features

  • #2775 Start and restart arbitrary processes
  • #2811 Cleaner process management in shutdown
  • #2812 Suppress task cancel traceback on open websocket
  • #2822 Listener and signal prioritization
  • #2831 Reduce memory consumption
  • #2837 Accept bare cookies
  • #2841 Add websocket.handler.<before/after/exception> signals
  • #2805 Add changed files to reload trigger listeners
  • #2813 Allow for simple signals
  • #2827 Improve functionality and consistency of Sanic.event()
  • #2851 Allow range requests for a single byte
  • #2854 Better Request.scheme for websocket requests
  • #2858 Convert Sanic Request to a Websockets Request for handshake
  • #2859 Add a REPL to the sanic CLI
  • #2870 Add Python 3.12 support
  • #2875 Better exception on multiprocessing context conflicts

Bugfixes

  • #2803 Fix MOTD display for extra data

Deprecations and Removals

Developer infrastructure

  • #2796 Refactor unit test cases
  • #2801 Fix test_fast when there is only one CPU
  • #2807 Add constraint for autodocsum (lint issue in old package version)
  • #2808 Refactor GitHub Actions
  • #2814 Run CI pipeline on git push
  • #2846 Drop old performance tests/benchmarks
  • #2848 Makefile cleanup
  • #2865
    #2869
    #2872
    #2879
    Add ruff to toolchain
  • #2866 Fix the alt svc test to run locally with explicit buffer nbytes
  • #2877 Use Python's trusted publisher in deployments
  • #2882 Introduce dynamic port fixture in targeted locations in the test suite

Improved Documentation

  • #2781
    #2821
    #2861
    #2863
    Conversion of User Guide to the SHH (Sanic, html5tagger, HTMX) stack
  • #2810 Update README
  • #2855 Edit Discord badge
  • #2864 Adjust documentation for using state properties within http/https redirection document

What's Changed

New Contributors

Full Changelog: v23.6.0...v23.12.0

Version 23.6.0

25 Jul 12:58
205795d
Compare
Choose a tag to compare

Version 23.6.0 🔶

Features

  • #2670 Increase KEEP_ALIVE_TIMEOUT default to 120 seconds
  • #2716 Adding allow route overwrite option in blueprint
  • #2724 and #2792 Add a new exception signal for ALL exceptions raised anywhere in application
  • #2727 Add name prefixing to BP groups
  • #2754 Update request type on middleware types
  • #2770 Better exception message on startup time application induced import error
  • #2776 Set multiprocessing start method early
  • #2785 Add custom typing to config and ctx objects
  • #2790 Add request.client_ip

Bugfixes

  • #2728 Fix traversals for intended results
  • #2729 Handle case when headers argument of ResponseStream constructor is None
  • #2737 Fix type annotation for JSONREsponse default content type
  • #2740 Use Sanic's serializer for JSON responses in the Inspector
  • #2760 Support for Request.get_current in ASGI mode
  • #2773 Alow Blueprint routes to explicitly define error_format
  • #2774 Resolve headers on different renderers
  • #2782 Resolve pypy compatibility issues

Deprecations and Removals

  • #2777 Remove Python 3.7 support

Developer infrastructure

  • #2766 Unpin setuptools version
  • #2779 Run keep alive tests in loop to get available port

Improved Documentation

  • #2741 Better documentation examples about running Sanic
    From that list, the items to highlight in the release notes:

What's Changed

New Contributors

Full Changelog: v23.3.0...v23.6.0

Version 23.3.0

26 Mar 19:55
6eaab2a
Compare
Choose a tag to compare

Features

  • #2545 Standardize init of exceptions for more consistent control of HTTP responses using exceptions

  • #2606 Decode headers as UTF-8 also in ASGI

  • #2646 Separate ASGI request and lifespan callables

  • #2659 Use FALLBACK_ERROR_FORMAT for handlers that return empty()

  • #2662 Add basic file browser (HTML page) and auto-index serving

  • #2667 Nicer traceback formatting (HTML page)

  • #2668 Smarter error page rendering format selection; more reliant upon header and "common sense" defaults

  • #2680 Check the status of socket before shutting down with SHUT_RDWR

  • #2687 Refresh Request.accept functionality to be more performant and spec-compliant

  • #2696 Add header accessors as properties

    Example-Field: Foo, Bar
    Example-Field: Baz
    
    request.headers.example_field == "Foo, Bar,Baz"
  • #2700 Simpler CLI targets

    $ sanic path.to.module:app          # global app instance
    $ sanic path.to.module:create_app   # factory pattern
    $ sanic ./path/to/directory/        # simple serve
  • #2701 API to define a number of workers in managed processes

  • #2704 Add convenience for dynamic changes to routing

  • #2706 Add convenience methods for cookie creation and deletion

    response = text("...")
    response.add_cookie("test", "It worked!", domain=".yummy-yummy-cookie.com")
  • #2707 Simplified parse_content_header escaping to be RFC-compliant and remove outdated FF hack

  • #2710 Stricter charset handling and escaping of request URLs

  • #2711 Consume body on DELETE by default

  • #2719 Allow password to be passed to TLS context

  • #2720 Skip middleware on RequestCancelled

  • #2721 Change access logging format to %s

  • #2722 Add CertLoader as application option for directly controlling SSLContext objects

  • #2725 Worker sync state tolerance on race condition

Bugfixes

  • #2651 ASGI websocket to pass thru bytes as is
  • #2697 Fix comparison between datetime aware and naive in file when using If-Modified-Since

Deprecations and Removals

  • #2666 Remove deprecated __blueprintname__ property

Improved Documentation

  • #2712 Improved example using 'https' to create the redirect

New Contributors

Full Changelog: v22.12.0...v23.3.0

Version 22.12.0

27 Dec 14:54
4ad8168
Compare
Choose a tag to compare

Features

  • #2569 Add JSONResponse class with some convenient methods when updating a response object
  • #2598 Change uvloop requirement to >=0.15.0
  • #2609 Add compatibility with websockets v11.0
  • #2610 Kill server early on worker error
    • Raise deadlock timeout to 30s
  • #2617 Scale number of running server workers
  • #2621 #2634 Send SIGKILL on subsequent ctrl+c to force worker exit
  • #2622 Add API to restart all workers from the multiplexer
  • #2624 Default to spawn for all subprocesses unless specifically set:
    from sanic import Sanic
    
    Sanic.start_method = "fork"
  • #2625 Filename normalisation of form-data/multipart file uploads
  • #2626 Move to HTTP Inspector:
    • Remote access to inspect running Sanic instances
    • TLS support for encrypted calls to Inspector
    • Authentication to Inspector with API key
    • Ability to extend Inspector with custom commands
  • #2632 Control order of restart operations
  • #2633 Move reload interval to class variable
  • #2636 Add priority to register_middleware method
  • #2639 Add unquote to add_route method
  • #2640 ASGI websockets to receive text or bytes

Bugfixes

  • #2607 Force socket shutdown before close to allow rebinding
  • #2590 Use actual StrEnum in Python 3.11+
  • #2615 Ensure middleware executes only once per request timeout
  • #2627 Crash ASGI application on lifespan failure
  • #2635 Resolve error with low-level server creation on Windows

Deprecations and Removals

  • #2608 #2630 Signal conditions and triggers saved on signal.extra
  • #2626 Move to HTTP Inspector
    • 🚨 BREAKING CHANGE: Moves the Inspector to a Sanic app from a simple TCP socket with a custom protocol
    • DEPRECATE: The --inspect* commands have been deprecated in favor of inspect ... commands
  • #2628 Replace deprecated distutils.strtobool

Developer infrastructure

  • #2612 Add CI testing for Python 3.11

Full Changelog: v22.9.1...v22.12.0

Version 22.9.1

31 Oct 11:24
ad9183d
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v22.9.0...v22.9.1

Version 22.9.0

29 Sep 09:15
5052321
Compare
Choose a tag to compare

Features

  • #2445 Add custom loads function
  • #2490 Make WebsocketImplProtocol async iterable
  • #2499 Sanic Server WorkerManager refactor
  • #2506 Use pathlib for path resolution (for static file serving)
  • #2508 Use path.parts instead of match (for static file serving)
  • #2513 Better request cancel handling
  • #2516 Add request properties for HTTP method info:
    • request.is_safe
    • request.is_idempotent
    • request.is_cacheable
    • See MDN docs for more information about when these apply
  • #2522 Always show server location in ASGI
  • #2526 Cache control support for static files for returning 304 when appropriate
  • #2533 Refactor _static_request_handler
  • #2540 Add signals before and after handler execution
    • http.handler.before
    • http.handler.after
  • #2542 Add [redacted] to CLI :)
  • #2546 Add deprecation warning filter
  • #2550 Middleware priority and performance enhancements

Bugfixes

  • #2495 Prevent directory traversion with static files
  • #2515 Do not apply double slash to paths in certain static dirs in Blueprints

Deprecations and Removals

  • #2525 Warn on duplicate route names, will be prevented outright in v23.3
  • #2537 Raise warning and deprecation notice on duplicate exceptions, will be prevented outright in v23.3

Developer infrastructure

  • #2504 Cleanup test suite
  • #2505 Replace Unsupported Python Version Number from the Contributing Doc
  • #2530 Do not include tests folder in installed package resolver

Improved Documentation


New Contributors

Full Changelog: v22.6.0...v22.9.0

Version 22.6.2

11 Aug 07:05
b2c0eed
Compare
Choose a tag to compare

#2522 Always show server location in ASGI

Full Changelog: v22.6.1...v22.6.2