Releases: reactive-python/reactpy-django
Releases · reactive-python/reactpy-django
Release list
6.0.0b1
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.0andreactpy-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_layerto be more intuitive.- Arguments now must be provided as keyworded arguments.
- The
nameargument has been renamed tochannel. - The
group_nameargument has been renamed togroup. - The
group_addandgroup_discardarguments have been removed for simplicity.
- To improve performance,
preactis now used as the default client-side library instead ofreact. - ReactPy v2 compatibility! This release aligns
reactpy-djangowith ReactPy v2's API.- Refactored
DjangoResolverto extendReactPyResolverinstead ofStarletteResolver. - Replaced
web.module_from_file/web.exportwithreactjs.component_from_file. - Replaced
reactpy.backend.typesandreactpy.core.typesimports withreactpy.types. - Renamed
Location.pathnametoLocation.pathandLocation.searchtoLocation.query_string.
- Refactored
Removed
- Removed
reactpy_django.components.pyscript_component. Usereactpy.executors.pyscript.pyscript_componentinstead. - 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. Usereactpy.html.py_scriptinstead. - Removed
nest_asynciodependency.
Fixed
- Resolved bug where
django_formevents would sometimes not occur.
5.2.1
5.2.0
Added
- User login/logout features!
reactpy_django.hooks.use_authto provide persistentloginandlogoutfunctionality to your components.settings.py:REACTPY_AUTH_TOKEN_MAX_AGEto control the maximum seconds before ReactPy's login token expires.settings.py:REACTPY_CLEAN_AUTH_TOKENSto 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_formcomponent! - The ReactPy component tree can now be forcibly re-rendered via the new
reactpy_django.hooks.use_rerenderhook.
Changed
- Refactoring of internal code to improve maintainability. No changes to publicly documented API.
Fixed
- Fixed bug where pre-rendered components could generate a
SynchronousOnlyOperationexception if they access a freshly logged out Django user object.
5.1.1
Fixed
- Fixed regression in v5.1.0 where components would sometimes not output debug messages when
settings.py:DEBUGis 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
ruffas this repository's linter.
5.1.0
Added
settings.py:REACTPY_ASYNC_RENDERINGto enable asynchronous rendering of components.
Changed
- Bumped the minimum ReactPy version to
1.1.0.
5.0.0
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
compatibilityargument onreactpy_django.components.view_to_component reactpy_django.components.view_to_componentusage as a decoratorreactpy_django.decorators.auth_requiredreactpy_django.REACTPY_WEBSOCKET_PATHsettings.py:REACTPY_WEBSOCKET_URL
- The
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.pyscriptelement.- This is a viable substitution for most JavaScript code.
Changed
-
New syntax for
use_queryanduse_mutationhooks. 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
QueryOptionsandMutationOptionshave 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
3.8.0
Added
- Built-in cross-process communication mechanism via the
reactpy_django.hooks.use_channel_layerhook. - Access to the root component's
idvia thereactpy_django.hooks.use_root_idhook. - More robust control over ReactPy clean up tasks!
settings.py:REACTPY_CLEAN_INTERVALto control how often ReactPy automatically performs cleaning tasks.settings.py:REACTPY_CLEAN_SESSIONSto control whether ReactPy should clean up expired sessions during automatic cleanups.settings.py:REACTPY_CLEAN_USER_DATAto control whether ReactPy should clean up orphaned user data during automatic cleanups.python manage.py clean_reactpycommand to manually perform ReactPy clean up tasks.
Changed
- Simplified code for cascading deletion of user data.
3.7.0
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.