Skip to content

Rewrite ReactPy-Router #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 62 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
69598ef
Bump workflows
Archmonger Feb 22, 2024
c86f37b
use_query -> use_search_params
Archmonger Jun 25, 2024
ec1b633
use_params docstring
Archmonger Jun 25, 2024
332ca75
better error for route state
Archmonger Jun 25, 2024
189b484
simple.router -> browser_router
Archmonger Jun 25, 2024
6557000
Allow multi-component routes
Archmonger Jun 25, 2024
9e72ca0
Fix potential key identity bug of router component children
Archmonger Jun 25, 2024
7a242e1
Add slug conversion type
Archmonger Jun 25, 2024
e92842f
SimpleResolver -> Resolver, CONVERSION_TYPES -> CONVERTERS, file refa…
Archmonger Jun 25, 2024
f46d9d1
allow customizable match_any_identifier
Archmonger Jun 25, 2024
b8efe54
attempt to fix workflows
Archmonger Jun 25, 2024
bee18a5
server-side link component
Archmonger Jun 25, 2024
de53beb
fix a handful of test errors
Archmonger Jun 26, 2024
f77f052
change js output directory
Archmonger Jun 26, 2024
518d226
fix py3.9 type hints
Archmonger Jun 26, 2024
e96a512
Change star pattern to `{NAME:any}`
Archmonger Jun 28, 2024
03b8f2c
Fix router in local environment
Archmonger Oct 5, 2024
37760bb
Fix link component
Archmonger Oct 5, 2024
ee616d0
Fix route parameters
Archmonger Oct 5, 2024
169e2dc
remove black from workflow
Archmonger Oct 5, 2024
5ffc34f
Format with ruff + prettier
Archmonger Oct 5, 2024
8b057b2
Fix github actions
Archmonger Oct 5, 2024
db9e074
Fix use_search_params
Archmonger Oct 5, 2024
7947e91
Clean up use-params example
Archmonger Oct 5, 2024
d9a943a
Remove select from top level router
Archmonger Oct 5, 2024
94e9de5
docs tweaks
Archmonger Oct 6, 2024
afb97c8
js tweaks
Archmonger Oct 6, 2024
78c7c49
Refactor some more docs
Archmonger Oct 6, 2024
1b8031b
Better mkdocstrings
Archmonger Oct 6, 2024
f52aaa3
Remove core.py
Archmonger Oct 6, 2024
bad417f
cleaner example for use params
Archmonger Oct 6, 2024
155079b
ignore link click type
Archmonger Oct 6, 2024
c7d19f6
Move event loop policy to dedicated fixture
Archmonger Oct 6, 2024
d7184b1
Fix resolver tests
Archmonger Oct 6, 2024
6857f7a
fix type errors
Archmonger Oct 6, 2024
fa0f307
use link class instead of ID
Archmonger Oct 6, 2024
1723f8d
prefix uuid with a string
Archmonger Oct 6, 2024
b67101a
add test for link search params
Archmonger Oct 6, 2024
c38ac3b
Remove coverage from some unneeded places
Archmonger Oct 6, 2024
f57b63b
Fix browser history
Archmonger Oct 6, 2024
88d1f46
use server side prevent default
Archmonger Oct 6, 2024
a78a5b1
Server side handling of relative URLs
Archmonger Oct 6, 2024
97a715c
Add test for class name
Archmonger Oct 7, 2024
4633ab2
fix last coverage hit
Archmonger Oct 7, 2024
70a7ea0
self review
Archmonger Oct 11, 2024
98ac776
Add click delay (attempt to fix flakey tests)
Archmonger Oct 11, 2024
9fc92ce
Add changelog
Archmonger Oct 11, 2024
0e87d27
Increase delay
Archmonger Oct 11, 2024
0469615
Remove unneeded homepage stuff
Archmonger Oct 12, 2024
1d33c65
Use ReactJS event naming conventions
Archmonger Oct 12, 2024
25e440f
Self review: Use JS component as background listener for link clicks
Archmonger Oct 12, 2024
8e9b6a8
use attributes dict for all link parameters
Archmonger Oct 12, 2024
05e7012
Allow reconnections to re-obtain the current URL
Archmonger Oct 12, 2024
afa8c83
Add new changelog item
Archmonger Oct 12, 2024
972c275
Revert to dumb script for links
Archmonger Oct 12, 2024
ff65483
no cov on exception
Archmonger Oct 12, 2024
7e10dd4
fix test
Archmonger Oct 12, 2024
78b5a95
Fix spelling
Archmonger Oct 12, 2024
2d88133
Update src/reactpy_router/resolvers.py
Archmonger Oct 13, 2024
b1192c5
use unpacking instead of list
Archmonger Oct 14, 2024
9d18fc9
safer query string parsing
Archmonger Oct 14, 2024
df4c088
Remove unused import
Archmonger Oct 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove black from workflow
  • Loading branch information
Archmonger committed Oct 5, 2024
commit 169e2dc3e4faaa3b30a85199b5770a1344fefacf
63 changes: 31 additions & 32 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
name: Test

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * *"
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * *"

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Check docs build
run: |
pip install -r requirements/build-docs.txt
linkcheckMarkdown docs/ -v -r
linkcheckMarkdown README.md -v -r
linkcheckMarkdown CHANGELOG.md -v -r
cd docs
mkdocs build --strict
- name: Check docs examples
run: |
pip install -r requirements/check-types.txt
pip install -r requirements/check-style.txt
mypy --show-error-codes docs/examples/python/
black docs/examples/python/ --check
ruff check docs/examples/python/
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Check docs build
run: |
pip install -r requirements/build-docs.txt
linkcheckMarkdown docs/ -v -r
linkcheckMarkdown README.md -v -r
linkcheckMarkdown CHANGELOG.md -v -r
cd docs
mkdocs build --strict
- name: Check docs examples
run: |
pip install -r requirements/check-types.txt
pip install -r requirements/check-style.txt
mypy --show-error-codes docs/examples/python/
ruff check docs/examples/python/
18 changes: 9 additions & 9 deletions docs/src/learn/routers-routes-and-links.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ The syntax for declaring routes with the [`browser_router`][src.reactpy_router.b

In this case, `#!python param` is the name of the route parameter and the optionally declared `#!python type` specifies what kind of parameter it is. The available parameter types and what patterns they match are are:

| Type | Pattern |
| --- | --- |
| `#!python int` | `#!python \d+` |
| `#!python str` (default) | `#!python [^/]+` |
| `#!python uuid` | `#!python [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}` |
| `#!python slug` | `#!python [-a-zA-Z0-9_]+` |
| `#!python path` | `#!python .+` |
| `#!python float` | `#!python \d+(\.\d+)?` |
| `#!python any` | `#!python .*` |
| Type | Pattern |
| ------------------------ | ----------------------------------------------------------------------- |
| `#!python str` (default) | `#!python [^/]+` |
| `#!python int` | `#!python \d+` |
| `#!python float` | `#!python \d+(\.\d+)?` |
| `#!python uuid` | `#!python [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}` |
| `#!python slug` | `#!python [-a-zA-Z0-9_]+` |
| `#!python path` | `#!python .+` |
| `#!python any` | `#!python .*` |

So in practice these each might look like:

Expand Down
1 change: 0 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def test_types(session: Session) -> None:
@session(tags=["test"])
def test_style(session: Session) -> None:
install_requirements_file(session, "check-style")
session.run("black", ".", "--check")
session.run("ruff", "check", ".")


Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ warn_redundant_casts = true
warn_unused_ignores = true
check_untyped_defs = true

[tool.ruff.isort]
known-first-party = ["src", "tests"]

[tool.ruff]
ignore = ["E501"]
lint.ignore = ["E501"]
lint.isort.known-first-party = ["src", "tests"]
extend-exclude = [".venv/*", ".eggs/*", ".nox/*", "build/*"]
line-length = 120

Expand Down
1 change: 0 additions & 1 deletion requirements/check-style.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
black >=23,<24
ruff