Skip to content

4.0.0

Latest
Compare
Choose a tag to compare
@Archmonger Archmonger released this 22 Jun 11:57
9b36b6d

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
  • 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 and use_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 and MutationOptions 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.