diff --git a/CHANGELOG.md b/CHANGELOG.md index cd3983ec0..fe5fd75ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,10 @@ ### Fixes +- A component with Events that comes from the render cache now writes + the same HTML as when it renders without the cache. Earlier releases + gave its root element an extra `data-cid` attribute, so the browser + could load a second compiled template for the same component. - On free-threaded Python with the GIL off, the request data from an Events check that failed, and the result of one that passed, are now freed about a second after your code lets go of them, not up to 60 diff --git a/docs/design/caching.md b/docs/design/caching.md index 9ea2a56ed..5a16a49e9 100644 --- a/docs/design/caching.md +++ b/docs/design/caching.md @@ -1068,7 +1068,11 @@ exactly. The ownership payload restores active instances, invocations, fills, regions, and init relations under fresh IDs. The client manifest generated from a replay must be indistinguishable from one produced by a fresh render except that the -cached components' render lifecycle did not run. Page serialization and +cached components' render lifecycle did not run. The same holds for the HTML: +the browser finds an Events instance by the render ID in its manifest entry, +so Events adds nothing to the component's root element. Given the same render +IDs, a replay writes the same HTML and manifest as a fresh render, apart from +the State tokens it creates. Page serialization and dependency discovery can still execute the hooks called out in section 5.4. No public cache feature ships for interactive subtrees until this path is diff --git a/packages/py/citry/citry/attrs.py b/packages/py/citry/citry/attrs.py index a42fbca53..07b61e057 100644 --- a/packages/py/citry/citry/attrs.py +++ b/packages/py/citry/citry/attrs.py @@ -318,8 +318,8 @@ def reject_script_capable_attr_name( # Attribute names that Citry writes into the page and reads again later. # After rendering, the server replaces each empty `