Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
95 changes: 55 additions & 40 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,106 +19,121 @@ Don't forget to remove deprecated code on each major release!

## [Unreleased]

### Added

- Support for ReactPy v2.x (beta). The initial URL is now sourced from the ReactPy executor (`use_connection().location`) instead of a JS-side `popstate` effect, removing a redundant network round-trip on first load.

### Changed

- Bump required ReactPy version to `2.x`
- **Breaking:** Bumped minimum ReactPy version to `2.0.0b12`.
- **Breaking:** Migrated to Hatch `src/` layout — the package now lives at `src/reactpy_router/` (previously `reactpy_router/` at the repository root).
- **Breaking:** JavaScript build pipeline switched from `Rollup` (CommonJS) to `Bun` + `TypeScript`. The prebuilt bundle ships at `src/reactpy_router/static/bundle.js`.
- **Breaking:** Top-level re-exports trimmed. `Route`, `MatchedRoute`, `CompiledRoute`, `RouteState`, `ConversionInfo`, `ConverterMapping`, `Resolver`, and `Router` are no longer importable from `reactpy_router`. Import them from `reactpy_router.types` instead.
- **Breaking:** The `link` component no longer accepts the legacy underscore `class_name` attribute — use `className` only.
- **Breaking:** The internal `History` JavaScript callback was renamed from `onHistoryChangeCallback` to `onHistoryPreviousCallback` to reflect that it now fires only on browser history navigation events.
- `@reactpy/client` bumped to `^1.2.0`.
- The `uuid` route converter is now case-insensitive (previously matched only lowercase hex).

### Removed

- `StarletteResolver` and the `simple.py` / `core.py` modules that accompanied it (these were already removed in 2.0.0 in favor of `ReactPyResolver`; this release also drops the old `core.py`/`simple.py` modules).

## [2.0.0] - 2025-06-14

### Added

- Support for custom routers.
- Support for custom routers.

### Changed

- Set maximum ReactPy version to `<2.0.0`.
- Set minimum ReactPy version to `1.1.0`.
- `link` element now calculates URL changes using the client.
- Refactoring related to `reactpy>=1.1.0` changes.
- Changed ReactPy-Router's method of waiting for the initial URL to be deterministic.
- Rename `StarletteResolver` to `ReactPyResolver`.
- Set maximum ReactPy version to `<2.0.0`.
- Set minimum ReactPy version to `1.1.0`.
- `link` element now calculates URL changes using the client.
- Refactoring related to `reactpy>=1.1.0` changes.
- Changed ReactPy-Router's method of waiting for the initial URL to be deterministic.
- Rename `StarletteResolver` to `ReactPyResolver`.

### Removed

- `StarletteResolver` is removed in favor of `ReactPyResolver`.
- `StarletteResolver` is removed in favor of `ReactPyResolver`.

### Fixed

- Fixed bug where `link` element sometimes would sometimes not retrieve the correct `href` attribute.
- Fixed bug where `link` element sometimes would sometimes not retrieve the correct `href` attribute.

## [1.0.3] - 2024-11-21

### Fixed

- Fix behavior where the page would be rendered twice on initial load
- Fix behavior where the page would be rendered twice on initial load

## [1.0.2] - 2024-10-24

### Fixed

- Fix python `wheel` missing `bundle.js` file.
- Fix python `wheel` missing `bundle.js` file.

## [1.0.1] - 2024-10-24

### Changed

- JavaScript bundle is now created using [`Bun`](https://bun.sh/).
- Python package is now built using [`Hatch`](https://hatch.pypa.io/).
- JavaScript bundle is now created using [`Bun`](https://bun.sh/).
- Python package is now built using [`Hatch`](https://hatch.pypa.io/).

## [1.0.0] - 2024-10-18

### Changed

- Rename `use_query` to `use_search_params`.
- Rename `simple.router` to `browser_router`.
- Rename `SimpleResolver` to `StarletteResolver`.
- Rename `CONVERSION_TYPES` to `CONVERTERS`.
- Change "Match Any" syntax from a star `*` to `{name:any}`.
- Rewrite `reactpy_router.link` to be a server-side component.
- Simplified top-level exports that are available within `reactpy_router.*`.
- Rename `use_query` to `use_search_params`.
- Rename `simple.router` to `browser_router`.
- Rename `SimpleResolver` to `StarletteResolver`.
- Rename `CONVERSION_TYPES` to `CONVERTERS`.
- Change "Match Any" syntax from a star `*` to `{name:any}`.
- Rewrite `reactpy_router.link` to be a server-side component.
- Simplified top-level exports that are available within `reactpy_router.*`.

### Added

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

### Fixed

- Fix bug where changing routes could cause render failure due to key identity.
- Fix bug where "Match Any" pattern wouldn't work when used in complex or nested paths.
- Fix bug where `link` elements could not have `@component` type children.
- Fix bug where the ReactPy would not detect the current URL after a reconnection.
- Fix bug where `ctrl` + `click` on a `link` element would not open in a new tab.
- Fix test suite on Windows machines.
- Fix bug where changing routes could cause render failure due to key identity.
- Fix bug where "Match Any" pattern wouldn't work when used in complex or nested paths.
- Fix bug where `link` elements could not have `@component` type children.
- Fix bug where the ReactPy would not detect the current URL after a reconnection.
- Fix bug where `ctrl` + `click` on a `link` element would not open in a new tab.
- Fix test suite on Windows machines.

## [0.1.1] - 2023-12-13

### Fixed

- Fixed relative navigation.
- Fixed relative navigation.

## [0.1.0] - 2023-06-16

### Added

- Automatically handle client-side history changes.
- Automatically handle client-side history changes.

## [0.0.1] - 2023-05-10

### Added

- Add robust lint/testing.
- Upgrade `reactpy`.
- More robust routing with `starlette`.
- Initial draft of router compiler.
- Add robust lint/testing.
- Upgrade `reactpy`.
- More robust routing with `starlette`.
- Initial draft of router compiler.

### Changed

- Rename `configure` to `create_router`.
- Rename from `idom-router` to `reactpy-router`.
- Rename `configure` to `create_router`.
- Rename from `idom-router` to `reactpy-router`.

[Unreleased]: https://github.com/reactive-python/reactpy-router/compare/2.0.0...HEAD
[2.0.0]: https://github.com/reactive-python/reactpy-router/compare/1.0.3...2.0.0
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# <img src="https://raw.githubusercontent.com/reactive-python/reactpy/main/branding/svg/reactpy-logo-square.svg" align="left" height="45"/> ReactPy Router

<p>
<a href="https://github.com/reactive-python/reactpy-router/actions/workflows/test-python.yml">
<img src="https://github.com/reactive-python/reactpy-router/actions/workflows/test-python.yml/badge.svg">
<a href="https://github.com/reactive-python/reactpy-router/actions/workflows/check.yml">
<img src="https://github.com/reactive-python/reactpy-router/actions/workflows/check.yml/badge.svg">
</a>
<a href="https://pypi.python.org/pypi/reactpy-router">
<img src="https://img.shields.io/pypi/v/reactpy-router.svg?label=PyPI">
Expand Down
3 changes: 2 additions & 1 deletion docs/src/about/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
If you plan to make code changes to this repository, you will need to install the following dependencies first:

- [Git](https://git-scm.com/downloads)
- [Python 3.9+](https://www.python.org/downloads/)
- [Python 3.11+](https://www.python.org/downloads/)
- [Hatch](https://hatch.pypa.io/latest/)
- [Bun](https://bun.sh/)

Expand Down Expand Up @@ -41,6 +41,7 @@ By utilizing `hatch`, the following commands are available to manage the develop
| `hatch fmt --check` | Run all linters and formatters, but do not save fixes to the disk |
| `hatch fmt --linter` | Run only linters |
| `hatch fmt --formatter` | Run only formatters |
| `hatch run javascript:build` | Manually re-build the JavaScript bundle |
| `hatch run javascript:check` | Run the JavaScript linter/formatter |
| `hatch run javascript:fix` | Run the JavaScript linter/formatter and write fixes to disk |
| `hatch run python:type_check` | Run the Python type checker |
Expand Down
Loading
Loading