Changelog
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased¶
- Nothing (yet)!
3.8.0 - 2024-02-20¶
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 UserData.
3.7.0 - 2024-01-30¶
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.
3.6.0 - 2024-01-10¶
Added¶
- Built-in Single Page Application (SPA) support!- reactpy_django.router.django_routercan be used to render your Django application as a SPA.
 
- SEO compatible rendering!- settings.py:REACTPY_PRERENDERcan be set to- Trueto make components pre-render by default.
- Or, you can enable it on individual components via the template tag: {% component "..." prerender="True" %}.
 
- New view_to_iframefeature!- reactpy_django.components.view_to_iframeuses an- <iframe>to render a Django view.
- reactpy_django.utils.register_iframetells ReactPy which views- view_to_iframecan use.
 
- New Django Userrelated features!- reactpy_django.hooks.use_usercan be used to access the current user.
- reactpy_django.hooks.use_user_dataprovides a simplified interface for storing user key-value data.
- reactpy_django.decorators.user_passes_testis inspired by the equivalent Django decorator, but ours works with ReactPy components.
- settings.py:REACTPY_AUTO_RELOGINwill cause component WebSocket connections to automatically re-login users that are already authenticated. This is useful to continuously update- last_logintimestamps and refresh the Django login session.
 
Changed¶
- Renamed undocumented utility function ComponentPreloadertoRootComponentFinder.
- It is now recommended to call as_view()when usingview_to_componentorview_to_iframewith Class Based Views.
- For thread safety, thread_sensitive=Truehas been enabled in allsync_to_asyncfunctions where ORM queries are possible.
- reactpy_django.hooks.use_mutationnow has a- __call__method. So rather than writing- my_mutation.execute(...), you can now write- my_mutation(...).
Deprecated¶
- The compatibilityargument onreactpy_django.components.view_to_componentis deprecated.- Use view_to_iframeas a replacement.
 
- Use 
- reactpy_django.components.view_to_componentusage as a decorator is deprecated.- Check the docs on how to use view_to_componentas a function instead.
 
- Check the docs on how to use 
- reactpy_django.decorators.auth_requiredis deprecated.- Use reactpy_django.decorators.user_passes_testinstead.
- An equivalent to auth_required's default is@user_passes_test(lambda user: user.is_active).
 
- Use 
Fixed¶
- Fixed a bug where exception stacks would not print on failed component renders.
3.5.1 - 2023-09-07¶
Added¶
- Warning W018 (Suspicious position of 'reactpy_django' in INSTALLED_APPS) has been added.
Changed¶
- The default postprocessor can now disabled by setting REACTPY_DEFAULT_QUERY_POSTPROCESSORtoNone.
- Massive overhaul of docs styling.
3.5.0 - 2023-08-26¶
Added¶
- More customization for reconnection behavior through new settings!- REACTPY_RECONNECT_INTERVAL
- REACTPY_RECONNECT_MAX_INTERVAL
- REACTPY_RECONNECT_MAX_RETRIES
- REACTPY_RECONNECT_BACKOFF_MULTIPLIER
 
- ReactPy-Django docs are now version controlled via mike!
Changed¶
- Bumped the minimum ReactPy version to 1.0.2.
- Prettier WebSocket URLs for components that do not have sessions.
- Template tag will now only validate args/kwargsifsettings.py:DEBUGis enabled.
- Bumped the minimum @reactpy/clientversion to0.3.1
- Use TypeScript instead of JavaScript for this repository.
- Bumped the minimum Django version to 4.2.
Django 4.2+ is required
ReactPy-Django will continue bumping minimum Django requirements to versions that increase async support.
This "latest-only" trend will continue until Django has all async features that ReactPy benefits from. After this point, ReactPy-Django will begin supporting all maintained Django versions.
Removed¶
- settings.py:REACTPY_RECONNECT_MAXis removed. See the docs for the new- REACTPY_RECONNECT_*settings.
3.4.0 - 2023-08-18¶
Added¶
- Distributed Computing: ReactPy components can now optionally be rendered by a completely separate server!- REACTPY_DEFAULT_HOSTSsetting can round-robin a list of ReactPy rendering hosts.
- hostargument has been added to the- componenttemplate tag to force components to render on a specific host.
 
- reactpy_django.utils.register_componentfunction can manually register root components.- Useful if you have dedicated ReactPy rendering application(s) that do not use HTML templates.
 
Changed¶
- ReactPy will now provide a warning if your HTTP URLs are not on the same prefix as your WebSockets.
- Cleaner logging output for auto-detected ReactPy root components.
Deprecated¶
- reactpy_django.REACTPY_WEBSOCKET_PATHis deprecated. The identical replacement is- REACTPY_WEBSOCKET_ROUTE.
- settings.py:REACTPY_WEBSOCKET_URLis deprecated. The similar replacement is- REACTPY_URL_PREFIX.
Removed¶
- Warning W007 (REACTPY_WEBSOCKET_URL doesn't end with a slash) has been removed. ReactPy now automatically handles slashes.
- Warning W008 (REACTPY_WEBSOCKET_URL doesn't start with an alphanumeric character) has been removed. ReactPy now automatically handles this scenario.
- Error E009 (channels is not in settings.py:INSTALLED_APPS) has been removed. Newer versions ofchannelsdo not require installation viaINSTALLED_APPSto receive an ASGI web server.
3.3.2 - 2023-08-13¶
Added¶
- ReactPy WebSocket will now decode messages via orjsonresulting in an ~6% overall performance improvement.
- Built-in asyncioevent loops are now patched vianest_asyncio, resulting in an ~10% overall performance improvement. This has no performance impact if you are running your web server withuvloop.
Fixed¶
- Fix bug where REACTPY_WEBSOCKET_URLalways generates a warning if unset.
- Fixed bug on Windows where assert f is self._write_futwould be raised byuvicornwhenREACTPY_BACKHAUL_THREAD = True.
- Fixed bug on Windows where rendering behavior would be jittery with daphnewhenREACTPY_BACKHAUL_THREAD = True.
3.3.1 - 2023-08-08¶
Added¶
- Additional system checks for ReactPy misconfigurations.
Changed¶
- REACTPY_BACKHAUL_THREADnow defaults to- False.
3.3.0 - 2023-08-05¶
Added¶
- Added system checks for a variety of common ReactPy misconfigurations.
- REACTPY_BACKHAUL_THREADsetting to enable/disable threading behavior.
Changed¶
- If using settings.py:REACTPY_DATABASE,reactpy_django.database.Routermust now be registered insettings.py:DATABASE_ROUTERS.
- By default, ReactPy will now use a backhaul thread to increase performance.
- Minimum Python version required is now 3.9
- A thread-safe cache is no longer required.
3.2.1 - 2023-06-29¶
Added¶
- Template tag exception details are now rendered on the webpage when settings.py:DEBUGis enabled.
Fixed¶
- Prevent exceptions within the componenttemplate tag from causing the whole template to fail to render.
3.2.0 - 2023-06-08¶
Added¶
- Added warning if poor system/cache/database performance is detected while in DEBUGmode.
- Added REACTPY_AUTH_BACKENDsetting to allow for custom authentication backends.
Changed¶
- Using SessionMiddlewareStackis now optional.
- Using AuthMiddlewareStackis now optional.
3.1.0 - 2023-05-06¶
Added¶
- use_querynow supports async functions.
- use_mutationnow supports async functions.
- reactpy_django.types.QueryOptions.thread_sensitiveoption to customize how sync queries are executed.
- reactpy_django.hooks.use_mutationnow accepts- reactpy_django.types.MutationOptionsoption to customize how mutations are executed.
Changed¶
- The mutateargument onreactpy_django.hooks.use_mutationhas been renamed tomutation.
Fixed¶
- Fix bug where ReactPy utilizes Django's default cache timeout, which can prematurely expire the component cache.
3.0.1 - 2023-04-06¶
Changed¶
- reactpy-djangodatabase entries are no longer cleaned during Django application startup. Instead, it will occur on webpage loads if- REACTPY_RECONNECT_MAXseconds has elapsed since the last cleaning.
3.0.0-reactpy - 2023-03-30¶
Changed¶
- django-idomhas been renamed to- reactpy-django! Please note that all references to the word- idomin your code should be changed to- reactpy. See the docs for more details.
3.0.0 - 2023-03-08¶
Note
This is Django-IDOM's biggest update yet!
To upgrade from previous version you will need to...
- Install django-idom >= 3.0.0
- Run idom rewrite-keys <DIR>andidom rewrite-camel-case-props <DIR>to update youridom.html.*calls to the new syntax
- Run python manage.py migrateto create the new Django-IDOM database entries
Added¶
- The idomclient will automatically configure itself to debug mode depending onsettings.py:DEBUG.
- use_connectionhook for returning the browser's active- Connection.
- IDOM_CACHEis now configurable within- settings.pyto whatever cache name you wish.
Changed¶
- It is now mandatory to run manage.py migrateafter installing IDOM.
- Bumped the minimum IDOM version to 1.0.0. Due to IDOM 1.0.0, idom.html.*...- HTML properties can now be snake_case. For exampleclassNamenow becomesclass_name.
- key=...is now declared within the props- dict(rather than as a- kwarg).
 
- HTML properties can now be 
- The componenttemplate tag now supports both positional and keyword arguments.
- The componenttemplate tag now supports non-serializable arguments.
- IDOM_WS_MAX_RECONNECT_TIMEOUTsetting has been renamed to- IDOM_RECONNECT_MAX.
Removed¶
- django_idom.hooks.use_websockethas been removed. The similar replacement is- django_idom.hooks.use_connection.
- django_idom.types.IdomWebsockethas been removed. The similar replacement is- django_idom.types.Connection.
- settings.py:CACHE['idom']is no longer used by default. The name of the cache back-end must now be specified with the- IDOM_CACHEsetting.
Fixed¶
- view_to_componentwill now retain the contents of a- <head>tag when rendering.
- React client is now set to productionrather thandevelopment.
- use_querywill now utilize- field.related_namewhen postprocessing many-to-one relationships.
Security¶
- Fixed a potential method of component template tag argument spoofing.
- Exception information will no longer be displayed on the page, based on the value of settings.py:DEBUG.
2.2.1 - 2023-01-09¶
Fixed¶
- Fixed bug where use_querywould not recursively fetch many-to-one relationships.
- IDOM preloader will now print out the exception stack when failing to import a module.
2.2.0 - 2022-12-28¶
Added¶
- Add options: QueryOptionsparameter touse_queryto allow for configuration of this hook.
Changed¶
- By default, use_querywill recursively prefetch all many-to-many or many-to-one relationships to preventSynchronousOnlyOperationexceptions.
Removed¶
- django_idom.hooks._fetch_lazy_fieldshas been deleted. The equivalent replacement is- django_idom.utils.django_query_postprocessor.
2.1.0 - 2022-11-01¶
Changed¶
- Minimum channelsversion is now4.0.0.
Fixed¶
- Change type hint on view_to_componentcallable to haverequestargument be optional.
- Change type hint on view_to_componentto represent it as a decorator with parenthesis (such as@view_to_component(compatibility=True))
Security¶
- Add note to docs about potential information exposure via view_to_componentwhen usingcompatibility=True.
2.0.1 - 2022-10-18¶
Fixed¶
- Ability to use key=...parameter on all prefabricated components.
2.0.0 - 2022-10-17¶
Added¶
- use_originhook for returning the browser's- location.origin.
Changed¶
- view_to_componentnow returns a- Callable, instead of directly returning a- Component. Check the docs for new usage info.
- use_mutationand- use_querywill now log any query failures.
Fixed¶
- Allow use_mutationto haverefetch=None, as the docs suggest is possible.
- use_querywill now prefetch all fields to prevent- SynchronousOnlyOperationexceptions.
- view_to_component,- django_css, and- django_jstype hints will now display like normal functions.
- IDOM preloader no longer attempts to parse commented out IDOM components.
- Tests are now fully functional on Windows
1.2.0 - 2022-09-19¶
Added¶
- auth_requireddecorator to prevent your components from rendering to unauthenticated users.
- use_queryhook for fetching database values.
- use_mutationhook for modifying database values.
- view_to_componentutility to convert legacy Django views to IDOM components.
Changed¶
- Bumped the minimum IDOM version to 0.40.2
- Testing suite now uses playwrightinstead ofselenium
Fixed¶
- IDOM preloader is no longer sensitive to whitespace within template tags.
1.1.0 - 2022-07-01¶
Added¶
- django_cssand- django_jscomponents to defer loading CSS & JS files until needed.
Changed¶
- Bumped the minimum IDOM version to 0.39.0
1.0.0 - 2022-05-22¶
Added¶
- Django specific hooks! use_websocket,use_scope, anduse_locationare now available within thedjango_idom.hooksmodule.
- Documentation has been placed into a formal docs webpage.
- Logging for when a component fails to import, or if no components were found within Django.
Changed¶
- idom_componenttemplate tag has been renamed to- component
- Bumped the minimum IDOM version to 0.38.0
Removed¶
- websocketparameter for components has been removed. Functionally, it is replaced with- django_idom.hooks.use_websocket.
0.0.5 - 2022-04-04¶
Changed¶
- Bumped the minimum IDOM version to 0.37.2
Fixed¶
- ModuleNotFoundError: No module named idom.core.protocaused by IDOM 0.37.2
0.0.4 - 2022-03-05¶
Changed¶
- Bumped the minimum IDOM version to 0.37.1
0.0.3 - 2022-02-19¶
Changed¶
- Bumped the minimum IDOM version to 0.36.3
0.0.2 - 2022-01-30¶
Added¶
- Ability to declare the HTML class of the top-level component div
- name = ...parameter to IDOM HTTP paths for use with- django.urls.reverse()
- Cache versioning to automatically invalidate old web module files from the cache back-end
- Automatic pre-population of the IDOM component registry
- Type hinting for IdomWebsocket
Changed¶
- Fetching web modules from disk and/or cache is now fully async
- Static files are now contained within a django_idom/parent folder
- Upgraded IDOM to version 0.36.0
- Minimum Django version required is now 4.0
- Minimum Python version required is now 3.8
Removed¶
- IDOM_WEB_MODULES_PATHhas been replaced with Django- include(...)
- IDOM_WS_MAX_RECONNECT_DELAYhas been renamed to- IDOM_WS_MAX_RECONNECT_TIMEOUT
- idom_web_modulescache back-end has been renamed to- idom
Fixed¶
- Increase test timeout values to prevent false positives
- Windows compatibility for building Django-IDOM
Security¶
- Fixed potential directory traversal attack on the IDOM web modules URL
0.0.1 - 2021-08-18¶
Added¶
- Support for IDOM within the Django
  Last update: February 1, 2024  
   Authors: