Djblets 4.0 Release Notes¶
Release date: October 17, 2023
This release contains all bug fixes and features found in Djblets version 3.3.
Installation¶
Djblets 4.0 is compatible with Django 3.2 LTS and Python 3.8 - 3.12.
To install Djblets 4.0, run:
$ pip3 install Djblets==4.0
To learn more, see:
Packaging¶
Djblets 4.x supports Python 3.8 - 3.12.
Support for Python 3.7 has been dropped, and 3.12 has been added.
Django 3.2.x is required.
cryptography 1.8.1+ is required.
django-pipeline 2.0.9 - 2.0.x is required.
markdown 3.3.x is required.
packaging 23.1 or higher is required.
importlib-metadata 6.6 or higher is required.
importlib-resources 5.9 or higher is required.
For building packages, Node.JS packages have now been consolidated as
dependencies under a new utility package. All Node.JS dependencies are now
listed in package.json
instead of djblets/dependencies.py
.
@beanbag/frontend-buildkit 1.1.0 - 1.1.x
JavaScript Packaging¶
Djblets now includes support for building JavaScript bundles using TypeScript and rollup.js.
Users of Djblets’ extension framework can use these technologies for their extension media as well.
Over the next several releases, we expect to port sections of the Djblets JavaScript codebase to this. This should not have any effect on users unless you are subclassing Djblets JavaScript classes.
djblets.cache¶
Added crash-protection and logging in
GenerationSynchronizer
when cache servers are down.
djblets.configforms¶
Added Python type hints throughout some of the module.
The full port to Python type hints is still in-progress.
Updated the Config Forms JavaScript support to use Spina and TypeScript.
This enables code working with Config Forms to use Spina and TypeScript when interfacing with or subclassing these components.
djblets.datagrids¶
DataGrid.load_extra_state
must now return a list of field names to save.The old usage had previously raised a deprecation warning.
Fixed crashes loading datagrids with
?sort=,
query arguments.Datagrids can’t normally create a link with a sort field that just contains a comma, but some web crawlers would manufacture that URL, causing error emails to be generated.
djblets.db¶
Fixed a bug in
ModificationTimestampField
where the timestamp would not update its value automatically.
djblets.extensions¶
Added Python type hints throughout most of the module.
The full port to Python type hints is still in-progress.
Updated the JavaScript extension support to use Spina and TypeScript.
This enables extension code to be written using these toolkits. This is backwards-compatible with older extensions.
TestRunner
has been updated to allow usage of pytest.This will become the default in Djblets 5.
Updated to use modern Python packaging modules for extensions instead of legacy modules.
Our packaging and package loading code for extensions now use the modern importlib_metadata, importlib_resources, and packaging modules instead of the deprecated
pkg_resources
.While this shouldn’t impact any extensions, this is a large change. If your extension package no longer works, please let us know.
djblets.forms¶
The
value
attribute toListEditWidget
must be passed as a list instead of a string.The old usage had previously raised a deprecation warning.
djblets.http¶
Added
EventStreamHttpResponse
, for Server-Sent Events HTTP responses.This takes a generator or generator function that can stream event messages to the client. It automatically handles parsing Last-Event-ID headers from the client for helping the generator resume where it left off.
djblets.mail¶
Added Python type hints throughout the module.
Added a
reply_to
argument toEmailMessage
.Updated to use modern Python packaging modules for loading DMARC-related data.
Deprecated positional arguments and the
enable_smart_spoofing
argument inEmailMessage
.
djblets.pipeline¶
Added
RollupCompiler
, a new compiler for using rollup.js.Added
TypeScriptCompiler
, a new compiler for using TypeScript.Added
SourceMapStaleCheckMixin
, a mixin class for compilers to use sourcemaps for stale file checks.-
This function now expects parameters to be passed as keyword arguments.
Calling this with positional arguments will raise a deprecation warning.
Added a new
use_rollup
androllup_extra_args
arguments for enabling rollup.js.
djblets.registries¶
Updated to use modern Python packaging modules for loading Python entrypoint-backed registries.
djblets.util¶
djblets.util.filesystem¶
Added
safe_join()
for joining filesystem path components without risk of escaping a confined top-level directory.
djblets.util.functional (new)¶
This module contains:
iterable_len()
: Efficiently computes the length of a finite iterable.lazy_re_compile()
: Lazily compiles a regex on first access, to help reduce module/class load times.
djblets.util.properties¶
AliasProperty
andTypedProperty
now expect constructor parameters to be passed as keyword arguments.Calling these with positional arguments will raise a deprecation warning.
djblets.util.symbols¶
Improved Python type hints for the
UNSET
symbol.This will now be correctly type-narrowed when compared against a value.
djblets.util.typing¶
Added new types for JSON-serializable data:
These types are a superset of the standard JSON types in this module, built to work with
DjbletsJSONEncoder
. They support the following serializable value types:
djblets.util.views¶
Added the
HealthCheckStatus
view, for indicating service health.This will check all configured database and cache services, providing a JSON payload showing what services are up or down. This can be used with monitoring services or Docker health checks.
Only permitted IP addresses can perform a health check. This defaults to
settings.INTERNAL_IPS
, but can also be overridden by settingsetting.DJBLETS_HEALTHCHECK_IPS
.
djblets.webapi¶
Added Python type hints throughout most of the module.
API resource handlers can now stream Server-Sent Events messages by returning a generator containing
WebAPIEventStreamMessage
instances.Added new fields for
WebAPIError
output:detail
: A more verbose error message, conveying additional details without altering the primary error message.error_type
: A string representing the error type (a readable version of numeric error codes).error_subtype
: A string representing a subtype of an error, to differentiate between instances of an error.trace_id
: A service-specific ID that can help point to relevant log entries or other recorded data, to help diagnose errors.
Improved performance and caching of API resources.
WebAPIError.__init__()
andWebAPIError.with_overrides()
now require keyword-only arguments.Passing as positional arguments is deprecated and will be removed in Djblets 5.
The
token_generator_id
andtoken_info
parameters are now required forgenerate_token()
.The old usage had previously raised a deprecation warning.
Fixed a crash that could occur if a client issued an HTTP PUT against a list resource.
JavaScript¶
Fixed
$.ui.modalBox
button placement to factor in the padding around the box.
Contributors¶
Christian Hammond
David Trowbridge
Michelle Aubin