Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]¶
Added¶
Added
duck.http.response.LazyHttpResponsefor lazy loaded HTTP responses.Corrected HTTP
keep-alivehandling and updated the server default tokeep-alive.Added settings
DATA_UPLOAD_MAX_SIZEandFILE_UPLOAD_MAX_SIZEand they default to100MBAdded
sync_now(): diffs a descendant against its own checkpoint and sends only real changes, scoped to that component’s subtree — unlikeupdate_now(), which force-pushes a full patch unconditionally even on no-op state changes and can’t target a nested component without touching its ancestor.Added
@login_requireddecorator toduck.contrib.auth.decoratorsmodule.Added
@user_requireddecorator toduck.contrib.auth.decoratorsmodule, resolving the full user model and attachingrequest.userbefore the view runs.Added
@condition_requireddecorator toduck.contrib.auth.decoratorsmodule, gating access on an arbitrary sync or async predicate evaluated againstrequest.Added
async_get_user_idfor better concurrency.Added “backend-aware”
duck.contrib.authhelpersget_userandasync_get_user.Improved
duck.utils.validationhelpers.- Prevented mixinginner_htmland child components to avoid inconsistent UI state during Lively updates.Improved state restoration so HTML components are now automatically synchronized with the client after their state is restored. Users no longer need to manually call
ws.update_now()after restoring a component’s state; simply restore the state on the component itself and Duck will handle the required client update automatically.Added adaptive load-based scaling to
TransactionThreadPool’s general-thread freeing, replacing the fixed-percentage strategy with an EWMA load estimate (load_estimate), configurable viaheadroom_factor,idle_grace_period,max_free_per_cycle, andload_check_interval.Added
duck sync, a dependency synchronization system that reads project dependencies fromduck.toml, detects the current environment, resolves the appropriate package manager, and installs missing Python and system dependencies automatically.If no
descriptionis provided in MCP decorators (e.g.@tool()), a short summary is automatically extracted from the function’s docstring and used as the tool description.Added
@cacheand@async_cachedecorators toduck.utils.caching.CacheBase.You can now declaratively bind events to HTML components using the
eventsargument (e.g.Button(event_handlers=[{"click": on_button_click, **extra_kwargs}])); for document-level events such asDOMContentLoaded, use thedocument_eventsargument onPagewith the same event configuration format.Added automatic process naming (“duck-server[project_name]”) with normalized project names for easier process identification and monitoring.
Changed¶
Simplified
View.runto acceptrequest, **kwargsbut default to match the default function convention.Changed the “duck monitor” argument from “–duck-process” to “–process” for simplicity and consistency.
TransactionThreadPool’sgeneral_threads_free_levelnow defaults toNone, using the new adaptive freeing strategy; set it to an int to keep the original fixed-percentage behavior.window.LIVELY_APPLICATION.createDuckEventnow supports arawargument. Whentrue, Duck skips its default event processing (e.g. extractingvaluefrom abutton) and passes thedetailargument directly to Python event handler instead.
Fixed¶
Fixed some MCP bug resulting in generating mcp registry.
Command
duck monitornot formatting output data correctly causing ValueError.
[2.2.0] - July 15, 2026¶
Added¶
Added the
UnsupportedBrowserBannercomponent to theduck.html.components.unsupported_browsermodule.Added the
glaciervariant to theSnackbarcomponent, providing a modern frosted-glass appearance.Added
set_header_if_absentto theResponseobject.Added
duck.contrib.mcpfor MCP communications.Added a
reverseargument toVDomNodeto control patch application order.Pagecomponents now apply patches in reverse order, ensuring thebodyis patched before thehead.
Changed¶
Updated the
SnackbarandProgresscomponents to support dynamic color updates after initialization.Updated
lively.jsandlively.min.jsto support the new page progress bar and snackbar behavior.Simplified the
Pagecomponent implementation.Refined Lively’s WebSocket connection notifications to display only meaningful status changes, removing the initial “Connected” toast.
Updated
Pagemethods such asset_author,set_canonical,set_pagination, andset_json_ldto allow multiple invocations without raisingComponentAttributeProtectionerror, making them safe to update or override throughout the page lifecycle.
Fixed¶
Fixed several issues related to snackbar state synchronization and dynamic updates.
Fixed and refined the
response_finalizermodule.Fixed Lively DOM Mutation warning showing in non DEBUG mode.
[2.1.0] - June 20, 2026¶
Added¶
Added
is_valid_hostto theduck.utils.netmodule.Added two built-in template tags and one filter:
smart_truncateexpand_exceptionto_spaced_camel_casesmart_truncateandto_spaced_camel_caseare powered by utilities from theduck.utils.stringmodule.
Improved default blueprint scaffolding:
New blueprints now include a
ui/directory by default.views.pyis generated automatically.Static assets are automatically discovered from
ui/static/.Templates are automatically discovered from
ui/templates/.
Added a built-in Dashboard blueprint for monitoring and managing Duck applications, including:
Request and response metrics
Latency tracking
Error reporting
Route inspection
Log monitoring
Real-time server state monitoring
Added support for log handlers in the
duck.logging.handlermodule, enabling custom integrations and actions to be executed whenever log messages are emitted.Added a built-in Dashboard accessible via the
/dashboardroute, providing visibility into:Requests and responses
Errors and exceptions
Logs and routes
Performance metrics
Server diagnostics
Added support for the
ENABLE_DASHBOARDsetting, allowing the Dashboard to be enabled or disabled without manual blueprint registration.Added
DASHBOARD_USERNAMEandDASHBOARD_PWDsettings for securing Dashboard access during development and debugging.Added
get_user_idtoduck.contrib.authfor efficiently retrieving the authenticated user’s ID from supported authentication backends such asjwtandsession, avoiding the overhead of loading the full user object when only the identifier is required.Added the
duck.securitypackage for security-related utilities.Added a
user_idargument toduck.contrib.auth.loginandduck.contrib.auth.async_login, enabling fast authentication when the user ID is already known.Added a
force_reparentargument toInnerHtmlComponent.add_childandInnerHtmlComponent.add_childrenthat automatically detaches a component from any existing parent and component tree before reattaching it. This is useful when reusing components that were temporarily attached elsewhere during construction.Added
remove_ansi_escape_codes_strto theduck.utils.ansimodule.Added the
duck.security.passwordsmodule for password strength validation and security checks.
Changed¶
Renamed
duck.etc.appstoduck.etc.blueprintsto better reflect its purpose.Renamed the built-in blueprint:
duck.etc.apps.defaultsite.blueprint.Ducksiteto:
duck.etc.blueprints.welcome.blueprint.WelcomeRemoved
simple_responsefromduck.contrib.responses.Renamed
template_responsetomake_responsefor improved clarity and consistency.Added
async_make_responseas the asynchronous equivalent ofmake_response.Refined middleware implementations and improved middleware debugging messages.
Modernized Duck’s default pages and error pages with a cleaner, more polished user experience.
Simplified and reduced complexity within
duck.contrib.responses.errors.Dashboard functionality is now only enabled when securely configured.
Moved the
duck.ansimodule toduck.utils.ansi.Added
https://fonts.googleapis.comandhttps://fonts.gstatic.comto the default Content Security Policy (CSP) rules.duck.utils.fileio.FileIOStreamnow caches read and write operations to improve performance during repeated access.
Fixed¶
Fixed various issues related to blueprint generation and resource discovery.
Fixed inconsistencies in default blueprint structure and automatic asset resolution.
Fixed middleware
process_responsehooks not executing for error responses.process_responseis now always executed whenever a request object is available.Fixed
InnerHtmlComponent.add_childrento iterate over a copy of the provided children collection, preventing issues caused by mutations during iteration.Fixed several subtle bugs in
duck.utils.xsocket.Fixed an issue with the
duck collectstaticcommand.
[2.0.0] - June 8, 2026¶
Added¶
Added
static_filepathandmedia_filepathhelpers to theduck.shortcutsmodule.Added an
absoluteargument to themediaandstaticshortcut functions.Added a
log_resultsargument to theexec_timeandasync_exec_timedecorators induck.utils.performance.Added support for
selectedandvaluekeyword arguments to theOptionHTML/Lively component and improved theSelectcomponent.Added
update_now()toLivelyWebsocketView, allowing immediate synchronization of component state with the client during event execution.Added automatic session persistence for Lively events when session data is modified.
Added the
set_meta()method to thePagecomponent.Added the
csrf_exemptdecorator toduck.views.Introduced a cleaner application architecture where all applications inherit from
duck.app.base.BaseApp.Added a
server_urlargument toBaseAppfor improved reverse-proxy and deployment support.Added support for application events through the
eventsargument on core applications fromduck.apps.Added first-class JWT support, modeled after Duck’s session system. JWT payloads can now be accessed and modified directly using syntax such as:
request.JWT["key"] = valueAdded authentication utilities to
duck.contrib.auth:authenticateloginlogoutget_user_from_sessionget_user_from_jwt
Added
JWTMiddlewareto Duck’s default middleware stack.Added encrypted cache support through
duck.utils.caching.encrypted.
Changed¶
Refactored the
staticandmediahelpers to support external URLs in addition to internal assets.Refined AI guidelines in the
ai/directory.Made
duck.http.middlewares.contrib.WWWRedirectMiddlewareoptional and removed it from the default middleware configuration.Renamed
SessionStore.create()toassign_new_session_key()for improved clarity.Made request sessions lazily loaded on first access or modification.
Renamed
_extract_and_process_request_data()to_set_request_fields().Renamed
duck.utils.port_recordertoduck.utils.port_registryand fully refactored its internals.Improved and refined the
ssl-gencommand.Improved
SessionStorageConnectorshutdown performance by executing storage cleanup operations in background threads.Improved and refined the
duck.app.microappmodule.Renamed the
FORCE_HTTPSsetting toHTTPS_REDIRECT.Improved the
AppAPI and internal application lifecycle.Removed default self-signed certificate generation settings; certificate generation is now entirely optional.
Reduced the default
DJANGO_SERVER_WAIT_TIMEto 1 second.Improved how Lively synchronizes SESSION, JWT, and other server-side state after mutations. Synchronization now uses a secure server-issued flow that updates credentials through a protected
fetch()request while preserving support forHttpOnlycookies.Improved session storage security.
Fixed¶
Fixed a Lively navigation issue when navigating from URLs containing fragments (e.g.
https://duckframework.com#section) to internal routes.
[1.0.2] - March 6, 2026¶
Added¶
Added minor features and quality-of-life improvements.
Changed¶
Refactored various parts of the codebase to improve maintainability.
Fixed¶
Fixed several minor bugs and stability issues.