Releases: djblets/djblets
Djblets 4.0
Djblets 4.0 provides utilities for working with Rollup.js in Django projects, Server-Sent Events HTTP streams, a view for health checks, API error improvements, modern Python packaging infrastructure for extensions, more Python type hints throughout the codebase, and more!
Rollup.js support
djblets.pipeline
now supports RollupCompiler and utilities for working with Rollup.js in Django projects. This makes it easy to work with TypeScript, ES Modules, and other modern JavaScript architecture within Django.
When used, Rollup.js will be responsible for compiling any index.js
, index.ts
, index.es6
, or index.es6.js
files, making use of your project's Rollup configuration.
Health Check Endpoint
djblets.util.views.HealthCheckStatus can be used by projects to provide a /health/
URL for informing Kubernetes, Docker, monitoring services, etc. of the health of a server. This will check the memory caching and database servers to make sure they're working as expected.
Server-Sent Events HTTP Response
djblets.http.responses.EventStreamHttpResponse can be used to send Server-Sent Events responses to clients. This is especially useful for periodically reporting status to clients during an HTTP POST (such as when results are processing) or when communicating events to a client (which is best done with a ASGI server implementation).
API resources can also return a generator of djblets.webapi.responses.WebAPIEventStreamMessage objects to automatically send a Server-Sent Events response in API handlers.
API Improvements
WebAPIError now supports several new error-related fields, including:
error_type
: A string-based error codeerror_subtype
: A more specific error for a givenerror_type
detail
: Additional, potentially lengthy information about the error, separate from the error message.trace_id
: An opaque ID that can be used to associate error responses with internal logging or monitoring data.
Python Type Hints
We've added more type hints in the following modules:
djblets.configforms
djblets.extensions
djblets.http
djblets.mail
djblets.util
djblets.webapi
Plus More
See the Djblets 4.0 release notes for the complete list of changes.
Installation
$ pip3 install Djblets==4.0
Learn More
Djblets 4.0 Beta 3
Djblets 4.0 Beta 3 brings additional Python type hints, modern packaging support for extensions, new mail capabilities, and some new utility functions for working with Python and Django projects.
Python Type Hints
We've added Python type hints to the following modules:
djblets.configforms
djblets.extensions
djblets.mail
Modern packaging support
We've switched from the legacy pkg_resources
to the modern importlib_resources
and importlib_metadata
for extensions, ensuring that extensions can take advantage of modern advancements in packaging.
Mail improvements
djblets.mail.message.EmailMessage now supports a reply_to
argument, and deprecates the legacy enable_smart_spoofing
.
New utilities
We added djblets.util.filesystem.safe_join() for safely joining filesystem paths without risk of escaping a confined top-level path.
A new djblets.util.functional module was added for lazily-compiling regexes and computing lengths of iterables.
Plus more
See the full release notes for details.
Installation
$ pip3 install \
-f https://downloads.reviewboard.org/betas/reviewboard/6.0-beta-3/ \
--pre -U Djblets
Learn More
Djblets 3.3: Typing, Symbols, AmountSelectorWidget
Djblets 3.3 introduces a new form field widget for unit-based number input and further enhances our support for Python type hints.
Typing Improvements
The following modules now support Python type hints:
A new djblets.util.typing module has been added with new useful types, including KwargsDict
, StrOrPromise
, JSONValue
, JSONDict
, and JSONList
.
Utility Symbols
A new djblets.util.symbols module has been added with utility symbols that can be used in APIs.
Right now, this includes UNSET
, which can be used as a default result or value in many APIs instead of using None
. More will be added in time.
AmountSelectorWidget
The new AmountSelectorWidget can be used in form fields to let users input a number and select a unit (such as bytes, kilobytes, or megabytes).
See the release notes for more details on Djblets 3.3.
Installation
$ pip3 install Djblets==3.3
Learn More
Djblets 4.0 Beta 1
4.0 beta 1 introduces new support for working with modern JavaScript and TypeScript codebases.
We're moving to TypeScript and ES6 modules (import
/export
) internally, and are making it easier for consumers to bring these into their projects.
All the new support in this release lives in the djblets.pipeline
app for Django Pipeline, featuring:
-
A new
use_rollup
argument for build_pipeline_settings() to enable rollup.js. -
RollupCompiler, a new compiler for using rollup.js.
-
TypeScriptCompiler, a new compiler for using TypeScript.
-
SourceMapStaleCheckMixin, a mixin class for compilers to use sourcemaps for stale file checks.
With Pipeline and Rollup.js enabled, simply include an index.ts
in your JavaScript bundles to enable TypeScript with modules, or index.es6.js
to enable JavaScript with modules.
See the release notes for more details.
Installation
$ sudo pip3 install \
-f https://downloads.reviewboard.org/betas/reviewboard/6.0-beta-1/ \
--pre -U Djblets
Learn More
Djblets 3.2
This is a feature and bug fix release. Highlights include:
- New deprecation utilities and base classes for consumers.
- A new
assertWarnings()
unit test helper. - Improved caching for URI templates in the API.
Installation
$ pip3 install Djblets==3.2