Skip to content

Commit 2f9be01

Browse files
authored
New Navigate component (#34)
- Create `navigate` component - Better key value identity of route components - Remove initial URL handling from the `History` component due to reactpy rendering bugs - This is now handled by a new `FirstLoad` element. - Fix docs publishing workflow - Add arg descriptions to all public functions - Better styling for autodocs. - Support Python 3.12
1 parent 0c04073 commit 2f9be01

File tree

22 files changed

+486
-162
lines changed

22 files changed

+486
-162
lines changed

.github/workflows/test-docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
pip install -r requirements/build-docs.txt
2626
pip install -r requirements/check-types.txt
2727
pip install -r requirements/check-style.txt
28-
pip install -e .
2928
- name: Check docs build
3029
run: |
3130
linkcheckMarkdown docs/ -v -r

.github/workflows/test-src.yaml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
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.9", "3.10", "3.11"]
19-
steps:
20-
- uses: actions/checkout@v4
21-
- name: Use Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v5
23-
with:
24-
python-version: ${{ matrix.python-version }}
25-
- name: Install Python Dependencies
26-
run: pip install -r requirements/test-run.txt
27-
- name: Run Tests
28-
run: nox -t test
29-
coverage:
30-
runs-on: ubuntu-latest
31-
steps:
32-
- uses: actions/checkout@v4
33-
- name: Use Latest Python
34-
uses: actions/setup-python@v5
35-
with:
36-
python-version: "3.10"
37-
- name: Install Python Dependencies
38-
run: pip install -r requirements/test-run.txt
39-
- name: Run Tests
40-
run: nox -t test -- --coverage
14+
source:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: ["3.9", "3.10", "3.11", "3.12"]
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Use Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install Python Dependencies
26+
run: pip install -r requirements/test-run.txt
27+
- name: Run Tests
28+
run: nox -t test
29+
coverage:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Use Latest Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: "3.x"
37+
- name: Install Python Dependencies
38+
run: pip install -r requirements/test-run.txt
39+
- name: Run Tests
40+
run: nox -t test -- --coverage

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@ Using the following categories, list your changes in this order:
4242
- Rename `CONVERSION_TYPES` to `CONVERTERS`.
4343
- Change "Match Any" syntax from a star `*` to `{name:any}`.
4444
- Rewrite `reactpy_router.link` to be a server-side component.
45-
- Simplified top-level exports within `reactpy_router`.
45+
- Simplified top-level exports that are available within `reactpy_router.*`.
4646

4747
### Added
4848

49-
- New error for ReactPy router elements being used outside router context.
50-
- Configurable/inheritable `Resolver` base class.
5149
- Add debug log message for when there are no router matches.
5250
- Add slug as a supported type.
51+
- Add `reactpy_router.navigate` component that will force the client to navigate to a new URL (when rendered).
52+
- New error for ReactPy router elements being used outside router context.
53+
- Configurable/inheritable `Resolver` base class.
5354

5455
### Fixed
5556

@@ -58,6 +59,7 @@ Using the following categories, list your changes in this order:
5859
- Fix bug where `link` elements could not have `@component` type children.
5960
- Fix bug where the ReactPy would not detect the current URL after a reconnection.
6061
- Fix bug where `ctrl` + `click` on a `link` element would not open in a new tab.
62+
- Fix test suite on Windows machines.
6163

6264
## [0.1.1] - 2023-12-13
6365

docs/examples/python/basic-routing-more-routes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html, run
2+
23
from reactpy_router import browser_router, route
34

45

docs/examples/python/basic-routing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from reactpy import component, html, run
2+
23
from reactpy_router import browser_router, route
34

45

docs/mkdocs.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ nav:
88
- Hooks: learn/hooks.md
99
- Creating a Custom Router 🚧: learn/custom-router.md
1010
- Reference:
11-
- Router Components: reference/router.md
11+
- Routers: reference/routers.md
1212
- Components: reference/components.md
1313
- Hooks: reference/hooks.md
1414
- Types: reference/types.md
@@ -96,8 +96,21 @@ plugins:
9696
- https://reactpy.dev/docs/objects.inv
9797
- https://installer.readthedocs.io/en/stable/objects.inv
9898
options:
99-
show_bases: false
99+
signature_crossrefs: true
100+
scoped_crossrefs: true
101+
relative_crossrefs: true
102+
modernize_annotations: true
103+
unwrap_annotated: true
104+
find_stubs_package: true
100105
show_root_members_full_path: true
106+
show_bases: false
107+
show_source: false
108+
show_root_toc_entry: false
109+
show_labels: false
110+
show_symbol_type_toc: true
111+
show_symbol_type_heading: true
112+
show_object_full_path: true
113+
heading_level: 3
101114
extra:
102115
generator: false
103116
version:

docs/src/dictionary.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ misconfiguration
3737
misconfigurations
3838
backhaul
3939
sublicense
40+
contravariant

docs/src/reference/components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
::: reactpy_router
22

33
options:
4-
members: ["route", "link"]
4+
members: ["route", "link", "navigate"]
File renamed without changes.

docs/src/reference/types.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
::: reactpy_router.types
2+
3+
options:
4+
summary: true
5+
docstring_section_style: "list"

0 commit comments

Comments
 (0)