Repository navigation
Here is what changed?
Checkout the changelog at: https://github.com/duckframework/duck/blob/main/CHANGELOG.md#240---october-27-2026
[2.4.0] - October 27, 2026
Added
- Added method
set_webmanifestto thePagecomponent. - Added
duck nativecommand for management of native apps. - Added
ensure_browser_state_syncedto Lively WebSocket to easily and securely sync cookies, etc with the browser. - Added support for excluding extensions e.g.,
Button(exclude_extensions=[HighlightExtension]) - Added new HTML component extensions at
duck.html.components.extensions.clickable. Extensions includeRippleExtensionandHighlightExtension. - Added
LinkButtoncomponent toduck.html.components.link. - Added
IconButtoncomponent toduck.html.components.icon. - Added
register_default_extensiontoduck.html.components.extensionsmodule, you can now register an extension globally by component class. read_chunked(),write_chunked()and their async counterpartsasync_read_chunked(),async_write_chunked()helpers.- First stage towards
Duck Native. - File
duck.tomlnow supports packages with versions. - Added argument
failsafetoduck.utils.email.collection.collect_email. This logs the exception but doesn't really raise it. - Added
Spacemailprovider toduck.utils.emailmodule for easy sending of emails through spacemail. - Added
duck.html.html_minifymodule and enabled html minify by default for HTML components that accept inner HTML. - Added HTML components
textproperty support newline character\n, this will be rendered as<b>element as HTML. Selectcomponent'soptionsprop now accepts atuple/listof values (in addition to the existing mapping form), rendering each as an<option>with matchingvalue/label.FileIOStream.etagandFileIOStream.last_modified— derived fromst_size/st_mtime_nsvia a singleos.stat()call, letting HTTP responses expose stable cache validators without reading file content.- Conditional request handling (
If-None-Match,If-Modified-Since) with automatic304 Not Modifieddowngrading for cacheableGET/HEADresponses, using the newFileIOStreamvalidators. If-Rangesupport for byte-range (Range) requests — a range is only honored when it matches the resource's current strongETag(orLast-Modifiedas fallback); otherwise the full resource is served, preventing corrupted partial downloads against a changed file.
Changed
Component JS, CSS, and HTML minification is now enabled by default only in production mode. Configure COMPONENTS_MINIFY_JS, COMPONENTS_MINIFY_CSS, and COMPONENTS_MINIFY_HTML in your settings file to control minification. To force minification in debug mode, use the COMPONENTS_FORCE_ prefix, e.g., COMPONENTS_FORCE_MINIFY_JS.
- All page components automatically refresh when they expire or are no longer registered, ensuring pages always serve fresh, up-to-date content.
- All clickable components are now automatically extended with the
HighlightExtension. - Refactored the
Codecomponent toCodeBlockand added support forfilenameandcollapsiblearguments. - Changed HTML components
add_to_registryto be not strict aboutrequestfor ownership assignment. If not provided, the error will lazily be flagged onLivelyevent dispatch. - Improved
Footercomponent positioning for mobile responsiveness and improved the whole footer UI logic. - Changed
FileIOStreamto useos.stat(...).mtime_nsinstead ofos.stat(...).mtimefor caching modification timestamp.
Fixed
- Fixed infinite
session expiredstates upon components/page auto recovery. - Fixed issues scrolling to element for Lively navigation of URLs with hashes.
FileIOStream.read()/AsyncFileIOStream.read()now honor the requestedsize. Reads larger thanchunk_sizeare collected chunk by chunk untilsizebytes or EOF. Previously they returned at most one chunk, and that short result was cached under the full-size key.FileIOStream.write()/AsyncFileIOStream.write()now write inchunk_sizepieces until all data is written. The cache is patched andon_writehooks fire with the bytes actually written, so a short write can no longer leave the cache holding data that never reached the file.- A write that fails after some chunks were written now returns the partial byte count, so stream position and cache stay accurate. A failure on the first chunk still raises
OSError. - Negative
sizevalues now read the whole file, matching Python's file API. Previously only-1did. - Fixed MCPView's
run()bug. - Fixed
BasicExtensionlinebreak replace bug in propertyinner_htmlsetter. - Fixed
StreamingRangeHttpResponsenot correctly parsing range header - leading to slightly wrong data.