Skip to content

Commit ce9d65e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into use-db-for-clean-tracking
2 parents af98d44 + 01946d5 commit ce9d65e

39 files changed

+979
-170
lines changed

.github/workflows/test-docs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ jobs:
3333
pip install -r requirements/check-style.txt
3434
mypy --show-error-codes docs/python/
3535
black docs/python/ --check
36-
isort docs/python/ --check-only
37-
flake8 docs/python/
36+
ruff check docs/python/

.github/workflows/test-src.yml

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
name: Test
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
10-
schedule:
11-
- cron: "0 0 * * *"
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: "0 0 * * *"
1212

1313
jobs:
14-
source:
15-
runs-on: ubuntu-latest
16-
strategy:
17-
matrix:
18-
python-version: ["3.8", "3.9", "3.10"]
19-
steps:
20-
- uses: actions/checkout@v3
21-
- uses: nanasess/setup-chromedriver@master
22-
- uses: actions/setup-node@v3
23-
with:
24-
node-version: "14"
25-
- name: Use Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v4
27-
with:
28-
python-version: ${{ matrix.python-version }}
29-
- name: Install Python Dependencies
30-
run: pip install -r requirements/test-run.txt
31-
- name: Run Tests
32-
run: |
33-
npm install -g npm@latest
34-
npm --version
35-
nox -s test
14+
source:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: ["3.9", "3.10", "3.11"]
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: actions/setup-node@v3
22+
with:
23+
node-version: "14.x"
24+
- name: Use Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install Python Dependencies
29+
run: pip install -r requirements/test-run.txt
30+
- name: Run Tests
31+
run: |
32+
npm install -g npm@latest
33+
npm --version
34+
nox -s test

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,16 @@ Using the following categories, list your changes in this order:
3434

3535
## [Unreleased]
3636

37+
### Added
38+
39+
- Added system checks for a variety of common ReactPy misconfigurations.
40+
- `REACTPY_BACKHAUL_THREAD` setting to enable/disable threading behavior.
41+
3742
### Changed
3843

44+
- If using `settings.py:REACTPY_DATABASE`, `reactpy_django.database.Router` must now be registered in `settings.py:DATABASE_ROUTERS`.
45+
- By default, ReactPy will now use a backhaul thread to increase performance.
46+
- Minimum Python version required is now `3.9`
3947
- A thread-safe cache is no longer required.
4048

4149
## [3.2.1] - 2023-06-29

docs/python/configure-urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33

44
urlpatterns = [
5-
path("reactpy/", include("reactpy_django.http.urls")),
65
...,
6+
path("reactpy/", include("reactpy_django.http.urls")),
77
]

docs/python/settings.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
1+
# Cache used to store ReactPy web modules.
12
# ReactPy benefits from a fast, well indexed cache.
3+
# We recommend redis or python-diskcache.
24
REACTPY_CACHE = "default"
35

6+
# Database ReactPy uses to store session data.
47
# ReactPy requires a multiprocessing-safe and thread-safe database.
8+
# DATABASE_ROUTERS is mandatory if REACTPY_DATABASE is configured.
59
REACTPY_DATABASE = "default"
10+
DATABASE_ROUTERS = ["reactpy_django.database.Router", ...]
611

712
# Maximum seconds between reconnection attempts before giving up.
813
# Use `0` to prevent component reconnection.
914
REACTPY_RECONNECT_MAX = 259200
1015

11-
# The URL for ReactPy to serve the component rendering websocket
16+
# The URL for ReactPy to serve the component rendering websocket.
1217
REACTPY_WEBSOCKET_URL = "reactpy/"
1318

14-
# Dotted path to the default `reactpy_django.hooks.use_query` postprocessor function, or `None`
19+
# Dotted path to the default `reactpy_django.hooks.use_query` postprocessor function,
20+
# or `None`.
1521
REACTPY_DEFAULT_QUERY_POSTPROCESSOR = "reactpy_django.utils.django_query_postprocessor"
1622

17-
# Dotted path to the Django authentication backend to use for ReactPy components
23+
# Dotted path to the Django authentication backend to use for ReactPy components.
1824
# This is only needed if:
1925
# 1. You are using `AuthMiddlewareStack` and...
2026
# 2. You are using Django's `AUTHENTICATION_BACKENDS` setting and...
2127
# 3. Your Django user model does not define a `backend` attribute
22-
REACTPY_AUTH_BACKEND = None
28+
REACTPY_AUTH_BACKEND = "django.contrib.auth.backends.ModelBackend"
29+
30+
# Whether to enable rendering ReactPy via a dedicated backhaul thread
31+
# This allows the webserver to process traffic while during ReactPy rendering
32+
REACTPY_BACKHAUL_THREAD = True

docs/src/contribute/code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
If you plan to make code changes to this repository, you will need to install the following dependencies first:
1414

15-
- [Python 3.8+](https://www.python.org/downloads/)
15+
- [Python 3.9+](https://www.python.org/downloads/)
1616
- [Git](https://git-scm.com/downloads)
1717
- [NPM](https://docs.npmjs.com/try-the-latest-stable-version-of-npm) for installing and managing Javascript
1818

docs/src/contribute/docs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
If you plan to make changes to this documentation, you will need to install the following dependencies first:
1010

11-
- [Python 3.8+](https://www.python.org/downloads/)
11+
- [Python 3.9+](https://www.python.org/downloads/)
1212
- [Git](https://git-scm.com/downloads)
1313

1414
Once done, you should clone this repository:

docs/src/contribute/running-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This repository uses [Nox](https://nox.thea.codes/en/stable/) to run tests. For
1010

1111
If you plan to run tests, you will need to install the following dependencies first:
1212

13-
- [Python 3.8+](https://www.python.org/downloads/)
13+
- [Python 3.9+](https://www.python.org/downloads/)
1414
- [Git](https://git-scm.com/downloads)
1515

1616
Once done, you should clone this repository:

docs/src/dictionary.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ backends
3535
backend
3636
frontend
3737
frontends
38+
misconfiguration
39+
misconfigurations
40+
backhaul

docs/src/get-started/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Register ReactPy's Websocket using `REACTPY_WEBSOCKET_PATH`.
7676

7777
1. Access the `User` that is currently logged in
7878
2. Login or logout the current `User`
79-
3. Access Django's `Sesssion` object
79+
3. Access Django's `Session` object
8080

8181
In these situations will need to ensure you are using `AuthMiddlewareStack` and/or `SessionMiddlewareStack`.
8282

0 commit comments

Comments
 (0)