4.0.0
Added
- Client-side Python components can now be rendered via the new
{% pyscript_component %}
template tag- You must first call the
{% pyscript_setup %}
template tag to load PyScript dependencies
- You must first call the
- Client-side components can be embedded into existing server-side components via
reactpy_django.components.pyscript_component
. - Tired of writing JavaScript? You can now write PyScript code that runs directly within client browser via the
reactpy_django.html.pyscript
element.- This is a viable substitution for most JavaScript code.
Changed
-
New syntax for
use_query
anduse_mutation
hooks. Here's a quick comparison of the changes:query = use_query(QueryOptions(thread_sensitive=True), get_items, foo="bar") # Old query = use_query(get_items, {"foo":"bar"}, thread_sensitive=True) # New mutation = use_mutation(MutationOptions(thread_sensitive=True), remove_item) # Old mutation = use_mutation(remove_item, thread_sensitive=True) # New
Removed
QueryOptions
andMutationOptions
have been removed. The value contained within these objects are now passed directly into the hook.
Fixed
- Resolved a bug where Django-ReactPy would not properly detect
settings.py:DEBUG
.