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.
- Added a "registration" app to show how to use livecomponents with Django forms.
- Added
livecomponents_login_required
decorator to require a user to be logged in to call a component method.
- Kept sessions marked as deleted for an hour before purging them from the Redis store. This change is to allow the client to recover from a session deletion when the user navigates back to the page.
- Added CancelRendering() exception. The exception makes it possible to cancel the command execution and return an empty string instead of a half-rendered component or an exception.
- Added ComponentId, which is a str subclass that can be used to create child component IDs from a parent component ID using the "|" separator.
- Added ReplaceUrl execution result. This result is used to replace the current URL in the browser as a result of a command execution.
- Improved support for stateless live components. They don't store mock state objects in Redis anymore.
- Added helper method StateAddress.with_component_id() to create a StateAddress with the same session ID, but a different component ID.
- Added reference to the state manager to InitStateContext and UpdateStateContext.
- Added "find_ancestor(ancestor_type)" method to StateAddress and CallContext.
- 🚨 Breaking Change. Modified get_extra_context_data() to accept an instance of ExtraContextRequest(). This instance includes the component state, component_kwargs, current request, component state address, and the state manager. By including the state manager and address, it becomes possible to access stores for other components.
- 🚨 Breaking Change. Removed the passing of component kwargs to init_state() and update_state(). These kwargs are redundant since both InitStateContext and UpdateStateContext already have them.
- Added StatelessLiveComponent as a base class for components that do not need to store state.
- Added
key={component_id}
to the output of the{% component_attrs %}
templatetag. The "key" attribute is used as a hint for Apline Morph to identify elements that need to be updated. - 🚨 Breaking Change. Modified get_extra_context_data() method to accept component_kwargs, allowing extra context population from parent components without storing in Redis. Note: This change is backward incompatible, altering the method signature to include **component_kwargs.
- Added {% component_ancestor %} templatetag.
- Documented templatetags. See "Templatetags" in the README.md.
- Made it possible to use nested components. The change required updating the hierarchy separator from "/" to "|" and type separator from "." to ":".
- Updated the "createlivecomponent" command. The new command accepts the component path and deduces the component name from it.
- Marked LiveComponent as abstract base class.
- Made UpdateStateContext importable directly from livecomponents
- Made it possible to re-render the component state on re-render.
- Added support for handling uploads and provide a sample app to demonstrate the functionality. Refer to "Handling Uploads" in the README.md.
- Returned HTTP 410 Gone status code on missing session ID. See "Error handling" in the README.md.
- Added support for saving context to a Redis store. See "Storing Component Context" in the README.md.
- Implemented the first version of livecomponents.