Skip to content

Releases: reactive-python/reactpy-django

6.0.0b1

6.0.0b1 Pre-release
Pre-release

Choose a tag to compare

@Archmonger Archmonger released this 14 Jul 22:20
35b702f

This is a beta version release (primarily to add support for ReactPy v2).

Added

  • Automatically serve ReactPy wheel from Django's static directory when using PyScript.

Changed

  • Updated dependencies: reactpy>=2.0.0, <3.0.0 and reactpy-router>=3.0.0, <4.0.0.
  • Updated Python support to 3.11–3.14.
  • Replaced PyScript <py-script> tags with standard <script type="py"> tags.
  • Updated the interface for reactpy.hooks.use_channel_layer to be more intuitive.
    • Arguments now must be provided as keyworded arguments.
    • The name argument has been renamed to channel.
    • The group_name argument has been renamed to group.
    • The group_add and group_discard arguments have been removed for simplicity.
  • To improve performance, preact is now used as the default client-side library instead of react.
  • ReactPy v2 compatibility! This release aligns reactpy-django with ReactPy v2's API.
    • Refactored DjangoResolver to extend ReactPyResolver instead of StarletteResolver.
    • Replaced web.module_from_file/web.export with reactjs.component_from_file.
    • Replaced reactpy.backend.types and reactpy.core.types imports with reactpy.types.
    • Renamed Location.pathname to Location.path and Location.search to Location.query_string.

Removed

  • Removed reactpy_django.components.pyscript_component. Use reactpy.executors.pyscript.pyscript_component instead.
  • Removed the entire reactpy_django/pyscript/ package (component template, layout handler, and utilities) in favor of ReactPy core's PyScript executor.
  • Removed reactpy_django.html.pyscript. Use reactpy.html.py_script instead.
  • Removed nest_asyncio dependency.

Fixed

  • Resolved bug where django_form events would sometimes not occur.

5.2.1

Choose a tag to compare

@Archmonger Archmonger released this 11 Jan 03:42
923e309

Changed

  • Use the latest version of @reactpy/client which includes a fix for needless client-side component re-creation.

5.2.0

Choose a tag to compare

@Archmonger Archmonger released this 30 Dec 07:27
9295abc

Added

  • User login/logout features!
    • reactpy_django.hooks.use_auth to provide persistent login and logout functionality to your components.
    • settings.py:REACTPY_AUTH_TOKEN_MAX_AGE to control the maximum seconds before ReactPy's login token expires.
    • settings.py:REACTPY_CLEAN_AUTH_TOKENS to control whether ReactPy should clean up expired authentication tokens during automatic cleanups.
  • Automatically convert Django forms to ReactPy forms via the new reactpy_django.components.django_form component!
  • The ReactPy component tree can now be forcibly re-rendered via the new reactpy_django.hooks.use_rerender hook.

Changed

  • Refactoring of internal code to improve maintainability. No changes to publicly documented API.

Fixed

  • Fixed bug where pre-rendered components could generate a SynchronousOnlyOperation exception if they access a freshly logged out Django user object.

5.1.1

Choose a tag to compare

@Archmonger Archmonger released this 02 Dec 10:26
d663d12

Fixed

  • Fixed regression in v5.1.0 where components would sometimes not output debug messages when settings.py:DEBUG is enabled.

Changed

  • Set upper limit on ReactPy version to <2.0.0.
  • ReactPy web modules are now streamed in chunks.
  • ReactPy web modules are now streamed using asynchronous file reading to improve performance.
  • Performed refactoring to utilize ruff as this repository's linter.

5.1.0

Choose a tag to compare

@Archmonger Archmonger released this 25 Nov 07:12
2abe5ce

Added

  • settings.py:REACTPY_ASYNC_RENDERING to enable asynchronous rendering of components.

Changed

  • Bumped the minimum ReactPy version to 1.1.0.

5.0.0

Choose a tag to compare

@Archmonger Archmonger released this 23 Oct 04:56
95f8abf

Changed

  • Now using ReactPy-Router v1 for URL routing, which comes with a slightly different API than before.
  • Removed dependency on aiofile.

Removed

  • Removed the following deprecated features:
    • The compatibility argument on reactpy_django.components.view_to_component
    • reactpy_django.components.view_to_component usage as a decorator
    • reactpy_django.decorators.auth_required
    • reactpy_django.REACTPY_WEBSOCKET_PATH
    • settings.py:REACTPY_WEBSOCKET_URL

4.0.0

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.

3.8.1

Choose a tag to compare

@Archmonger Archmonger released this 07 May 23:43
d45d2ec

Added

  • Python 3.12 compatibility

3.8.0

Choose a tag to compare

@Archmonger Archmonger released this 21 Feb 01:54
c80f94d

Added

  • Built-in cross-process communication mechanism via the reactpy_django.hooks.use_channel_layer hook.
  • Access to the root component's id via the reactpy_django.hooks.use_root_id hook.
  • More robust control over ReactPy clean up tasks!
    • settings.py:REACTPY_CLEAN_INTERVAL to control how often ReactPy automatically performs cleaning tasks.
    • settings.py:REACTPY_CLEAN_SESSIONS to control whether ReactPy should clean up expired sessions during automatic cleanups.
    • settings.py:REACTPY_CLEAN_USER_DATA to control whether ReactPy should clean up orphaned user data during automatic cleanups.
    • python manage.py clean_reactpy command to manually perform ReactPy clean up tasks.

Changed

  • Simplified code for cascading deletion of user data.

3.7.0

Choose a tag to compare

@Archmonger Archmonger released this 30 Jan 08:33
162406b

Added

  • An "offline component" can now be displayed when the client disconnects from the server.
  • URL router now supports a * wildcard to create default routes.