Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: reactive-python/reactpy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.40.2
Choose a base ref
...
head repository: reactive-python/reactpy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.41.0
Choose a head ref
  • 12 commits
  • 47 files changed
  • 4 contributors

Commits on Sep 18, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    dbd88e2 View commit details

Commits on Oct 3, 2022

  1. Bump vm2 from 3.9.9 to 3.9.11 in /src/client (#814)

    Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.9 to 3.9.11.
    - [Release notes](https://github.com/patriksimek/vm2/releases)
    - [Changelog](https://github.com/patriksimek/vm2/blob/master/CHANGELOG.md)
    - [Commits](patriksimek/vm2@3.9.9...3.9.11)
    
    ---
    updated-dependencies:
    - dependency-name: vm2
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Oct 3, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1254aaa View commit details

Commits on Oct 4, 2022

  1. Update badge image link

    rmorshea authored Oct 4, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f59af55 View commit details

Commits on Oct 5, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6fe9fa2 View commit details

Commits on Oct 7, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d7a71b3 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cba66aa View commit details

Commits on Oct 11, 2022

  1. schedule test once a week rather than one per day

    it seems unnecessary to run this every day. we can up the cadence later if needed
    rmorshea authored Oct 11, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    688a16d View commit details

Commits on Oct 18, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    50e42c0 View commit details

Commits on Oct 30, 2022

  1. add use_connection hook (#823)

    * add use_connection hook
    
    * add changelog entry
    
    * upgrade uvicorn
    
    * fix type annotation
    
    * remove unused imports
    
    * update docstring
    
    * increase type delay
    
    * configure default delay
    rmorshea authored Oct 30, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    64c9e82 View commit details

Commits on Oct 31, 2022

  1. Vite (#824)

    * add use_connection hook
    
    * remove unused imports
    
    * switch to using vite
    
    * fix test
    
    * fix cov
    
    * fix unused imports
    
    * check backend route priorities
    
    * fix tests
    
    * fix warning
    
    * fix asyncio deprectation warning
    
    * fix type annotation
    
    * fix style
    
    * strip url prefix from location
    
    * remove unused imports
    
    * remove default for search
    rmorshea authored Oct 31, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8ff09d2 View commit details

Commits on Nov 2, 2022

  1. define state as a generic named tuple (#827)

    * define state as a generic named tuple
    
    * changelog entry
    rmorshea authored Nov 2, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    77e7f98 View commit details
  2. version 0.41.0

    rmorshea committed Nov 2, 2022
    Copy the full SHA
    d44ab8b View commit details
Showing with 2,597 additions and 8,627 deletions.
  1. +3 −3 .github/workflows/test.yml
  2. +1 −1 README.md
  3. +1 −1 VERSION
  4. +3 −3 docs/source/_custom_js/package-lock.json
  5. +52 −0 docs/source/about/changelog.rst
  6. +2 −2 docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_update.py
  7. +1 −1 noxfile.py
  8. +2 −2 requirements/pkg-extras.txt
  9. +6 −2 src/client/{public → }/index.html
  10. +1,927 −8,178 src/client/package-lock.json
  11. +3 −3 src/client/package.json
  12. +1 −1 src/client/packages/idom-app-react/package.json
  13. +1 −1 src/client/packages/idom-client-react/package.json
  14. +8 −12 src/client/packages/idom-client-react/src/server.js
  15. +0 −11 src/client/snowpack.config.js
  16. +12 −0 src/client/vite.config.js
  17. +6 −2 src/idom/__init__.py
  18. +1 −1 src/idom/_option.py
  19. +1 −1 src/idom/backend/_asgi.py
  20. +7 −0 src/idom/backend/_urls.py
  21. +7 −12 src/idom/backend/default.py
  22. +2 −8 src/idom/backend/fastapi.py
  23. +79 −63 src/idom/backend/flask.py
  24. +26 −0 src/idom/backend/hooks.py
  25. +91 −65 src/idom/backend/sanic.py
  26. +48 −48 src/idom/backend/starlette.py
  27. +47 −50 src/idom/backend/tornado.py
  28. +27 −7 src/idom/backend/types.py
  29. +5 −7 src/idom/backend/utils.py
  30. +4 −4 src/idom/core/component.py
  31. +43 −64 src/idom/core/hooks.py
  32. +3 −3 src/idom/core/layout.py
  33. +19 −1 src/idom/core/types.py
  34. +25 −10 src/idom/testing/display.py
  35. +7 −2 src/idom/types.py
  36. +10 −5 src/idom/utils.py
  37. +3 −2 tests/conftest.py
  38. +60 −10 tests/test_backend/test_common.py
  39. +5 −10 tests/test_backend/test_utils.py
  40. +2 −1 tests/test_client.py
  41. +2 −1 tests/test_core/test_events.py
  42. +18 −1 tests/test_core/test_hooks.py
  43. +2 −11 tests/test_core/test_layout.py
  44. +6 −13 tests/test_html.py
  45. +5 −4 tests/test_widgets.py
  46. +2 −0 tests/tooling/common.py
  47. +11 −0 tests/tooling/hooks.py
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -8,14 +8,14 @@ on:
branches:
- main
schedule:
- cron: "0 0 * * *"
- cron: "0 0 * * 0"

jobs:
python-coverage:
python-exhaustive:
uses: ./.github/workflows/.nox-session.yml
with:
job-name: "python-{0}"
session-name: test_python_suite
session-name: test_python
session-arguments: --maxfail=3
python-environments:
uses: ./.github/workflows/.nox-session.yml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# IDOM &middot; [![Tests](https://github.com/idom-team/idom/workflows/Test/badge.svg?event=push)](https://github.com/idom-team/idom/actions?query=workflow%3ATest) [![PyPI Version](https://img.shields.io/pypi/v/idom.svg)](https://pypi.python.org/pypi/idom) [![License](https://img.shields.io/badge/License-MIT-purple.svg)](https://github.com/idom-team/idom/blob/main/LICENSE)
# IDOM &middot; [![Tests](https://github.com/idom-team/idom/workflows/test/badge.svg)](https://github.com/idom-team/idom/actions?query=workflow%3ATest) [![PyPI Version](https://img.shields.io/pypi/v/idom.svg)](https://pypi.python.org/pypi/idom) [![License](https://img.shields.io/badge/License-MIT-purple.svg)](https://github.com/idom-team/idom/blob/main/LICENSE)

IDOM connects your Python web framework of choice to a ReactJS frontend, allowing you to create **interactive websites without needing JavaScript!**

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.40.2
0.41.0
6 changes: 3 additions & 3 deletions docs/source/_custom_js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions docs/source/about/changelog.rst
Original file line number Diff line number Diff line change
@@ -26,6 +26,58 @@ Unreleased
No changes.


v0.41.0
-------
:octicon:`milestone` *released on 2022-11-01*

**Changed**

- :pull:`823` - The hooks ``use_location`` and ``use_scope`` are no longer
implementation specific and are now available as top-level imports. Instead of each
backend defining these hooks, backends establish a ``ConnectionContext`` with this
information.
- :pull:`824` - IDOM's built-in backend server now expose the following routes:

- ``/_idom/assets/<file-path>``
- ``/_idom/stream/<path>``
- ``/_idom/modules/<file-path>``
- ``/<prefix>/<path>``

This should allow the browser to cache static resources. Even if your ``url_prefix``
is ``/_idom``, your app should still work as expected. Though if you're using
``idom-router``, IDOM's server routes will always take priority.
- :pull:`824` - Backend implementations now strip any URL prefix in the pathname for
``use_location``.
- :pull:`827` - ``use_state`` now returns a named tuple with ``value`` and ``set_value``
fields. This is convenient for adding type annotations if the initial state value is
not the same as the values you might pass to the state setter. Where previously you
might have to do something like:

.. code-block::
value: int | None = None
value, set_value = use_state(value)
Now you can annotate your state using the ``State`` class:

.. code-block::
state: State[int | None] = use_state(None)
# access value and setter
state.value
state.set_value
# can still destructure if you need to
value, set_value = state
**Added**

- :pull:`823` - There is a new ``use_connection`` hook which returns a ``Connection``
object. This ``Connection`` object contains a ``location`` and ``scope``, along with
a ``carrier`` which is unique to each backend implementation.


v0.40.2
-------
:octicon:`milestone` *released on 2022-09-13*
Original file line number Diff line number Diff line change
@@ -28,13 +28,13 @@ def handle_email_change(event):
),
),
html.label(
"First name: ",
"Last name: ",
html.input(
{"value": person["last_name"], "onChange": handle_last_name_change},
),
),
html.label(
"First name: ",
"Email: ",
html.input(
{"value": person["email"], "onChange": handle_email_change},
),
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ def test_python_types(session: Session) -> None:
install_requirements_file(session, "check-types")
install_requirements_file(session, "pkg-deps")
install_requirements_file(session, "pkg-extras")
session.run("mypy", "--strict", "src/idom")
session.run("mypy", "--show-error-codes", "--strict", "src/idom")


@nox.session
4 changes: 2 additions & 2 deletions requirements/pkg-extras.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# extra=starlette
starlette >=0.13.6
uvicorn[standard] >=0.13.4
uvicorn[standard] >=0.19.0

# extra=sanic
sanic >=21
sanic-cors

# extra=fastapi
fastapi >=0.63.0
uvicorn[standard] >=0.13.4
uvicorn[standard] >=0.19.0

# extra=flask
flask
8 changes: 6 additions & 2 deletions src/client/public/index.html → src/client/index.html
Original file line number Diff line number Diff line change
@@ -2,12 +2,16 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="./idom-logo-square-small.svg" type="image/svg+xml" />
<link
rel="icon"
href="public/idom-logo-square-small.svg"
type="image/svg+xml"
/>
<title>IDOM</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="../packages/idom-app-react/src/index.js">
<script type="module">
import { mount } from "idom-app-react";
mount(document.getElementById("app"));
</script>
Loading