Changelog for Falcon 4.2.0#

Summary#

Falcon 4.2.0 primarily contains typing enhancements and performance optimizations. This release also marks the debut of pre-compiled wheels for the free-threaded CPython 3.14 build. Let us know if you are experimenting with scaling Falcon applications using free-threading!

The typing improvements focus on making the WSGI and ASGI App types generic (parametrized by the request and response types). This should make it significantly easier to properly annotate applications that leverage custom request and/or response types.

Additionally, we have fixed a reproducibility issue (thanks to @bmwiedemann from openSUSE for reporting!) in our documentation build process. Regarding packaging Falcon for distributions in general, we would like to remind you of the Packaging Guide that was published with the previous Falcon release (4.1.0). We hope this guide proves useful.

This release also incorporates a number of pull requests submitted by our community. Sincere thanks to all 8 contributors who made this release possible!

Changes to Supported Platforms#

  • The end-of-life Python 3.8 is no longer supported. (#2527)

  • Although the Falcon 4.x series is only guaranteed to support Python 3.10+, this release still supports the end-of-life Python 3.9 at runtime using the pure Python wheel.

    (Note that 3.9 is completely unsupported for new development of Falcon apps, as type checking, building documentation, etc, are likely to fail outright.)

  • Pre-compiled wheels are no longer provided for the macOS x86_64 (Intel) platform. Falcon will continue to install (from the pure Python wheel) and run on macOS Intel just fine. You can also build the binary from sdist yourself. (#2536)

  • Pre-compiled wheels are now available for the free-threaded CPython 3.14 build on selected Linux platforms. (See also: Can I run Falcon on free-threaded CPython?) (#2501)

New & Improved#

  • The URI encoding functions encode(), encode_check_escaped(), encode_value(), and encode_value_check_escaped() have been reimplemented in Cython, leading to a significant speed bump under CPython (provided Falcon is installed from a binary wheel, or cythonized from a source distribution).

    The performance improvement can reach an order of magnitude, although the actual numbers vary depending on the input data. For instance, on CPython 3.12, calling encode_value() with 'no-reply@falconframework.org' would be sped up ~9x, and using the already encoded value 'no-reply%40falconframework.org' with encode_value_check_escaped() could yield a ~12x speed boost. (#1169)

  • falcon.App and falcon.asgi.App have been converted to generic types parametrized by the request and response types, and popular type checkers such as Mypy and Pyright should now correctly infer the use of custom subclasses passed by request_type and response_type, respectively. (#2372)

  • Falcon now supports the retrieval-like QUERY HTTP method; handlers can be implemented using on_query(req, resp, ...) on resources. See the IETF draft for details: https://www.ietf.org/archive/id/draft-ietf-httpbis-safe-method-w-body-11.html. (#2539)

Fixed#

  • Falcon’s documentation build process was not fully reproducible, as the output could vary with the build system’s date. The issue was addressed by adding support for setting the build date via the SOURCE_DATE_EPOCH standardized environment variable. (#2567)

Contributors to this Release#

Many thanks to all of our talented and stylish contributors for this release!