diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index efa7d4918..21f192233 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Start a Discussion
- url: https://github.com/idom-team/idom/discussions
+ url: https://github.com/reactive-python/reactpy/discussions
about: Report issues, request features, ask questions, and share ideas
diff --git a/.github/workflows/.nox-session.yml b/.github/workflows/.nox-session.yml
index 8f68188cc..9cf5f645b 100644
--- a/.github/workflows/.nox-session.yml
+++ b/.github/workflows/.nox-session.yml
@@ -3,10 +3,10 @@ name: Nox Session
on:
workflow_call:
inputs:
- session-name:
+ nox-args:
required: true
type: string
- session-arguments:
+ session-args:
required: false
type: string
runs-on-array:
@@ -45,4 +45,4 @@ jobs:
run: pip install -r requirements/nox-deps.txt
- name: Run Tests
env: { "CI": "true" }
- run: nox -s ${{ inputs.session-name }} --stop-on-first-error -- ${{ inputs.session-arguments }}
+ run: nox ${{ inputs.nox-args }} --stop-on-first-error -- ${{ inputs.session-args }}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 673bf9b32..7779049b8 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -15,22 +15,22 @@ jobs:
uses: ./.github/workflows/.nox-session.yml
with:
job-name: "python-{0}"
- session-name: test_python
- session-arguments: --maxfail=3
+ nox-args: "-t check-python"
+ session-args: "--pytest --maxfail=3 --reruns 3"
python-environments:
uses: ./.github/workflows/.nox-session.yml
with:
- session-name: test_python_suite
- session-arguments: --maxfail=3 --no-cov
+ nox-args: "-s check-python-tests"
+ session-args: "--no-cov --pytest --maxfail=3 --reruns 3"
runs-on-array: '["ubuntu-latest", "macos-latest", "windows-latest"]'
python-version-array: '["3.7", "3.8", "3.9", "3.10", "3.11"]'
docs:
uses: ./.github/workflows/.nox-session.yml
with:
job-name: "python-{0}"
- session-name: test_docs
+ nox-args: "-s check-docs"
javascript:
uses: ./.github/workflows/.nox-session.yml
with:
job-name: "{1}"
- session-name: test_javascript
+ nox-args: "-t check-javascript"
diff --git a/.gitignore b/.gitignore
index 50febabbe..652e5015b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,5 @@
# --- Build Artifacts ---
-src/idom/_client
+src/reactpy/_client
# --- Jupyter ---
*.ipynb_checkpoints
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index b47a49829..9a67422d5 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -9,6 +9,6 @@ repos:
- id: isort
name: isort
- repo: https://github.com/pre-commit/mirrors-prettier
- rev: v2.7.1
+ rev: v3.0.0-alpha.4
hooks:
- id: prettier
diff --git a/MANIFEST.in b/MANIFEST.in
index b49a2df3d..b989938fa 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,3 +1,3 @@
-recursive-include src/idom/_client *
-recursive-include src/idom/web/templates *
-include src/idom/py.typed
+recursive-include src/reactpy/_client *
+recursive-include src/reactpy/web/templates *
+include src/reactpy/py.typed
diff --git a/README.md b/README.md
index b6304e748..a9a54e963 100644
--- a/README.md
+++ b/README.md
@@ -1,24 +1,40 @@
-# IDOM · [](https://github.com/idom-team/idom/actions?query=workflow%3ATest) [](https://pypi.python.org/pypi/idom) [](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!**
-
-Following ReactJS styling, web elements are combined into [reusable "components"](https://idom-docs.herokuapp.com/docs/guides/creating-interfaces/your-first-components/index.html#parametrizing-components). These components can utilize [hooks](https://idom-docs.herokuapp.com/docs/reference/hooks-api.html) and [events](https://idom-docs.herokuapp.com/docs/guides/adding-interactivity/responding-to-events/index.html#async-event-handlers) to create infinitely complex web pages.
-
-When needed, IDOM can [use components directly from NPM](https://idom-docs.herokuapp.com/docs/guides/escape-hatches/javascript-components.html#dynamically-loaded-components). For additional flexibility, components can also be [fully developed in JavaScript](https://idom-docs.herokuapp.com/docs/guides/escape-hatches/javascript-components.html#custom-javascript-components).
-
-Any Python web framework with Websockets can support IDOM. See below for what frameworks are supported out of the box.
-
-| Supported Frameworks | Supported Frameworks (External) |
-| --- | --- |
-| [`Flask`, `FastAPI`, `Sanic`, `Tornado`](https://idom-docs.herokuapp.com/docs/guides/getting-started/installing-idom.html#officially-supported-servers) | [`Django`](https://github.com/idom-team/django-idom), [`Plotly-Dash`](https://github.com/idom-team/idom-dash), [`Jupyter`](https://github.com/idom-team/idom-jupyter) |
-
+# ReactPy · [](https://github.com/reactive-python/reactpy/actions?query=workflow%3ATest) [](https://pypi.python.org/pypi/reactpy) [](https://github.com/reactive-python/reactpy/blob/main/LICENSE)
+
+ReactPy is a library for building user interfaces in Python without Javascript. ReactPy
+interfaces are made from components which look and behave similarly to this found in
+[ReactJS](https://reactjs.org/). Designed with simplicity in mind, ReactPy can be used
+by those without web development experience while also being powerful enough to grow
+with your ambitions.
+
+
# At a Glance
-To get a rough idea of how to write apps in IDOM, take a look at this tiny _Hello World_ application.
+To get a rough idea of how to write apps in ReactPy, take a look at this tiny _Hello World_ application.
```python
-from idom import component, html, run
+from reactpy import component, html, run
@component
def HelloWorld():
@@ -31,8 +47,8 @@ run(HelloWorld)
Follow the links below to find out more about this project.
-- [Try it Now](https://mybinder.org/v2/gh/idom-team/idom-jupyter/main?urlpath=lab/tree/notebooks/introduction.ipynb) - check out IDOM in a Jupyter Notebook.
-- [Documentation](https://idom-docs.herokuapp.com/) - learn how to install, run, and use IDOM.
-- [Community Forum](https://github.com/idom-team/idom/discussions) - ask questions, share ideas, and show off projects.
-- [Contributor Guide](https://idom-docs.herokuapp.com/docs/developing-idom/contributor-guide.html) - see how you can help develop this project.
-- [Code of Conduct](https://github.com/idom-team/idom/blob/main/CODE_OF_CONDUCT.md) - standards for interacting with this community.
+- [Try it Now](https://mybinder.org/v2/gh/reactive-python/reactpy-jupyter/main?urlpath=lab/tree/notebooks/introduction.ipynb) - check out ReactPy in a Jupyter Notebook.
+- [Documentation](https://reactpy-docs.herokuapp.com/) - learn how to install, run, and use ReactPy.
+- [Community Forum](https://github.com/reactive-python/reactpy/discussions) - ask questions, share ideas, and show off projects.
+- [Contributor Guide](https://reactpy-docs.herokuapp.com/docs/developing-reactpy/contributor-guide.html) - see how you can help develop this project.
+- [Code of Conduct](https://github.com/reactive-python/reactpy/blob/main/CODE_OF_CONDUCT.md) - standards for interacting with this community.
diff --git a/branding/ico/idom-logo-black-square-small.ico b/branding/ico/idom-logo-black-square-small.ico
deleted file mode 100644
index 7005d2938..000000000
Binary files a/branding/ico/idom-logo-black-square-small.ico and /dev/null differ
diff --git a/branding/ico/idom-logo-white-square-small.ico b/branding/ico/idom-logo-white-square-small.ico
deleted file mode 100644
index 6a5c139fb..000000000
Binary files a/branding/ico/idom-logo-white-square-small.ico and /dev/null differ
diff --git a/branding/png/idom-logo-black-square-small.png b/branding/png/idom-logo-black-square-small.png
deleted file mode 100644
index 7971eaa68..000000000
Binary files a/branding/png/idom-logo-black-square-small.png and /dev/null differ
diff --git a/branding/png/idom-logo-black-square.png b/branding/png/idom-logo-black-square.png
deleted file mode 100644
index 049f6fd55..000000000
Binary files a/branding/png/idom-logo-black-square.png and /dev/null differ
diff --git a/branding/png/idom-logo-black.png b/branding/png/idom-logo-black.png
deleted file mode 100644
index 9a78e48fc..000000000
Binary files a/branding/png/idom-logo-black.png and /dev/null differ
diff --git a/branding/png/idom-logo-white-square-small.png b/branding/png/idom-logo-white-square-small.png
deleted file mode 100644
index 957c58bfa..000000000
Binary files a/branding/png/idom-logo-white-square-small.png and /dev/null differ
diff --git a/branding/png/idom-logo-white-square.png b/branding/png/idom-logo-white-square.png
deleted file mode 100644
index f4dbb4db1..000000000
Binary files a/branding/png/idom-logo-white-square.png and /dev/null differ
diff --git a/branding/png/idom-logo-white.png b/branding/png/idom-logo-white.png
deleted file mode 100644
index 2ef265474..000000000
Binary files a/branding/png/idom-logo-white.png and /dev/null differ
diff --git a/branding/reactpy-logo-padded.png b/branding/reactpy-logo-padded.png
new file mode 100644
index 000000000..46b8b8a07
Binary files /dev/null and b/branding/reactpy-logo-padded.png differ
diff --git a/branding/reactpy-logo-padded.svg b/branding/reactpy-logo-padded.svg
new file mode 100644
index 000000000..601707bce
--- /dev/null
+++ b/branding/reactpy-logo-padded.svg
@@ -0,0 +1,159 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/branding/reactpy-logo-wide.svg b/branding/reactpy-logo-wide.svg
new file mode 100644
index 000000000..d57a85606
--- /dev/null
+++ b/branding/reactpy-logo-wide.svg
@@ -0,0 +1,169 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ReactPy
+
diff --git a/branding/reactpy-logo.ico b/branding/reactpy-logo.ico
new file mode 100644
index 000000000..62be5f5ba
Binary files /dev/null and b/branding/reactpy-logo.ico differ
diff --git a/branding/reactpy-logo.svg b/branding/reactpy-logo.svg
new file mode 100644
index 000000000..312fb87a5
--- /dev/null
+++ b/branding/reactpy-logo.svg
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/branding/svg/idom-logo-backed-square.svg b/branding/svg/idom-logo-backed-square.svg
deleted file mode 100644
index 9e34b6808..000000000
--- a/branding/svg/idom-logo-backed-square.svg
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- image/svg+xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branding/svg/idom-logo-backed.svg b/branding/svg/idom-logo-backed.svg
deleted file mode 100644
index 290fc7ed0..000000000
--- a/branding/svg/idom-logo-backed.svg
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- image/svg+xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branding/svg/idom-logo-square-small.svg b/branding/svg/idom-logo-square-small.svg
deleted file mode 100644
index eb36c7b11..000000000
--- a/branding/svg/idom-logo-square-small.svg
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- image/svg+xml
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branding/svg/idom-logo-square.svg b/branding/svg/idom-logo-square.svg
deleted file mode 100644
index 354f961e4..000000000
--- a/branding/svg/idom-logo-square.svg
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- image/svg+xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branding/svg/idom-logo.svg b/branding/svg/idom-logo.svg
deleted file mode 100644
index ffcee8d96..000000000
--- a/branding/svg/idom-logo.svg
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- image/svg+xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/Dockerfile b/docs/Dockerfile
index 5cc8979af..12e133d2c 100644
--- a/docs/Dockerfile
+++ b/docs/Dockerfile
@@ -15,7 +15,7 @@ RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN pip install --upgrade pip
-# Install IDOM
+# Install ReactPy
# ------------
COPY requirements ./requirements
RUN pip install -r requirements/build-docs.txt
@@ -44,6 +44,6 @@ RUN sphinx-build -v -W -b html docs/source docs/build
# Define Entrypoint
# -----------------
ENV PORT 5000
-ENV IDOM_DEBUG_MODE=1
-ENV IDOM_CHECK_VDOM_SPEC=0
+ENV REACTPY_DEBUG_MODE=1
+ENV REACTPY_CHECK_VDOM_SPEC=0
CMD python scripts/run_docs.py
diff --git a/docs/README.md b/docs/README.md
index 067adc0b8..156fe4ea1 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,14 +1,16 @@
-# IDOM's Documentation
+# ReactPy's Documentation
-We provide two main ways to run the docs. Both use `nox` which has a `noxfile.py` at the
-root of the repository. Running the docs with `nox -s docs` will start up an iteractive
-session which will rebuild the docs any time a file is modified. Using `nox -s
-docs_in_docker` on the other hand, will build a docker image and run the docs from
-there. The latter command mimics how the docs will behave in production. As such, if any
-changes to the core of the documentation are made (i.e. to non-`*.rst` files), then you
-should run a manual test of the documentation using the `docs_in_docker` session.
+We provide two main ways to run the docs. Both use
+[`nox`](https://pypi.org/project/nox/):
-If you with to build and run the docs by hand you need to perform two commands, each
+- `nox -s docs` - displayes the docs and rebuilds when files are modified.
+- `nox -s docs-in-docker` - builds a docker image and runs the docs from there.
+
+If any changes to the core of the documentation are made (i.e. to non-`*.rst` files),
+then you should run a manual test of the documentation using the `docs_in_docker`
+session.
+
+If you wish to build and run the docs by hand you need to perform two commands, each
being run from the root of the repository:
- `sphinx-build -b html docs/source docs/build`
diff --git a/docs/app.py b/docs/app.py
index 4bbabf148..0b1ad302a 100644
--- a/docs/app.py
+++ b/docs/app.py
@@ -3,20 +3,20 @@
from sanic import Sanic, response
-from idom import component
-from idom.backend.sanic import Options, configure, use_request
-from idom.core.types import ComponentConstructor
+from reactpy import component
+from reactpy.backend.sanic import Options, configure, use_request
+from reactpy.core.types import ComponentConstructor
from .examples import get_normalized_example_name, load_examples
HERE = Path(__file__).parent
-IDOM_MODEL_SERVER_URL_PREFIX = "/_idom"
+REACTPY_MODEL_SERVER_URL_PREFIX = "/_reactpy"
logger = getLogger(__name__)
-IDOM_MODEL_SERVER_URL_PREFIX = "/_idom"
+REACTPY_MODEL_SERVER_URL_PREFIX = "/_reactpy"
@component
@@ -52,7 +52,7 @@ async def forward_to_index(request):
configure(
app,
Example,
- Options(url_prefix=IDOM_MODEL_SERVER_URL_PREFIX),
+ Options(url_prefix=REACTPY_MODEL_SERVER_URL_PREFIX),
)
return app
diff --git a/docs/examples.py b/docs/examples.py
index 4bcbf5148..142d49429 100644
--- a/docs/examples.py
+++ b/docs/examples.py
@@ -5,14 +5,14 @@
from traceback import format_exc
from typing import Callable, Iterator
-import idom
-from idom.types import ComponentType
+import reactpy
+from reactpy.types import ComponentType
HERE = Path(__file__)
SOURCE_DIR = HERE.parent / "source"
CONF_FILE = SOURCE_DIR / "conf.py"
-RUN_IDOM = idom.run
+RUN_ReactPy = reactpy.run
def load_examples() -> Iterator[tuple[str, Callable[[], ComponentType]]]:
@@ -95,7 +95,7 @@ def capture_component(component_constructor):
nonlocal captured_component_constructor
captured_component_constructor = component_constructor
- idom.run = capture_component
+ reactpy.run = capture_component
try:
code = compile(file.read_text(), str(file), "exec")
exec(
@@ -109,21 +109,23 @@ def capture_component(component_constructor):
except Exception:
return _make_error_display(format_exc())
finally:
- idom.run = RUN_IDOM
+ reactpy.run = RUN_ReactPy
if captured_component_constructor is None:
return _make_example_did_not_run(str(file))
- @idom.component
+ @reactpy.component
def Wrapper():
- return idom.html.div(captured_component_constructor(), PrintView())
+ return reactpy.html.div(captured_component_constructor(), PrintView())
- @idom.component
+ @reactpy.component
def PrintView():
- text, set_text = idom.hooks.use_state(print_buffer.getvalue())
+ text, set_text = reactpy.hooks.use_state(print_buffer.getvalue())
print_buffer.set_callback(set_text)
return (
- idom.html.pre({"class_name": "printout"}, text) if text else idom.html.div()
+ reactpy.html.pre({"class_name": "printout"}, text)
+ if text
+ else reactpy.html.div()
)
return Wrapper()
@@ -161,16 +163,16 @@ def write(self, text: str) -> None:
def _make_example_did_not_run(example_name):
- @idom.component
+ @reactpy.component
def ExampleDidNotRun():
- return idom.html.code(f"Example {example_name} did not run")
+ return reactpy.html.code(f"Example {example_name} did not run")
return ExampleDidNotRun()
def _make_error_display(message):
- @idom.component
+ @reactpy.component
def ShowError():
- return idom.html.pre(message)
+ return reactpy.html.pre(message)
return ShowError()
diff --git a/docs/source/_custom_js/README.md b/docs/source/_custom_js/README.md
index 8c77d450b..4d5d75dc2 100644
--- a/docs/source/_custom_js/README.md
+++ b/docs/source/_custom_js/README.md
@@ -1,4 +1,4 @@
-# Custom Javascript for IDOM's Docs
+# Custom Javascript for ReactPy's Docs
Build the javascript with
diff --git a/docs/source/_custom_js/package-lock.json b/docs/source/_custom_js/package-lock.json
index ec1c3b1c7..5e8cdba10 100644
--- a/docs/source/_custom_js/package-lock.json
+++ b/docs/source/_custom_js/package-lock.json
@@ -1,14 +1,14 @@
{
- "name": "idom-docs-example-loader",
+ "name": "reactpy-docs-example-loader",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
- "name": "idom-docs-example-loader",
+ "name": "reactpy-docs-example-loader",
"version": "1.0.0",
"dependencies": {
- "idom-client-react": "file:../../../src/client/packages/idom-client-react"
+ "@reactpy/client": "file:../../../src/client/packages/client"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^21.0.1",
@@ -18,9 +18,10 @@
"rollup": "^2.35.1"
}
},
- "../../../src/client/packages/idom-client-react": {
+ "../../../src/client/packages/@reactpy/client": {
"version": "0.44.0",
"integrity": "sha512-pIK5eNwFSHKXg7ClpASWFVKyZDYxz59MSFpVaX/OqJFkrJaAxBuhKGXNTMXmuyWOL5Iyvb/ErwwDRxQRzMNkfQ==",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"fast-json-patch": "^3.0.0-1",
@@ -37,15 +38,28 @@
"react-dom": ">=16"
}
},
- "../../../src/client/packages/idom-client-react/node_modules/fast-json-patch": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.0.tgz",
- "integrity": "sha512-IhpytlsVTRndz0hU5t0/MGzS/etxLlfrpG5V5M9mVbuj9TrJLWaMfsox9REM5rkuGX0T+5qjpe8XA1o0gZ42nA=="
+ "../../../src/client/packages/client": {
+ "name": "@reactpy/client",
+ "version": "1.0.0-a6",
+ "license": "MIT",
+ "dependencies": {
+ "htm": "^3.0.3",
+ "json-pointer": "^0.6.2"
+ },
+ "devDependencies": {
+ "jsdom": "16.5.0",
+ "lodash": "^4.17.21",
+ "prettier": "^2.5.1",
+ "uvu": "^0.5.1"
+ },
+ "peerDependencies": {
+ "react": ">=16",
+ "react-dom": ">=16"
+ }
},
- "../../../src/client/packages/idom-client-react/node_modules/htm": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/htm/-/htm-3.1.0.tgz",
- "integrity": "sha512-L0s3Sid5r6YwrEvkig14SK3Emmc+kIjlfLhEGn2Vy3bk21JyDEes4MoDsbJk6luaPp8bugErnxPz86ZuAw6e5Q=="
+ "node_modules/@reactpy/client": {
+ "resolved": "../../../src/client/packages/client",
+ "link": true
},
"node_modules/@rollup/plugin-commonjs": {
"version": "21.0.1",
@@ -264,10 +278,6 @@
"node": ">= 0.4.0"
}
},
- "node_modules/idom-client-react": {
- "resolved": "../../../src/client/packages/idom-client-react",
- "link": true
- },
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
@@ -422,6 +432,17 @@
}
},
"dependencies": {
+ "@reactpy/client": {
+ "version": "file:../../../src/client/packages/client",
+ "requires": {
+ "htm": "^3.0.3",
+ "jsdom": "16.5.0",
+ "json-pointer": "^0.6.2",
+ "lodash": "^4.17.21",
+ "prettier": "^2.5.1",
+ "uvu": "^0.5.1"
+ }
+ },
"@rollup/plugin-commonjs": {
"version": "21.0.1",
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-21.0.1.tgz",
@@ -599,29 +620,6 @@
"function-bind": "^1.1.1"
}
},
- "idom-client-react": {
- "version": "file:../../../src/client/packages/idom-client-react",
- "requires": {
- "fast-json-patch": "^3.0.0-1",
- "htm": "^3.0.3",
- "jsdom": "16.5.0",
- "lodash": "^4.17.21",
- "prettier": "^2.5.1",
- "uvu": "^0.5.1"
- },
- "dependencies": {
- "fast-json-patch": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.0.tgz",
- "integrity": "sha512-IhpytlsVTRndz0hU5t0/MGzS/etxLlfrpG5V5M9mVbuj9TrJLWaMfsox9REM5rkuGX0T+5qjpe8XA1o0gZ42nA=="
- },
- "htm": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/htm/-/htm-3.1.0.tgz",
- "integrity": "sha512-L0s3Sid5r6YwrEvkig14SK3Emmc+kIjlfLhEGn2Vy3bk21JyDEes4MoDsbJk6luaPp8bugErnxPz86ZuAw6e5Q=="
- }
- }
- },
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
diff --git a/docs/source/_custom_js/package.json b/docs/source/_custom_js/package.json
index 633a43739..5d3e41d13 100644
--- a/docs/source/_custom_js/package.json
+++ b/docs/source/_custom_js/package.json
@@ -1,7 +1,7 @@
{
- "name": "idom-docs-example-loader",
+ "name": "reactpy-docs-example-loader",
"version": "1.0.0",
- "description": "simple javascript client for IDOM's documentation",
+ "description": "simple javascript client for ReactPy's documentation",
"main": "index.js",
"scripts": {
"build": "rollup --config",
@@ -15,6 +15,6 @@
"rollup": "^2.35.1"
},
"dependencies": {
- "idom-client-react": "file:../../../src/client/packages/idom-client-react"
+ "@reactpy/client": "file:../../../src/client/packages/client"
}
}
diff --git a/docs/source/_custom_js/src/index.js b/docs/source/_custom_js/src/index.js
index 1aa401123..41a21334d 100644
--- a/docs/source/_custom_js/src/index.js
+++ b/docs/source/_custom_js/src/index.js
@@ -1,25 +1,25 @@
-import { mountWithLayoutServer, LayoutServerInfo } from "idom-client-react";
+import { mountWithLayoutServer, LayoutServerInfo } from "@reactpy/client";
let didMountDebug = false;
export function mountWidgetExample(
mountID,
viewID,
- idomServerHost,
+ reactpyServerHost,
useActivateButton
) {
- let idomHost, idomPort;
- if (idomServerHost) {
- [idomHost, idomPort] = idomServerHost.split(":", 2);
+ let reactpyHost, reactpyPort;
+ if (reactpyServerHost) {
+ [reactpyHost, reactpyPort] = reactpyServerHost.split(":", 2);
} else {
- idomHost = window.location.hostname;
- idomPort = window.location.port;
+ reactpyHost = window.location.hostname;
+ reactpyPort = window.location.port;
}
const serverInfo = new LayoutServerInfo({
- host: idomHost,
- port: idomPort,
- path: "/_idom/",
+ host: reactpyHost,
+ port: reactpyPort,
+ path: "/_reactpy/",
query: `view_id=${viewID}`,
secure: window.location.protocol == "https:",
});
diff --git a/docs/source/_exts/autogen_api_docs.py b/docs/source/_exts/autogen_api_docs.py
index 4419f5d69..9f833ac14 100644
--- a/docs/source/_exts/autogen_api_docs.py
+++ b/docs/source/_exts/autogen_api_docs.py
@@ -9,7 +9,7 @@
HERE = Path(__file__).parent
SRC = HERE.parent.parent.parent / "src"
-PYTHON_PACKAGE = SRC / "idom"
+PYTHON_PACKAGE = SRC / "reactpy"
AUTO_DIR = HERE.parent / "_auto"
AUTO_DIR.mkdir(exist_ok=True)
diff --git a/docs/source/_exts/copy_vdom_json_schema.py b/docs/source/_exts/copy_vdom_json_schema.py
index f78a163c2..38fc171ac 100644
--- a/docs/source/_exts/copy_vdom_json_schema.py
+++ b/docs/source/_exts/copy_vdom_json_schema.py
@@ -3,7 +3,7 @@
from sphinx.application import Sphinx
-from idom.core.vdom import VDOM_JSON_SCHEMA
+from reactpy.core.vdom import VDOM_JSON_SCHEMA
def setup(app: Sphinx) -> None:
diff --git a/docs/source/_exts/idom_example.py b/docs/source/_exts/reactpy_example.py
similarity index 97%
rename from docs/source/_exts/idom_example.py
rename to docs/source/_exts/reactpy_example.py
index 3741ca954..7cad84853 100644
--- a/docs/source/_exts/idom_example.py
+++ b/docs/source/_exts/reactpy_example.py
@@ -72,7 +72,7 @@ def run(self):
)
result_tab_item = (
- "▶️ result",
+ "🚀 result",
_interactive_widget(
name=example_name,
with_activate_button=not activate_result,
@@ -162,7 +162,7 @@ def _interactive_widget(name, with_activate_button):
_interactive_widget_template = """
-.. idom-view:: {name}
+.. reactpy-view:: {name}
{activate_button_opt}
"""
@@ -179,4 +179,4 @@ def _string_to_nested_lines(content):
def setup(app: Sphinx) -> None:
- app.add_directive("idom", WidgetExample)
+ app.add_directive("reactpy", WidgetExample)
diff --git a/docs/source/_exts/idom_view.py b/docs/source/_exts/reactpy_view.py
similarity index 79%
rename from docs/source/_exts/idom_view.py
rename to docs/source/_exts/reactpy_view.py
index 748ef71f8..477a6caca 100644
--- a/docs/source/_exts/idom_view.py
+++ b/docs/source/_exts/reactpy_view.py
@@ -8,8 +8,10 @@
from docs.examples import get_normalized_example_name
-_IDOM_EXAMPLE_HOST = os.environ.get("IDOM_DOC_EXAMPLE_SERVER_HOST", "")
-_IDOM_STATIC_HOST = os.environ.get("IDOM_DOC_STATIC_SERVER_HOST", "/docs").rstrip("/")
+_REACTPY_EXAMPLE_HOST = os.environ.get("REACTPY_DOC_EXAMPLE_SERVER_HOST", "")
+_REACTPY_STATIC_HOST = os.environ.get("REACTPY_DOC_STATIC_SERVER_HOST", "/docs").rstrip(
+ "/"
+)
class IteractiveWidget(SphinxDirective):
@@ -24,7 +26,7 @@ class IteractiveWidget(SphinxDirective):
def run(self):
IteractiveWidget._next_id += 1
- container_id = f"idom-widget-{IteractiveWidget._next_id}"
+ container_id = f"reactpy-widget-{IteractiveWidget._next_id}"
view_id = get_normalized_example_name(
self.arguments[0],
# only used if example name starts with "/"
@@ -41,11 +43,11 @@ def run(self):
style="margin-bottom: {self.options.get("margin", 0)}px;"
/>
@@ -57,4 +59,4 @@ def run(self):
def setup(app: Sphinx) -> None:
- app.add_directive("idom-view", IteractiveWidget)
+ app.add_directive("reactpy-view", IteractiveWidget)
diff --git a/docs/source/_static/css/furo-theme-overrides.css b/docs/source/_static/css/furo-theme-overrides.css
index cbe4e99ef..a258e025e 100644
--- a/docs/source/_static/css/furo-theme-overrides.css
+++ b/docs/source/_static/css/furo-theme-overrides.css
@@ -1,8 +1,6 @@
-body {
- --admonition-title-font-size: 1rem !important;
- --admonition-font-size: 1rem !important;
-}
-
.sidebar-container {
width: 18em;
}
+.sidebar-brand-text {
+ display: none;
+}
diff --git a/docs/source/_static/css/idom-view.css b/docs/source/_static/css/reactpy-view.css
similarity index 100%
rename from docs/source/_static/css/idom-view.css
rename to docs/source/_static/css/reactpy-view.css
diff --git a/docs/source/_static/css/sphinx-design-overrides.css b/docs/source/_static/css/sphinx-design-overrides.css
index cc9b285c0..767d9d16c 100644
--- a/docs/source/_static/css/sphinx-design-overrides.css
+++ b/docs/source/_static/css/sphinx-design-overrides.css
@@ -1,12 +1,3 @@
-body {
- --sd-color-info: var(--color-admonition-title-background--note);
- --sd-color-warning: var(--color-admonition-title-background--warning);
- --sd-color-danger: var(--color-admonition-title-background--danger);
- --sd-color-info-text: var(--color-admonition-title--note);
- --sd-color-warning-text: var(--color-admonition-title--warning);
- --sd-color-danger-text: var(--color-admonition-title--danger);
-}
-
.sd-card-body {
display: flex;
flex-direction: column;
diff --git a/docs/source/_static/install-and-run-idom.gif b/docs/source/_static/install-and-run-idom.gif
deleted file mode 100644
index 67d226a12..000000000
Binary files a/docs/source/_static/install-and-run-idom.gif and /dev/null differ
diff --git a/docs/source/_static/install-and-run-reactpy.gif b/docs/source/_static/install-and-run-reactpy.gif
new file mode 100644
index 000000000..49d431341
Binary files /dev/null and b/docs/source/_static/install-and-run-reactpy.gif differ
diff --git a/docs/source/about/changelog.rst b/docs/source/about/changelog.rst
index 3472f8da6..e4e98037c 100644
--- a/docs/source/about/changelog.rst
+++ b/docs/source/about/changelog.rst
@@ -3,8 +3,8 @@ Changelog
.. note::
- The IDOM team manages their short and long term plans with `GitHub Projects
- `__. If you have questions about what
+ The ReactPy team manages their short and long term plans with `GitHub Projects
+ `__. If you have questions about what
the team are working on, or have feedback on how issues should be prioritized, feel
free to :discussion-type:`open up a discussion `.
@@ -76,7 +76,7 @@ v1.0.0-a3
**Removed**
-- :pull:`907` - accidental import of idom.testing
+- :pull:`907` - accidental import of reactpy.testing
v1.0.0-a2
@@ -117,13 +117,13 @@ v1.0.0-a1
All attributes are written using ``snake_case``.
- In conjunction, with these changes, IDOM now supplies a command line utility that
+ In conjunction, with these changes, ReactPy now supplies a command line utility that
makes a "best effort" attempt to automatically convert code to the new API. Usage of
this utility is as follows:
.. code-block:: bash
- idom update-html-usages [PATHS]
+ reactpy update-html-usages [PATHS]
Where ``[PATHS]`` is any number of directories or files that should be rewritten.
@@ -145,7 +145,7 @@ v0.44.0
**Deprecated**
-- :pull:`876` - ``idom.widgets.hotswap``. The function has no clear uses outside of some
+- :pull:`876` - ``reactpy.widgets.hotswap``. The function has no clear uses outside of some
internal applications. For this reason it has been deprecated.
**Removed**
@@ -153,7 +153,7 @@ v0.44.0
- :pull:`886` - Ability to access element value from events via `event['value']` key.
Instead element value should be accessed via `event['target']['value']`. Originally
deprecated in :ref:`v0.34.0`.
-- :pull:`886` - old misspelled option ``idom.config.IDOM_WED_MODULES_DIR``. Originally
+- :pull:`886` - old misspelled option ``reactpy.config.REACTPY_WED_MODULES_DIR``. Originally
deprecated in :ref:`v0.36.1`.
@@ -181,7 +181,7 @@ v0.42.0
**Added**
-- :pull:`835` - Ability to customize the ```` element of IDOM's built-in client.
+- :pull:`835` - Ability to customize the ```` element of ReactPy's built-in client.
- :pull:`835` - ``vdom_to_html`` utility function.
- :pull:`843` - Ability to subscribe to changes that are made to mutable options.
- :pull:`832` - ``del_html_head_body_transform`` to remove ````, ````, and ```` while preserving children.
@@ -189,13 +189,13 @@ v0.42.0
**Fixed**
-- :issue:`582` - ``IDOM_DEBUG_MODE`` is now mutable and can be changed at runtime
+- :issue:`582` - ``REACTPY_DEBUG_MODE`` is now mutable and can be changed at runtime
- :pull:`832` - Fix ``html_to_vdom`` improperly removing ````, ````, and ```` nodes.
**Removed**
-- :pull:`832` - Removed ``idom.html.body`` as it is currently unusable due to technological limitations, and thus not needed.
-- :pull:`840` - remove ``IDOM_FEATURE_INDEX_AS_DEFAULT_KEY`` option
+- :pull:`832` - Removed ``reactpy.html.body`` as it is currently unusable due to technological limitations, and thus not needed.
+- :pull:`840` - remove ``REACTPY_FEATURE_INDEX_AS_DEFAULT_KEY`` option
- :pull:`835` - ``serve_static_files`` option from backend configuration
**Deprecated**
@@ -212,16 +212,16 @@ v0.41.0
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:
+- :pull:`824` - ReactPy's built-in backend server now expose the following routes:
- - ``/_idom/assets/``
- - ``/_idom/stream/``
- - ``/_idom/modules/``
+ - ``/_reactpy/assets/``
+ - ``/_reactpy/stream/``
+ - ``/_reactpy/modules/``
- ``//``
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.
+ is ``/_reactpy``, your app should still work as expected. Though if you're using
+ ``reactpy-router``, ReactPy'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``
@@ -301,14 +301,14 @@ v0.39.0
**Fixed**
-- :pull:`763` - ``No module named 'idom.server'`` from ``idom.run``
+- :pull:`763` - ``No module named 'reactpy.server'`` from ``reactpy.run``
- :pull:`749` - Setting appropriate MIME type for web modules in `sanic` server implementation
**Changed**
- :pull:`763` - renamed various:
- - ``idom.testing.server -> idom.testing.backend``
+ - ``reactpy.testing.server -> reactpy.testing.backend``
- ``ServerFixture -> BackendFixture``
- ``DisplayFixture.server -> DisplayFixture.backend``
@@ -326,7 +326,7 @@ v0.38.1
**Fixed**
-- `idom-team/idom-jupyter#22 `__ -
+- `reactive-python/reactpy-jupyter#22 `__ -
a missing file extension was causing a problem with WebPack.
@@ -347,7 +347,7 @@ v0.38.0-a4
**Changed**
-- :pull:`733` - renamed ``assert_idom_logged`` testing util to ``assert_idom_did_log``
+- :pull:`733` - renamed ``assert_reactpy_logged`` testing util to ``assert_reactpy_did_log``
v0.38.0-a3
@@ -367,12 +367,12 @@ v0.38.0-a2
- :pull:`721` - Implement ``use_location()`` hook. Navigating to any route below the
root of the application will be reflected in the ``location.pathname``. This operates
- in concert with how IDOM's configured routes have changed. This will ultimately work
+ in concert with how ReactPy's configured routes have changed. This will ultimately work
towards resolving :issue:`569`.
**Changed**
-- :pull:`721` - The routes IDOM configures on apps have changed
+- :pull:`721` - The routes ReactPy configures on apps have changed
.. code-block:: text
@@ -380,14 +380,14 @@ v0.38.0-a2
prefix/_api/stream websocket endpoint
prefix/* client react app
- This means that IDOM's client app is available at any route below the configured
+ This means that ReactPy's client app is available at any route below the configured
``url_prefix`` besides ``prefix/_api``. The ``_api`` route will likely remain a route
- which is reserved by IDOM. The route navigated to below the ``prefix`` will be shown
+ which is reserved by ReactPy. The route navigated to below the ``prefix`` will be shown
in ``use_location``.
-- :pull:`721` - IDOM's client now uses Preact instead of React
+- :pull:`721` - ReactPy's client now uses Preact instead of React
-- :pull:`726` - Renamed ``idom.server`` to ``idom.backend``. Other references to "server
+- :pull:`726` - Renamed ``reactpy.server`` to ``reactpy.backend``. Other references to "server
implementations" have been renamed to "backend implementations" throughout the
documentation and code.
@@ -402,9 +402,9 @@ v0.38.0-a1
**Changed**
-- :pull:`703` - How IDOM integrates with servers. ``idom.run`` no longer accepts an app
- instance to discourage use outside of testing. IDOM's server implementations now
- provide ``configure()`` functions instead. ``idom.testing`` has been completely
+- :pull:`703` - How ReactPy integrates with servers. ``reactpy.run`` no longer accepts an app
+ instance to discourage use outside of testing. ReactPy's server implementations now
+ provide ``configure()`` functions instead. ``reactpy.testing`` has been completely
reworked in order to support async web drivers
- :pull:`703` - ``PerClientStateServer`` has been functionally replaced by ``configure``
@@ -414,14 +414,14 @@ v0.38.0-a1
**Removed**
-- :issue:`669` - Removed ``idom.widgets.multiview`` since basic routing view ``use_scope`` is
+- :issue:`669` - Removed ``reactpy.widgets.multiview`` since basic routing view ``use_scope`` is
now possible as well as all ``SharedClientStateServer`` implementations.
**Fixed**
-- :issue:`591` - IDOM's test suite no longer uses sync web drivers
+- :issue:`591` - ReactPy's test suite no longer uses sync web drivers
- :issue:`678` - Updated Sanic requirement to ``>=21``
-- :issue:`657` - How we advertise ``idom.run``
+- :issue:`657` - How we advertise ``reactpy.run``
v0.37.2
@@ -431,11 +431,11 @@ v0.37.2
**Changed**
- :pull:`701` - The name of ``proto`` modules to ``types`` and added a top level
- ``idom.types`` module
+ ``reactpy.types`` module
**Fixed**
-- :pull:`716` - A typo caused IDOM to use the insecure ``ws`` web-socket protocol on
+- :pull:`716` - A typo caused ReactPy to use the insecure ``ws`` web-socket protocol on
pages loaded with ``https`` instead of the secure ``wss`` protocol
@@ -515,8 +515,8 @@ v0.36.1
-------
:octicon:`milestone` *released on 2022-02-02*
-Includes bug fixes and renames the configuration option ``IDOM_WED_MODULES_DIR`` to
-``IDOM_WEB_MODULES_DIR`` with a corresponding deprecation warning.
+Includes bug fixes and renames the configuration option ``REACTPY_WED_MODULES_DIR`` to
+``REACTPY_WEB_MODULES_DIR`` with a corresponding deprecation warning.
**Closed Issues**
@@ -526,7 +526,7 @@ Includes bug fixes and renames the configuration option ``IDOM_WED_MODULES_DIR``
**Merged Pull Requests**
- mark old state as None if unmounting - :pull:`641`
-- rename IDOM_WED_MODULES_DIR to IDOM_WEB_MODULES_DIR - :pull:`638`
+- rename REACTPY_WED_MODULES_DIR to REACTPY_WEB_MODULES_DIR - :pull:`638`
v0.36.0
@@ -621,8 +621,8 @@ v0.35.0
The highlight of this release is that the default :ref:`"key" ` of all elements will be their index amongst their neighbors. Previously this
-behavior could be engaged by setting ``IDOM_FEATURE_INDEX_AS_DEFAULT_KEY=1`` when
-running IDOM. In this release though, you will need to explicitly turn off this feature
+behavior could be engaged by setting ``REACTPY_FEATURE_INDEX_AS_DEFAULT_KEY=1`` when
+running ReactPy. In this release though, you will need to explicitly turn off this feature
(i.e. ``=0``) to return to the old behavior. With this change, some may notice
additional error logs which warn that:
@@ -638,9 +638,9 @@ on :ref:`Organizing Items With Keys`.
- Support Starlette Server - :issue:`588`
- Fix unhandled case in module_from_template - :issue:`584`
-- Hide "Children" within IDOM_DEBUG_MODE key warnings - :issue:`562`
+- Hide "Children" within REACTPY_DEBUG_MODE key warnings - :issue:`562`
- Bug in Element Key Identity - :issue:`556`
-- Add iFrame to idom.html - :issue:`542`
+- Add iFrame to reactpy.html - :issue:`542`
- Create a use_linked_inputs widget instead of Input - :issue:`475`
- React warning from module_from_template - :issue:`440`
- Use Index as Default Key - :issue:`351`
@@ -689,7 +689,7 @@ v0.33.3
:octicon:`milestone` *released on 2021-10-08*
Contains a small number of bug fixes and improvements. The most significant change is
-the addition of a warning stating that `IDOM_FEATURE_INDEX_AS_DEFAULT_KEY=1` will become
+the addition of a warning stating that `REACTPY_FEATURE_INDEX_AS_DEFAULT_KEY=1` will become
the default in a future release. Beyond that, a lesser improvement makes it possible to
use the default export from a Javascript module when calling `module_from_template` by
specifying `exports_default=True` as a parameter. A
@@ -702,7 +702,7 @@ specifying `exports_default=True` as a parameter. A
**Pull Requests**
-- warn that IDOM_FEATURE_INDEX_AS_DEFAULT_KEY=1 will be the default - :pull:`515`
+- warn that REACTPY_FEATURE_INDEX_AS_DEFAULT_KEY=1 will be the default - :pull:`515`
- clean up patch queues after exit - :pull:`514`
- Remove Reconnecting WS alert - :pull:`513`
- Fix 502 - :pull:`503`
@@ -745,13 +745,13 @@ suite, we added a test that should hopefully catch this in the future by proxy.
The most important breaking change, is yet another which modifies the Custom Javascript
Component interface. We now add a ``create()`` function to the ``bind()`` interface that
-allows IDOM's client to recursively create components from that (and only that) import
+allows ReactPy's client to recursively create components from that (and only that) import
source. Prior to this, the interface was given unrendered models for child elements. The
imported module was then responsible for rendering them. This placed a large burden on
the author to understand how to handle these unrendered child models. In addition, in
the React template used by ``module_from_template`` we needed to import a version of
-``idom-client-react`` from the CDN - this had already caused some issues where the
-template required a version of ``idom-client-react`` in the which had not been released
+``@reactpy/client`` from the CDN - this had already caused some issues where the
+template required a version of ``@reactpy/client`` in the which had not been released
yet.
**Closed Issues**
@@ -762,14 +762,14 @@ yet.
- Examples broken in docs - :issue:`451`
- Rework docs landing page - :issue:`446`
- eventHandlers should be a mapping of generic callables - :issue:`423`
-- Allow customization of built-in IDOM client - :issue:`253`
+- Allow customization of built-in ReactPy client - :issue:`253`
**Pull Requests**
- move VdomDict and VdomJson to proto - :pull:`492`
- only send error info in debug mode - :pull:`491`
- correctly apply client-side JSON patch - :pull:`490`
-- add script to set version of all packages in IDOM - :pull:`483`
+- add script to set version of all packages in ReactPy - :pull:`483`
- Pass import source to bind - :pull:`482`
- Do not mutate client-side model - :pull:`481`
- assume import source children come from same source - :pull:`479`
@@ -795,7 +795,7 @@ See :ref:`Custom JavaScript Components` for details on the new interface.
- Query params in package name for module_from_template not stripped - :issue:`455`
- Make docs section margins larger - :issue:`450`
- Search broken in docs - :issue:`443`
-- Move src/idom/client out of Python package - :issue:`429`
+- Move src/reactpy/client out of Python package - :issue:`429`
- Use composition instead of classes async with Layout and LifeCycleHook - :issue:`412`
- Remove Python language extension - :issue:`282`
- Add keys to models so React doesn't complain of child arrays requiring them -
@@ -818,12 +818,12 @@ v0.31.0
-------
:octicon:`milestone` *released on 2021-07-14*
-The :class:`~idom.core.layout.Layout` is now a prototype, and ``Layout.update`` is no
+The :class:`~reactpy.core.layout.Layout` is now a prototype, and ``Layout.update`` is no
longer a public API. This is combined with a much more significant refactor of the
underlying rendering logic.
The biggest issue that has been resolved relates to the relationship between
-:class:`~idom.core.hooks.LifeCycleHook` and ``Layout``. Previously, the
+:class:`~reactpy.core.hooks.LifeCycleHook` and ``Layout``. Previously, the
``LifeCycleHook`` accepted a layout instance in its constructor and called
``Layout.update``. Additionally, the ``Layout`` would manipulate the
``LifeCycleHook.component`` attribute whenever the component instance changed after a
@@ -883,23 +883,23 @@ runtime reliance on NPM. Doing so has many virtuous knock-on effects:
are located, and as a result, it's also easier to coordinate the server and client
code.
4. Alternate client implementations benefit from this simplicity. Now, it's possible to
- install idom-client-react normally and write a ``loadImportSource()`` function that
- looks for route serving the contents of `IDOM_WEB_MODULES_DIR.`
+ install @reactpy/client normally and write a ``loadImportSource()`` function that
+ looks for route serving the contents of `REACTPY_WEB_MODULES_DIR.`
This change includes large breaking changes:
- The CLI is being removed as it won't be needed any longer
-- The `idom.client` is being removed in favor of a stripped down ``idom.web`` module
-- The `IDOM_CLIENT_BUILD_DIR` config option will no longer exist and a new
- ``IDOM_WEB_MODULES_DIR`` which only contains dynamically linked web modules. While
+- The `reactpy.client` is being removed in favor of a stripped down ``reactpy.web`` module
+- The `REACTPY_CLIENT_BUILD_DIR` config option will no longer exist and a new
+ ``REACTPY_WEB_MODULES_DIR`` which only contains dynamically linked web modules. While
this new directory's location is configurable, it is meant to be transient and should
not be re-used across sessions.
-The new ``idom.web`` module takes a simpler approach to constructing import sources and
+The new ``reactpy.web`` module takes a simpler approach to constructing import sources and
expands upon the logic for resolving imports by allowing exports from URLs to be
-discovered too. Now, that IDOM isn't using NPM to dynamically install component
-libraries ``idom.web`` instead creates JS modules from template files and links them
-into ``IDOM_WEB_MODULES_DIR``. These templates ultimately direct the browser to load the
+discovered too. Now, that ReactPy isn't using NPM to dynamically install component
+libraries ``reactpy.web`` instead creates JS modules from template files and links them
+into ``REACTPY_WEB_MODULES_DIR``. These templates ultimately direct the browser to load the
desired library from a CDN.
**Pull Requests**
@@ -908,7 +908,7 @@ desired library from a CDN.
- Fix typo in index.rst - :pull:`411`
- Add event handlers docs - :pull:`410`
- Misc doc improvements - :pull:`409`
-- Port first IDOM article to docs - :pull:`408`
+- Port first ReactPy article to docs - :pull:`408`
- Test build in CI - :pull:`404`
- Remove all runtime reliance on NPM - :pull:`398`
@@ -920,8 +920,8 @@ v0.29.0
Contains breaking changes, the most significant of which are:
- Moves the runtime client build directory to a "user data" directory rather a directory
- where IDOM's code was installed. This has the advantage of not requiring write
- permissions to rebuild the client if IDOM was installed globally rather than in a
+ where ReactPy's code was installed. This has the advantage of not requiring write
+ permissions to rebuild the client if ReactPy was installed globally rather than in a
virtual environment.
- The custom JS component interface has been reworked to expose an API similar to
the ``createElement``, ``render``, ``unmountComponentAtNode`` functions from React.
@@ -955,7 +955,7 @@ Includes a wide variety of improvements:
- support for the ``files`` attribute from the target of input elements
- model children are passed to the Javascript ``mount()`` function
- began to add tests to client-side javascript
-- add a ``mountLayoutWithWebSocket`` function to ``idom-client-react``
+- add a ``mountLayoutWithWebSocket`` function to ``@reactpy/client``
and breaking changes, the most significant of which are:
@@ -966,7 +966,7 @@ and breaking changes, the most significant of which are:
concerns and common workspace scripts in ``package.json``.
- Use a ``loadImportSource()`` function instead of trying to infer the path to dynamic
modules which was brittle and inflexible. Allowing the specific client implementation
- to discover where "import sources" are located means ``idom-client-react`` doesn't
+ to discover where "import sources" are located means ``@reactpy/client`` doesn't
need to try and devise a solution that will work for all cases. The fallout from this
change is the addition of `importSource.sourceType` which, for the moment can either
be ``"NAME"`` or ``"URL"`` where the former indicates the client is expected to know
@@ -1073,7 +1073,7 @@ its state do the same.
In a future update, the default key for all elements and components will be its index
with respect to its siblings in the layout. The
-:attr:`~idom.config.IDOM_FEATURE_INDEX_AS_DEFAULT_KEY` feature flag has been introduced
+:attr:`~reactpy.config.REACTPY_FEATURE_INDEX_AS_DEFAULT_KEY` feature flag has been introduced
to allow users to enable this behavior early.
**Highlighted Commits:**
@@ -1110,15 +1110,15 @@ v0.23.0
- automatically reconnect to server - :commit:`3477e2b`
- allow no reconnect in client - :commit:`ef263c2`
- cleaner way to specify import sources - :commit:`ea19a07`
-- add the idom-react-client back into the main repo - :commit:`5dcc3bb`
+- add the reactpy-react-client back into the main repo - :commit:`5dcc3bb`
- implement fastapi render server - :commit:`94e0620`
-- improve docstring for IDOM_CLIENT_BUILD_DIR - :commit:`962d885`
+- improve docstring for REACTPY_CLIENT_BUILD_DIR - :commit:`962d885`
- cli improvements - :commit:`788fd86`
- rename SERIALIZED_VDOM_JSON_SCHEMA to VDOM_JSON_SCHEMA - :commit:`74ad578`
- better logging for modules - :commit:`39565b9`
- move client utils into private module - :commit:`f825e96`
-- redirect BUILD_DIR imports to IDOM_CLIENT_BUILD_DIR option - :commit:`53fb23b`
+- redirect BUILD_DIR imports to REACTPY_CLIENT_BUILD_DIR option - :commit:`53fb23b`
- upgrade snowpack - :commit:`5697a2d`
-- better logs for idom.run + flask server - :commit:`2b34e3d`
+- better logs for reactpy.run + flask server - :commit:`2b34e3d`
- move package to src dir - :commit:`066c9c5`
-- idom restore uses backup - :commit:`773f78e`
+- reactpy restore uses backup - :commit:`773f78e`
diff --git a/docs/source/about/contributor-guide.rst b/docs/source/about/contributor-guide.rst
index f0eb39711..11ff79a43 100644
--- a/docs/source/about/contributor-guide.rst
+++ b/docs/source/about/contributor-guide.rst
@@ -4,11 +4,11 @@ Contributor Guide
.. note::
The
- `Code of Conduct `__
+ `Code of Conduct `__
applies in all community spaces. If you are not familiar with our Code of Conduct
policy, take a minute to read it before making your first contribution.
-The IDOM team welcomes contributions and contributors of all kinds - whether they come
+The ReactPy team welcomes contributions and contributors of all kinds - whether they come
as code changes, participation in the discussions, opening issues and pointing out bugs,
or simply sharing your work with your colleagues and friends. We're excited to see how
you can help move this project and community forward!
@@ -23,7 +23,7 @@ Trust us, there's so many ways to support the project. We're always looking for
who can:
- Improve our documentation
-- Teach and tell others about IDOM
+- Teach and tell others about ReactPy
- Share ideas for new features
- Report bugs
- Participate in general discussions
@@ -35,13 +35,13 @@ we'll help you make your first contribution.
Making a Pull Request
---------------------
-To make your first code contribution to IDOM, you'll need to install Git_ (or
+To make your first code contribution to ReactPy, you'll need to install Git_ (or
`Git Bash`_ on Windows). Thankfully there are many helpful
`tutorials `__
-about how to get started. To make a change to IDOM you'll do the following:
+about how to get started. To make a change to ReactPy you'll do the following:
-`Fork IDOM `__:
- Go to `this URL `__ and click the "Fork" button.
+`Fork ReactPy `__:
+ Go to `this URL `__ and click the "Fork" button.
`Clone your fork `__:
You use a ``git clone`` command to copy the code from GitHub to your computer.
@@ -50,10 +50,10 @@ about how to get started. To make a change to IDOM you'll do the following:
You'll ``git checkout -b your-first-branch`` to create a new space to start your work.
:ref:`Prepare your Development Environment `:
- We explain in more detail below how to install all IDOM's dependencies.
+ We explain in more detail below how to install all ReactPy's dependencies.
`Push your changes `__:
- Once you've made changes to IDOM, you'll ``git push`` them to your fork.
+ Once you've made changes to ReactPy, you'll ``git push`` them to your fork.
:ref:`Create a changelog entry `:
Record your changes in the :ref:`changelog` so we can publicize them in the next release.
@@ -72,7 +72,7 @@ Development Environment
If you have any questions during set up or development post on our
:discussion-type:`discussion board ` and we'll answer them.
-In order to develop IDOM locally you'll first need to install the following:
+In order to develop ReactPy locally you'll first need to install the following:
.. list-table::
:header-rows: 1
@@ -103,8 +103,8 @@ Once done, you can clone a local copy of this repository:
.. code-block:: bash
- git clone https://github.com/idom-team/idom.git
- cd idom
+ git clone https://github.com/reactive-python/reactpy.git
+ cd reactpy
Then, you should be able to run the command below to:
@@ -118,7 +118,7 @@ Then, you should be able to run the command below to:
pip install -e . -r requirements.txt && pre-commit install
-If you modify any Javascript, you'll need to re-install IDOM:
+If you modify any Javascript, you'll need to re-install ReactPy:
.. code-block:: bash
@@ -131,7 +131,7 @@ However you may also ``cd`` to the ``src/client`` directory which contains a
Running The Tests
-----------------
-The test suite for IDOM is executed with Nox_, which should already be installed if you
+The test suite for ReactPy is executed with Nox_, which should already be installed if you
followed the `earlier instructions `_. The suite covers:
1. Server-side Python code with PyTest_
@@ -182,7 +182,7 @@ The following are currently being used:
- Prettier_ - a tool for automatically formatting various file types
The most strict measure of quality enforced on the codebase is 100% test coverage in
-Python files. This means that every line of coded added to IDOM requires a test case
+Python files. This means that every line of coded added to ReactPy requires a test case
that exercises it. This doesn't prevent all bugs, but it should ensure that we catch the
most common ones.
@@ -233,7 +233,7 @@ Creating a Changelog Entry
--------------------------
As part of your pull request, you'll want to edit the `Changelog
-`__ by
+`__ by
adding an entry describing what you've changed or improved. You should write an entry in
the style of `Keep a Changelog `__ that falls under one of
the following categories, and add it to the :ref:`Unreleased` section of the changelog:
@@ -276,7 +276,7 @@ changelog entry might look like:
Release Process
---------------
-Creating a release for IDOM involves two steps:
+Creating a release for ReactPy involves two steps:
1. Tagging a version
2. Publishing a release
@@ -308,19 +308,19 @@ use GitHub's "Auto-generated release notes".
Other Core Repositories
-----------------------
-IDOM depends on, or is used by several other core projects. For documentation on them
+ReactPy depends on, or is used by several other core projects. For documentation on them
you should refer to their respective documentation in the links below:
-- `idom-react-component-cookiecutter
- `__ - Template repo
+- `reactpy-react-component-cookiecutter
+ `__ - Template repo
for making :ref:`Custom Javascript Components`.
-- `flake8-idom-hooks `__ - Enforces the
+- `flake8-reactpy-hooks `__ - Enforces the
:ref:`Rules of Hooks`
-- `idom-jupyter `__ - IDOM integration for
+- `reactpy-jupyter `__ - ReactPy integration for
Jupyter
-- `idom-dash `__ - IDOM integration for Plotly
+- `reactpy-dash `__ - ReactPy integration for Plotly
Dash
-- `django-idom `__ - IDOM integration for
+- `django-reactpy `__ - ReactPy integration for
Django
.. Links
@@ -332,7 +332,7 @@ you should refer to their respective documentation in the links below:
.. _Git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
.. _Git Bash: https://gitforwindows.org/
.. _NPM: https://www.npmjs.com/get-npm
-.. _PyPI: https://pypi.org/project/idom
+.. _PyPI: https://pypi.org/project/reactpy
.. _pip: https://pypi.org/project/pip/
.. _PyTest: pytest `__
license. While many things have been transformed, we paraphrase and, in some places,
-copy language or examples where IDOM's behavior mirrors that of React's.
+copy language or examples where ReactPy's behavior mirrors that of React's.
Source Code License
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 3b065f987..71364b00d 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -25,37 +25,37 @@
# -- Project information -----------------------------------------------------
-project = "IDOM"
-title = "IDOM Docs"
+project = "ReactPy"
+title = "ReactPy"
description = (
- "IDOM is a Python web framework for building interactive websites without needing "
+ "ReactPy is a Python web framework for building interactive websites without needing "
"a single line of Javascript. It can be run standalone, in a Jupyter Notebook, or "
"as part of an existing application."
)
-copyright = "2020, Ryan Morshead"
+copyright = "2023, Ryan Morshead"
author = "Ryan Morshead"
# -- Common External Links ---------------------------------------------------
extlinks = {
"issue": (
- "https://github.com/idom-team/idom/issues/%s",
+ "https://github.com/reactive-python/reactpy/issues/%s",
"#",
),
"pull": (
- "https://github.com/idom-team/idom/pull/%s",
+ "https://github.com/reactive-python/reactpy/pull/%s",
"#",
),
"discussion": (
- "https://github.com/idom-team/idom/discussions/%s",
+ "https://github.com/reactive-python/reactpy/discussions/%s",
"#",
),
"discussion-type": (
- "https://github.com/idom-team/idom/discussions/categories/%s",
+ "https://github.com/reactive-python/reactpy/discussions/categories/%s",
"",
),
"commit": (
- "https://github.com/idom-team/idom/commit/%s",
+ "https://github.com/reactive-python/reactpy/commit/%s",
"",
),
}
@@ -87,9 +87,9 @@
"async_doctest",
"autogen_api_docs",
"copy_vdom_json_schema",
- "idom_view",
+ "reactpy_view",
"patched_html_translator",
- "idom_example",
+ "reactpy_example",
"build_custom_js",
"custom_autosectionlabel",
]
@@ -163,8 +163,8 @@
# -- sphinxext.opengraph --
-ogp_site_url = "https://idom-docs.herokuapp.com/"
-ogp_image = "https://raw.githubusercontent.com/idom-team/idom/main/branding/png/idom-logo-black.png"
+ogp_site_url = "https://reactpy-docs.herokuapp.com/"
+ogp_image = "https://raw.githubusercontent.com/reactive-python/reactpy/main/branding/png/reactpy-logo-padded.png"
# We manually specify this below
# ogp_description_length = 200
ogp_type = "website"
@@ -188,14 +188,27 @@
# a list of builtin themes.
#
html_theme = "furo"
-html_logo = str(ROOT_DIR / "branding" / "svg" / "idom-logo.svg")
-html_favicon = str(ROOT_DIR / "branding" / "svg" / "idom-logo-square-small.svg")
+html_logo = str(ROOT_DIR / "branding" / "reactpy-logo-wide.svg")
+html_favicon = str(ROOT_DIR / "branding" / "reactpy-logo.ico")
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
-#
-# html_theme_options = {}
+
+html_theme_options = {
+ "light_css_variables": {
+ # furo
+ "admonition-title-font-size": "1rem",
+ "admonition-font-size": "1rem",
+ # sphinx-design
+ "sd-color-info": "var(--color-admonition-title-background--note)",
+ "sd-color-warning": "var(--color-admonition-title-background--warning)",
+ "sd-color-danger": "var(--color-admonition-title-background--danger)",
+ "sd-color-info-text": "var(--color-admonition-title--note)",
+ "sd-color-warning-text": "var(--color-admonition-title--warning)",
+ "sd-color-danger-text": "var(--color-admonition-title--danger)",
+ },
+}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
@@ -232,7 +245,7 @@
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
-htmlhelp_basename = "IDOMdoc"
+htmlhelp_basename = "ReactPydoc"
# -- Options for LaTeX output ------------------------------------------------
@@ -255,14 +268,14 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
-latex_documents = [(master_doc, "IDOM.tex", html_title, "Ryan Morshead", "manual")]
+latex_documents = [(master_doc, "ReactPy.tex", html_title, "Ryan Morshead", "manual")]
# -- Options for manual page output ------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
-man_pages = [(master_doc, "idom", html_title, [author], 1)]
+man_pages = [(master_doc, "reactpy", html_title, [author], 1)]
# -- Options for Texinfo output ----------------------------------------------
@@ -273,10 +286,10 @@
texinfo_documents = [
(
master_doc,
- "IDOM",
+ "ReactPy",
html_title,
author,
- "IDOM",
+ "ReactPy",
"One line description of project.",
"Miscellaneous",
)
diff --git a/docs/source/guides/adding-interactivity/components-with-state/_examples/adding_state_variable/main.py b/docs/source/guides/adding-interactivity/components-with-state/_examples/adding_state_variable/main.py
index bbadfb06e..860cd093b 100644
--- a/docs/source/guides/adding-interactivity/components-with-state/_examples/adding_state_variable/main.py
+++ b/docs/source/guides/adding-interactivity/components-with-state/_examples/adding_state_variable/main.py
@@ -1,7 +1,7 @@
import json
from pathlib import Path
-from idom import component, hooks, html, run
+from reactpy import component, hooks, html, run
HERE = Path(__file__)
diff --git a/docs/source/guides/adding-interactivity/components-with-state/_examples/isolated_state/main.py b/docs/source/guides/adding-interactivity/components-with-state/_examples/isolated_state/main.py
index 2434f5239..3149e6396 100644
--- a/docs/source/guides/adding-interactivity/components-with-state/_examples/isolated_state/main.py
+++ b/docs/source/guides/adding-interactivity/components-with-state/_examples/isolated_state/main.py
@@ -1,7 +1,7 @@
import json
from pathlib import Path
-from idom import component, hooks, html, run
+from reactpy import component, hooks, html, run
HERE = Path(__file__)
diff --git a/docs/source/guides/adding-interactivity/components-with-state/_examples/multiple_state_variables/main.py b/docs/source/guides/adding-interactivity/components-with-state/_examples/multiple_state_variables/main.py
index 2ab39e5e0..3d31b1bfa 100644
--- a/docs/source/guides/adding-interactivity/components-with-state/_examples/multiple_state_variables/main.py
+++ b/docs/source/guides/adding-interactivity/components-with-state/_examples/multiple_state_variables/main.py
@@ -1,7 +1,7 @@
import json
from pathlib import Path
-from idom import component, hooks, html, run
+from reactpy import component, hooks, html, run
HERE = Path(__file__)
diff --git a/docs/source/guides/adding-interactivity/components-with-state/_examples/when_variables_are_not_enough/main.py b/docs/source/guides/adding-interactivity/components-with-state/_examples/when_variables_are_not_enough/main.py
index 7558fc328..c617586de 100644
--- a/docs/source/guides/adding-interactivity/components-with-state/_examples/when_variables_are_not_enough/main.py
+++ b/docs/source/guides/adding-interactivity/components-with-state/_examples/when_variables_are_not_enough/main.py
@@ -7,7 +7,7 @@
import json
from pathlib import Path
-from idom import component, html, run
+from reactpy import component, html, run
HERE = Path(__file__)
diff --git a/docs/source/guides/adding-interactivity/components-with-state/index.rst b/docs/source/guides/adding-interactivity/components-with-state/index.rst
index 5317b98a2..f8235ac0d 100644
--- a/docs/source/guides/adding-interactivity/components-with-state/index.rst
+++ b/docs/source/guides/adding-interactivity/components-with-state/index.rst
@@ -5,7 +5,7 @@ Components often need to change what’s on the screen as a result of an interac
example, typing into the form should update the input field, clicking “next” on an image
carousel should change which image is displayed, clicking “buy” should put a product in
the shopping cart. Components need to “remember” things like the current input value,
-the current image, the shopping cart. In IDOM, this kind of component-specific memory is
+the current image, the shopping cart. In ReactPy, this kind of component-specific memory is
called state.
@@ -16,7 +16,7 @@ Below is a gallery of images about sculpture. Clicking the "Next" button should
increment the ``index`` and, as a result, change what image is displayed. However, this
does not work:
-.. idom:: _examples/when_variables_are_not_enough
+.. reactpy:: _examples/when_variables_are_not_enough
.. note::
@@ -36,10 +36,10 @@ that still wouldn't fix the underlying problems:
destroyed when it updates.
2. **Changes to local variables do not cause components to re-render** - there's no way
- for IDOM to observe when these variables change. Thus IDOM is not aware that
+ for ReactPy to observe when these variables change. Thus ReactPy is not aware that
something has changed and that a re-render should take place.
-To address these problems, IDOM provides the :func:`~idom.core.hooks.use_state` "hook"
+To address these problems, ReactPy provides the :func:`~reactpy.core.hooks.use_state` "hook"
which provides:
1. A **state variable** whose data is retained across renders.
@@ -51,12 +51,12 @@ which provides:
Adding State to Components
--------------------------
-To create a state variable and state setter with :func:`~idom.core.hooks.use_state` hook
+To create a state variable and state setter with :func:`~reactpy.core.hooks.use_state` hook
as described above, we'll begin by importing it:
.. testcode::
- from idom import use_state
+ from reactpy import use_state
Then we'll make the following changes to our code :ref:`from before `:
@@ -84,16 +84,16 @@ After making those changes we should get:
We'll talk more about what this is doing :ref:`shortly `, but for
now let's just verify that this does in fact fix the problems from before:
-.. idom:: _examples/adding_state_variable
+.. reactpy:: _examples/adding_state_variable
Your First Hook
---------------
-In IDOM, ``use_state``, as well as any other function whose name starts with ``use``, is
-called a "hook". These are special functions that should only be called while IDOM is
+In ReactPy, ``use_state``, as well as any other function whose name starts with ``use``, is
+called a "hook". These are special functions that should only be called while ReactPy is
:ref:`rendering `. They let you "hook into" the different
-capabilities of IDOM's components of which ``use_state`` is just one (well get into the
+capabilities of ReactPy's components of which ``use_state`` is just one (well get into the
other :ref:`later `).
While hooks are just normal functions, but it's helpful to think of them as
@@ -107,7 +107,7 @@ words, you'll "use" hooks at the top of your component in the same way you might
Introduction to ``use_state``
-----------------------------
-When you call :func:`~idom.core.hooks.use_state` inside the body of a component's render
+When you call :func:`~reactpy.core.hooks.use_state` inside the body of a component's render
function, you're declaring that this component needs to remember something. That
"something" which needs to be remembered, is known as **state**. So when we look at an
assignment expression like the one below
@@ -156,7 +156,7 @@ below highlights a line of code where something of interest occurs:
:emphasize-lines: 2
At this point, we've just begun to render the ``Gallery`` component. As yet,
- IDOM is not aware that this component has any state or what view it will
+ ReactPy is not aware that this component has any state or what view it will
display. This will change in a moment though when we move to the next line...
.. tab-item:: 2
@@ -169,7 +169,7 @@ below highlights a line of code where something of interest occurs:
:lines: 12-33
:emphasize-lines: 3
- The ``Gallery`` component has just declared some state. IDOM now knows that it
+ The ``Gallery`` component has just declared some state. ReactPy now knows that it
must remember the ``index`` and trigger an update of this component when
``set_index`` is called. Currently the value of ``index`` is ``0`` as per the
default value given to ``use_state``. Thus, the resulting view will display
@@ -216,7 +216,7 @@ below highlights a line of code where something of interest occurs:
:lines: 12-33
:emphasize-lines: 5
- A user has just clicked the button 🖱️! IDOM has sent information about the event
+ A user has just clicked the button 🖱️! ReactPy has sent information about the event
to the ``handle_click`` function and it is about to execute. In a moment we will
update the state of this component and schedule a re-render.
@@ -230,7 +230,7 @@ below highlights a line of code where something of interest occurs:
:lines: 12-33
:emphasize-lines: 6
- We've just now told IDOM that we want to update the state of our ``Gallery`` and
+ We've just now told ReactPy that we want to update the state of our ``Gallery`` and
that it needs to be re-rendered. More specifically, we are incrementing its
``index``, and once ``Gallery`` re-renders the index *will* be ``1``.
Importantly, at this point, the value of ``index`` is still ``0``! This will
@@ -246,7 +246,7 @@ below highlights a line of code where something of interest occurs:
:lines: 12-33
:emphasize-lines: 2
- The scheduled re-render of ``Gallery`` has just begun. IDOM has now updated its
+ The scheduled re-render of ``Gallery`` has just begun. ReactPy has now updated its
internal state store such that, the next time we call ``use_state`` we will get
back the updated value of ``index``.
@@ -260,8 +260,8 @@ below highlights a line of code where something of interest occurs:
:lines: 12-33
:emphasize-lines: 3
- With IDOM's state store updated, as we call ``use_state``, instead of returning
- ``0`` for the value of ``index`` as it did before, IDOM now returns the value
+ With ReactPy's state store updated, as we call ``use_state``, instead of returning
+ ``0`` for the value of ``index`` as it did before, ReactPy now returns the value
``1``. With this change the view we display will be altered - instead of
displaying data for the first item in our ``sculpture_data`` list we will now
display information about the second.
@@ -293,14 +293,14 @@ below highlights a line of code where something of interest occurs:
Multiple State Declarations
---------------------------
-The powerful thing about hooks like :func:`~idom.core.hooks.use_state` is that you're
+The powerful thing about hooks like :func:`~reactpy.core.hooks.use_state` is that you're
not limited to just one state declaration. You can call ``use_state()`` as many times as
you need to in one component. For example, in the example below we've added a
``show_more`` state variable along with a few other modifications (e.g. renaming
``handle_click``) to make the description for each sculpture optionally displayed. Only
when the user clicks the "Show details" button is this description shown:
-.. idom:: _examples/multiple_state_variables
+.. reactpy:: _examples/multiple_state_variables
It's generally a good idea to define separate state variables if the data they represent
is unrelated. In this case, ``index`` corresponds to what sculpture information is being
@@ -326,7 +326,7 @@ In this example, the ``Gallery`` component from earlier is rendered twice with n
changes to its logic. Try clicking the buttons inside each of the galleries. Notice that
their state is independent:
-.. idom:: _examples/isolated_state
+.. reactpy:: _examples/isolated_state
:result-is-default-tab:
This is what makes state different from regular variables that you might declare at the
@@ -347,5 +347,5 @@ remove it without impacting the rest of the components.
^^^^^^^^^^^^^^^^^^^^^^^^^
What if you wanted both galleries to keep their states in sync? The right way to do
- it in IDOM is to remove state from child components and add it to their closest
+ it in ReactPy is to remove state from child components and add it to their closest
shared parent.
diff --git a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_remove.py b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_remove.py
index c3ca24266..6c3c783da 100644
--- a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_remove.py
+++ b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_remove.py
@@ -1,4 +1,4 @@
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_update.py b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_update.py
index 518bd3132..32dd4073a 100644
--- a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_update.py
+++ b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_update.py
@@ -1,4 +1,4 @@
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_insert.py b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_insert.py
index 98617e341..1f4072e0b 100644
--- a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_insert.py
+++ b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_insert.py
@@ -1,4 +1,4 @@
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_re_order.py b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_re_order.py
index 37ce97f7d..b3bf5a85a 100644
--- a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_re_order.py
+++ b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_re_order.py
@@ -1,4 +1,4 @@
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_remove.py b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_remove.py
index 3a9126802..6223284f6 100644
--- a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_remove.py
+++ b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_remove.py
@@ -1,4 +1,4 @@
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_replace.py b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_replace.py
index ce9ae1aec..4952b9597 100644
--- a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_replace.py
+++ b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_replace.py
@@ -1,4 +1,4 @@
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/moving_dot.py b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/moving_dot.py
index 6e5e66b67..e5ab54dca 100644
--- a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/moving_dot.py
+++ b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/moving_dot.py
@@ -1,4 +1,4 @@
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/moving_dot_broken.py b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/moving_dot_broken.py
index 68198c93a..8972ce74e 100644
--- a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/moving_dot_broken.py
+++ b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/moving_dot_broken.py
@@ -1,6 +1,6 @@
# :linenos:
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/set_remove.py b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/set_remove.py
index a56eaa9ab..be5366cb2 100644
--- a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/set_remove.py
+++ b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/set_remove.py
@@ -1,4 +1,4 @@
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/set_update.py b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/set_update.py
index 0d38462fa..8ff2e1ca4 100644
--- a/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/set_update.py
+++ b/docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/set_update.py
@@ -1,4 +1,4 @@
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/dangers-of-mutability/index.rst b/docs/source/guides/adding-interactivity/dangers-of-mutability/index.rst
index 80a4e6a04..35dfe580a 100644
--- a/docs/source/guides/adding-interactivity/dangers-of-mutability/index.rst
+++ b/docs/source/guides/adding-interactivity/dangers-of-mutability/index.rst
@@ -2,7 +2,7 @@ Dangers of Mutability
=====================
While state can hold any type of value, you should be careful to avoid directly
-modifying objects that you declare as state with IDOM. In other words, you must not
+modifying objects that you declare as state with ReactPy. In other words, you must not
:ref:`"mutate" ` values which are held as state. Rather, to change
these values you should use new ones or create copies.
@@ -51,13 +51,13 @@ have not had to consider the consiquences of mutations.
Why Avoid Mutation?
-------------------
-Unfortunately, IDOM does not understand that when a value is mutated, it may have
+Unfortunately, ReactPy does not understand that when a value is mutated, it may have
changed. As a result, mutating values will not trigger re-renders. Thus, you must be
-careful to avoid mutation whenever you want IDOM to re-render a component. For example,
+careful to avoid mutation whenever you want ReactPy to re-render a component. For example,
the intention of the code below is to make the red dot move when you touch or hover over
the preview area. However it doesn't - the dot remains stationary:
-.. idom:: _examples/moving_dot_broken
+.. reactpy:: _examples/moving_dot_broken
The problem is with this section of code:
@@ -68,7 +68,7 @@ The problem is with this section of code:
:lineno-start: 13
This code mutates the ``position`` dictionary from the prior render instead of using the
-state variable's associated state setter. Without calling setter IDOM has no idea that
+state variable's associated state setter. Without calling setter ReactPy has no idea that
the variable's data has been modified. While it can be possible to get away with
mutating state variables, it's highly dicsouraged. Doing so can cause strange and
unpredictable behavior. As a result, you should always treat the data within a state
@@ -80,7 +80,7 @@ call it by passing a *new* dictionary with the values for the next render. Notic
by making these alterations to the code, that the dot now follows your pointer when
you touch or hover over the preview:
-.. idom:: _examples/moving_dot
+.. reactpy:: _examples/moving_dot
.. dropdown:: Local mutation can be alright
@@ -208,7 +208,7 @@ updating user information with a preview of the currently entered data. We can
accomplish this using `"unpacking" `__ with
the ``**`` syntax:
-.. idom:: _examples/dict_update
+.. reactpy:: _examples/dict_update
.. _removing-dictionary-items:
@@ -249,7 +249,7 @@ set of keys. One way to do this is with a dictionary comprehension. The example
shows an interface where you're able to enter a new term and definition. Once added,
you can click a delete button to remove the term and definition:
-.. idom:: _examples/dict_remove
+.. reactpy:: _examples/dict_remove
Working with Lists
@@ -349,7 +349,7 @@ the items we want to append instead. There are several ways to do this for one o
values however it's often simplest to use `"unpacking"
`__ with the ``*`` syntax.
-.. idom:: _examples/list_insert
+.. reactpy:: _examples/list_insert
.. _removing-list-items:
@@ -378,7 +378,7 @@ not quite as clean. You must select the portion the list prior to the item which
be removed (``l[:index]``) and the portion after the item (``l[index + 1:]``) and add
them together:
-.. idom:: _examples/list_remove
+.. reactpy:: _examples/list_remove
.. _replacing-list-items:
@@ -409,7 +409,7 @@ must select the portion before and after the item in question. But this time, in
of adding those two selections together, you must insert that values you want to replace
between them:
-.. idom:: _examples/list_replace
+.. reactpy:: _examples/list_replace
.. _re-ordering-list-items:
@@ -441,7 +441,7 @@ list object, you should use the builtin functions :func:`sorted` and :func:`reve
and pass the resulting iterator into the :class:`list` constructor to create a sorted
or reversed copy of the given list:
-.. idom:: _examples/list_re_order
+.. reactpy:: _examples/list_re_order
Working with Sets
@@ -512,7 +512,7 @@ or operator ``|`` serves as a succinct way to compute the union of two sets. How
you should be careful to not use an in-place assignment with this operator as that will
(counterintuitively) mutate the original set rather than creating a new one.
-.. idom:: _examples/set_update
+.. reactpy:: _examples/set_update
.. _removing-set-items:
@@ -558,7 +558,7 @@ methods to return new sets without mutating them. As before when :ref:`adding se
you need to avoid using the inline assignment operators since that will
(counterintuitively) mutate the original set rather than given you a new one:
-.. idom:: _examples/set_remove
+.. reactpy:: _examples/set_remove
Useful Packages
diff --git a/docs/source/guides/adding-interactivity/index.rst b/docs/source/guides/adding-interactivity/index.rst
index a09db3f51..5f08bc5e4 100644
--- a/docs/source/guides/adding-interactivity/index.rst
+++ b/docs/source/guides/adding-interactivity/index.rst
@@ -56,11 +56,11 @@ Adding Interactivity
Section 1: Responding to Events
-------------------------------
-IDOM lets you add event handlers to your parts of the interface. This means that you can
+ReactPy lets you add event handlers to your parts of the interface. This means that you can
define synchronous or asynchronous functions that are triggered when a particular user
interaction occurs like clicking, hovering, of focusing on form inputs, and more.
-.. idom:: responding-to-events/_examples/button_prints_message
+.. reactpy:: responding-to-events/_examples/button_prints_message
It may feel weird to define a function within a function like this, but doing so allows
the ``handle_event`` function to access information from within the scope of the
@@ -85,16 +85,16 @@ Components often need to change what’s on the screen as a result of an interac
example, typing into the form should update the input field, clicking a “Comment” button
should bring up a text input field, clicking “Buy” should put a product in the shopping
cart. Components need to “remember” things like the current input value, the current
-image, the shopping cart. In IDOM, this kind of component-specific memory is created and
+image, the shopping cart. In ReactPy, this kind of component-specific memory is created and
updated with a "hook" called ``use_state()`` that creates a **state variable** and
**state setter** respectively:
-.. idom:: components-with-state/_examples/adding_state_variable
+.. reactpy:: components-with-state/_examples/adding_state_variable
-In IDOM, ``use_state``, as well as any other function whose name starts with ``use``, is
-called a "hook". These are special functions that should only be called while IDOM is
+In ReactPy, ``use_state``, as well as any other function whose name starts with ``use``, is
+called a "hook". These are special functions that should only be called while ReactPy is
:ref:`rendering `. They let you "hook into" the different
-capabilities of IDOM's components of which ``use_state`` is just one (well get into the
+capabilities of ReactPy's components of which ``use_state`` is just one (well get into the
other :ref:`later `).
.. card::
@@ -122,7 +122,7 @@ which owns the state.
set_count(count + 1) # schedule a re-render where count is 1
print(count) # still prints: 0
-This behavior of IDOM means that each render of a component is like taking a snapshot of
+This behavior of ReactPy means that each render of a component is like taking a snapshot of
the UI based on the component's state at that time. Treating state in this way can help
reduce subtle bugs. For instance, in the code below there's a simple chat app with a
message input and recipient selector. The catch is that the message actually gets sent 5
@@ -130,7 +130,7 @@ seconds after the "Send" button is clicked. So what would happen if we changed t
recipient between the time the "Send" button was clicked and the moment the message is
actually sent?
-.. idom:: state-as-a-snapshot/_examples/print_chat_message
+.. reactpy:: state-as-a-snapshot/_examples/print_chat_message
As it turns out, changing the message recipient after pressing send does not change
where the message ulitmately goes. However, one could imagine a bug where the recipient
@@ -138,7 +138,7 @@ of a message is determined at the time the message is sent rather than at the ti
"Send" button it clicked. Thus changing the recipient after pressing send would change
where the message got sent.
-In many cases, IDOM avoids this class of bug entirely because it treats state as a
+In many cases, ReactPy avoids this class of bug entirely because it treats state as a
snapshot.
.. card::
@@ -159,10 +159,10 @@ changes to state only take effect in the next render, not in the current one. Fu
changes to state are batched, calling a particular state setter 3 times won't trigger 3
renders, it will only trigger 1. This means that multiple state assignments are batched
- so long as the event handler is synchronous (i.e. the event handler is not an
-``async`` function), IDOM waits until all the code in an event handler has run before
+``async`` function), ReactPy waits until all the code in an event handler has run before
processing state and starting the next render:
-.. idom:: multiple-state-updates/_examples/set_color_3_times
+.. reactpy:: multiple-state-updates/_examples/set_color_3_times
Sometimes though, you need to update a state variable more than once before the next
render. In these cases, instead of having updates batched, you instead want them to be
@@ -172,7 +172,7 @@ To accomplish this, instead of passing the next state value directly (e.g.
``compute_new_state(old_state)`` to the state setter (e.g.
``set_state(compute_new_state)``):
-.. idom:: multiple-state-updates/_examples/set_state_function
+.. reactpy:: multiple-state-updates/_examples/set_state_function
.. card::
:link: multiple-state-updates/index
@@ -188,17 +188,17 @@ Section 5: Dangers of Mutability
--------------------------------
While state can hold any type of value, you should be careful to avoid directly
-modifying objects that you declare as state with IDOM. In other words, you must not
+modifying objects that you declare as state with ReactPy. In other words, you must not
:ref:`"mutate" ` values which are held as state. Rather, to change
these values you should use new ones or create copies.
-This is because IDOM does not understand that when a value is mutated, it may have
+This is because ReactPy does not understand that when a value is mutated, it may have
changed. As a result, mutating values will not trigger re-renders. Thus, you must be
-careful to avoid mutation whenever you want IDOM to re-render a component. For example,
+careful to avoid mutation whenever you want ReactPy to re-render a component. For example,
instead of mutating dictionaries to update their items you should instead create a
copy that contains the desired changes:
-.. idom:: dangers-of-mutability/_examples/dict_update
+.. reactpy:: dangers-of-mutability/_examples/dict_update
.. card::
:link: dangers-of-mutability/index
diff --git a/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/delay_before_count_updater.py b/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/delay_before_count_updater.py
index 77a723b03..e53c5b1ad 100644
--- a/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/delay_before_count_updater.py
+++ b/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/delay_before_count_updater.py
@@ -1,6 +1,6 @@
import asyncio
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/delay_before_set_count.py b/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/delay_before_set_count.py
index f3df72475..bb64724f1 100644
--- a/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/delay_before_set_count.py
+++ b/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/delay_before_set_count.py
@@ -1,6 +1,6 @@
import asyncio
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/set_color_3_times.py b/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/set_color_3_times.py
index d4c8f3e77..59d7d0f20 100644
--- a/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/set_color_3_times.py
+++ b/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/set_color_3_times.py
@@ -1,4 +1,4 @@
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/set_state_function.py b/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/set_state_function.py
index cdf8931fe..56bbe80e3 100644
--- a/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/set_state_function.py
+++ b/docs/source/guides/adding-interactivity/multiple-state-updates/_examples/set_state_function.py
@@ -1,4 +1,4 @@
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
def increment(old_number):
diff --git a/docs/source/guides/adding-interactivity/multiple-state-updates/index.rst b/docs/source/guides/adding-interactivity/multiple-state-updates/index.rst
index 73524e173..6cfc415cd 100644
--- a/docs/source/guides/adding-interactivity/multiple-state-updates/index.rst
+++ b/docs/source/guides/adding-interactivity/multiple-state-updates/index.rst
@@ -15,16 +15,16 @@ This is why, in the example below, even though it might seem like clicking the
"Increment" button would cause the ``number`` to increase by ``3``, it only does by
``1``:
-.. idom:: ../state-as-a-snapshot/_examples/set_counter_3_times
+.. reactpy:: ../state-as-a-snapshot/_examples/set_counter_3_times
The reason this happens is because, so long as the event handler is synchronous (i.e.
-the event handler is not an ``async`` function), IDOM waits until all the code in an
+the event handler is not an ``async`` function), ReactPy waits until all the code in an
event handler has run before processing state and starting the next render. Thus, it's
the last call to a given state setter that matters. In the example below, even though we
set the color of the button to ``"orange"`` and then ``"pink"`` before ``"blue"``,
the color does not quickly flash orange and pink before blue - it alway remains blue:
-.. idom:: _examples/set_color_3_times
+.. reactpy:: _examples/set_color_3_times
This behavior let's you make multiple state changes without triggering unnecessary
renders or renders with inconsistent state where only some of the variables have been
@@ -33,13 +33,13 @@ handlers have finished running.
.. note::
- For asynchronous event handlers, IDOM will not render until you ``await`` something.
+ For asynchronous event handlers, ReactPy will not render until you ``await`` something.
As we saw in :ref:`prior examples `, if you introduce
an asynchronous delay to an event handler after changing state, renders may take
place before the remainder of the event handler completes. However, state variables
within handlers, even async ones, always remains static.
-This behavior of IDOM to "batch" state changes that take place inside a single event
+This behavior of ReactPy to "batch" state changes that take place inside a single event
handler, do not extend across event handlers. In other words, distinct events will
always produce distinct renders. To give an example, if clicking a button increments a
counter by one, no matter how fast the user clicks, the view will never jump from 1 to 3
@@ -77,9 +77,9 @@ In our case, ``new_state = old_state + 1``. So we might define:
Which we can use to replace ``set_number(number + 1)`` with ``set_number(increment)``:
-.. idom:: _examples/set_state_function
+.. reactpy:: _examples/set_state_function
-The way to think about how IDOM runs though this series of ``set_state(increment)``
+The way to think about how ReactPy runs though this series of ``set_state(increment)``
calls is to imagine that each one updates the internally managed state with its return
value, then that return value is being passed to the next updater function. Ultimately,
this is functionally equivalent to the following:
@@ -94,14 +94,14 @@ introduced a delay before ``set_number(number + 1)``. What would happen if we cl
the "Increment" button more than once before the delay in the first triggered event
completed?
-.. idom:: _examples/delay_before_set_count
+.. reactpy:: _examples/delay_before_set_count
From an :ref:`earlier lesson `, we learned that introducing
delays do not change the fact that state variables do not change until the next render.
As a result, despite clicking many times before the delay completes, the ``number`` only
increments by one. To solve this we can use updater functions:
-.. idom:: _examples/delay_before_count_updater
+.. reactpy:: _examples/delay_before_count_updater
Now when you click the "Increment" button, each click, though delayed, corresponds to
``number`` being increased. This is because the ``old_number`` in the updater function
diff --git a/docs/source/guides/adding-interactivity/responding-to-events/_examples/audio_player.py b/docs/source/guides/adding-interactivity/responding-to-events/_examples/audio_player.py
index 41e216971..82826c50d 100644
--- a/docs/source/guides/adding-interactivity/responding-to-events/_examples/audio_player.py
+++ b/docs/source/guides/adding-interactivity/responding-to-events/_examples/audio_player.py
@@ -1,21 +1,21 @@
import json
-import idom
+import reactpy
-@idom.component
+@reactpy.component
def PlayDinosaurSound():
- event, set_event = idom.hooks.use_state(None)
- return idom.html.div(
- idom.html.audio(
+ event, set_event = reactpy.hooks.use_state(None)
+ return reactpy.html.div(
+ reactpy.html.audio(
{
"controls": True,
"on_time_update": lambda e: set_event(e),
"src": "https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3",
}
),
- idom.html.pre(json.dumps(event, indent=2)),
+ reactpy.html.pre(json.dumps(event, indent=2)),
)
-idom.run(PlayDinosaurSound)
+reactpy.run(PlayDinosaurSound)
diff --git a/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_async_handlers.py b/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_async_handlers.py
index a1c57eb03..992641e00 100644
--- a/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_async_handlers.py
+++ b/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_async_handlers.py
@@ -1,6 +1,6 @@
import asyncio
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_does_nothing.py b/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_does_nothing.py
index e26e770d2..ea8313263 100644
--- a/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_does_nothing.py
+++ b/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_does_nothing.py
@@ -1,4 +1,4 @@
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_handler_as_arg.py b/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_handler_as_arg.py
index f08bcd95f..e5276bef3 100644
--- a/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_handler_as_arg.py
+++ b/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_handler_as_arg.py
@@ -1,4 +1,4 @@
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_prints_event.py b/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_prints_event.py
index 32854d8f6..38638db4b 100644
--- a/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_prints_event.py
+++ b/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_prints_event.py
@@ -1,4 +1,4 @@
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_prints_message.py b/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_prints_message.py
index e2790ce52..56118a57f 100644
--- a/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_prints_message.py
+++ b/docs/source/guides/adding-interactivity/responding-to-events/_examples/button_prints_message.py
@@ -1,4 +1,4 @@
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/adding-interactivity/responding-to-events/_examples/prevent_default_event_actions.py b/docs/source/guides/adding-interactivity/responding-to-events/_examples/prevent_default_event_actions.py
index 3b9cfc1ae..d3f0941bd 100644
--- a/docs/source/guides/adding-interactivity/responding-to-events/_examples/prevent_default_event_actions.py
+++ b/docs/source/guides/adding-interactivity/responding-to-events/_examples/prevent_default_event_actions.py
@@ -1,4 +1,4 @@
-from idom import component, event, html, run
+from reactpy import component, event, html, run
@component
diff --git a/docs/source/guides/adding-interactivity/responding-to-events/_examples/stop_event_propagation.py b/docs/source/guides/adding-interactivity/responding-to-events/_examples/stop_event_propagation.py
index 0a7543ce7..15e345bdd 100644
--- a/docs/source/guides/adding-interactivity/responding-to-events/_examples/stop_event_propagation.py
+++ b/docs/source/guides/adding-interactivity/responding-to-events/_examples/stop_event_propagation.py
@@ -1,4 +1,4 @@
-from idom import component, event, hooks, html, run
+from reactpy import component, event, hooks, html, run
@component
diff --git a/docs/source/guides/adding-interactivity/responding-to-events/index.rst b/docs/source/guides/adding-interactivity/responding-to-events/index.rst
index 6e916b6bf..26f1c49e4 100644
--- a/docs/source/guides/adding-interactivity/responding-to-events/index.rst
+++ b/docs/source/guides/adding-interactivity/responding-to-events/index.rst
@@ -1,7 +1,7 @@
Responding to Events
====================
-IDOM lets you add event handlers to your parts of the interface. These events handlers
+ReactPy lets you add event handlers to your parts of the interface. These events handlers
are functions which can be assigned to a part of a UI such that, when a user iteracts
with the interface, those functions get triggered. Examples of interaction include
clicking, hovering, of focusing on form inputs, and more.
@@ -12,7 +12,7 @@ Adding Event Handlers
To start out we'll just display a button that, for the moment, doesn't do anything:
-.. idom:: _examples/button_does_nothing
+.. reactpy:: _examples/button_does_nothing
To add an event handler to this button we'll do three things:
@@ -20,19 +20,19 @@ To add an event handler to this button we'll do three things:
2. Add logic to ``handle_event`` that will print the ``event`` it receives to the console.
3. Add an ``"onClick": handle_event`` attribute to the ```` element.
-.. idom:: _examples/button_prints_event
+.. reactpy:: _examples/button_prints_event
.. note::
Normally print statements will only be displayed in the terminal where you launched
- IDOM.
+ ReactPy.
It may feel weird to define a function within a function like this, but doing so allows
the ``handle_event`` function to access information from within the scope of the
component. That's important if you want to use any arguments that may have beend passed
your component in the handler:
-.. idom:: _examples/button_prints_message
+.. reactpy:: _examples/button_prints_message
With all that said, since our ``handle_event`` function isn't doing that much work, if
we wanted to streamline our component definition, we could pass in our event handler as a
@@ -46,9 +46,9 @@ lambda:
Supported Event Types
---------------------
-Since IDOM's event information comes from React, most the the information (:ref:`with
+Since ReactPy's event information comes from React, most the the information (:ref:`with
some exceptions `) about how React handles events translates
-directly to IDOM. Follow the links below to learn about each category of event:
+directly to ReactPy. Follow the links below to learn about each category of event:
- :ref:`Clipboard Events`
- :ref:`Composition Events`
@@ -77,7 +77,7 @@ generic component definition. This allows the component to focus on the things w
common while still giving its usages customizablity. Consider the case below where we
want to create a generic ``Button`` component that can be used for a variety of purpose:
-.. idom:: _examples/button_handler_as_arg
+.. reactpy:: _examples/button_handler_as_arg
.. _Async Event Handler:
@@ -86,13 +86,13 @@ Async Event Handlers
--------------------
Sometimes event handlers need to execute asynchronous tasks when they are triggered.
-Behind the scenes, IDOM is running an :mod:`asyncio` event loop for just this purpose.
+Behind the scenes, ReactPy is running an :mod:`asyncio` event loop for just this purpose.
By defining your event handler as an asynchronous function instead of a normal
synchronous one. In the layout below we sleep for several seconds before printing out a
message in the first button. However, because the event handler is asynchronous, the
handler for the second button is still able to respond:
-.. idom:: _examples/button_async_handlers
+.. reactpy:: _examples/button_async_handlers
Event Data Serialization
@@ -105,15 +105,15 @@ to demonstrate this is the ``currentTime`` attribute of ``audio`` and ``video``
elements. Normally this would be accessible via ``event.target.currentTime``, but here
it's simply passed in under the key ``currentTime``:
-.. idom:: _examples/audio_player
+.. reactpy:: _examples/audio_player
Client-side Event Behavior
--------------------------
-Because IDOM operates server-side, there are inevitable limitations that prevent it from
+Because ReactPy operates server-side, there are inevitable limitations that prevent it from
achieving perfect parity with all the behaviors of React. With that said, any feature
-that cannot be achieved in Python with IDOM, can be done by creating
+that cannot be achieved in Python with ReactPy, can be done by creating
:ref:`Custom Javascript Components`.
@@ -122,10 +122,10 @@ Preventing Default Event Actions
Instead of calling an ``event.preventDefault()`` method as you would do in React, you
must declare whether to prevent default behavior ahead of time. This can be accomplished
-using the :func:`~idom.core.events.event` decorator and setting ``prevent_default``. For
+using the :func:`~reactpy.core.events.event` decorator and setting ``prevent_default``. For
example, we can stop a link from going to the specified URL:
-.. idom:: _examples/prevent_default_event_actions
+.. reactpy:: _examples/prevent_default_event_actions
Unfortunately this means you cannot conditionally prevent default behavior in response
to event data without writing :ref:`Custom Javascript Components`.
@@ -135,10 +135,10 @@ Stop Event Propogation
......................
Similarly to :ref:`preventing default behavior `, you
-can use the :func:`~idom.core.events.event` decorator to prevent events originating in a
+can use the :func:`~reactpy.core.events.event` decorator to prevent events originating in a
child element from propagating to parent elements by setting ``stop_propagation``. In
the example below we place a red ``div`` inside a parent blue ``div``. When propogation
is turned on, clicking the red element will cause the handler for the outer blue one to
trigger. Conversely, when it's off, only the handler for the red element will trigger.
-.. idom:: _examples/stop_event_propagation
+.. reactpy:: _examples/stop_event_propagation
diff --git a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/delayed_print_after_set.py b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/delayed_print_after_set.py
index 9a554010d..b6295b09f 100644
--- a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/delayed_print_after_set.py
+++ b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/delayed_print_after_set.py
@@ -1,6 +1,6 @@
import asyncio
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/print_chat_message.py b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/print_chat_message.py
index bc9c05d2f..ecbad9381 100644
--- a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/print_chat_message.py
+++ b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/print_chat_message.py
@@ -1,6 +1,6 @@
import asyncio
-from idom import component, event, html, run, use_state
+from reactpy import component, event, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/print_count_after_set.py b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/print_count_after_set.py
index 38ca0c005..40ee78259 100644
--- a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/print_count_after_set.py
+++ b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/print_count_after_set.py
@@ -1,4 +1,4 @@
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/send_message.py b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/send_message.py
index c92c2c206..4702a7464 100644
--- a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/send_message.py
+++ b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/send_message.py
@@ -1,4 +1,4 @@
-from idom import component, event, html, run, use_state
+from reactpy import component, event, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/set_counter_3_times.py b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/set_counter_3_times.py
index a09c6d34b..fe97351af 100644
--- a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/set_counter_3_times.py
+++ b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/set_counter_3_times.py
@@ -1,4 +1,4 @@
-from idom import component, html, run, use_state
+from reactpy import component, html, run, use_state
@component
diff --git a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_static/direct-state-change.png b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_static/direct-state-change.png
index fdcfebd1e..cfcd9c87f 100644
Binary files a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_static/direct-state-change.png and b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_static/direct-state-change.png differ
diff --git a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_static/idom-state-change.png b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_static/idom-state-change.png
deleted file mode 100644
index ec13fdc7a..000000000
Binary files a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_static/idom-state-change.png and /dev/null differ
diff --git a/docs/source/guides/adding-interactivity/state-as-a-snapshot/_static/reactpy-state-change.png b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_static/reactpy-state-change.png
new file mode 100644
index 000000000..b36b0514a
Binary files /dev/null and b/docs/source/guides/adding-interactivity/state-as-a-snapshot/_static/reactpy-state-change.png differ
diff --git a/docs/source/guides/adding-interactivity/state-as-a-snapshot/index.rst b/docs/source/guides/adding-interactivity/state-as-a-snapshot/index.rst
index e38b2226c..a7ede86ca 100644
--- a/docs/source/guides/adding-interactivity/state-as-a-snapshot/index.rst
+++ b/docs/source/guides/adding-interactivity/state-as-a-snapshot/index.rst
@@ -9,22 +9,22 @@ parts of the view directly. As an illustration, you may think that when a user c
.. image:: _static/direct-state-change.png
-IDOM works a bit differently though - user interactions cause event handlers to
-:ref:`"set state" ` triggering IDOM to re-render a new
+ReactPy works a bit differently though - user interactions cause event handlers to
+:ref:`"set state" ` triggering ReactPy to re-render a new
version of the view rather then mutating the existing one.
-.. image:: _static/idom-state-change.png
+.. image:: _static/reactpy-state-change.png
-Given this, when IDOM "renders" something, it's as if IDOM has taken a snapshot of the
+Given this, when ReactPy "renders" something, it's as if ReactPy has taken a snapshot of the
UI where all the event handlers, local variables and the view itself were calculated
using what state was present at the time of that render. Then, when user iteractions
-trigger state setters, IDOM is made away of the newly set state and schedules a
+trigger state setters, ReactPy is made away of the newly set state and schedules a
re-render. When this subsequent renders occurs it performs all the same calculations as
before, but with this new state.
As we've :ref:`already seen `, state variables are not
like normal variables. Instead, they live outside your components and are managed by
-IDOM. When a component is rendered, IDOM provides the component a snapshot of the state
+ReactPy. When a component is rendered, ReactPy provides the component a snapshot of the state
in that exact moment. As a result, the view returned by that component is itself a
snapshot of the UI at that time.
@@ -42,7 +42,7 @@ Let's experiment with this behaviors of state to see why we should think about i
respect to these "snapshots" in time. Take a look at the example below and try to guess
how it will behave. **What will the count be after you click the "Increment" button?**
-.. idom:: _examples/set_counter_3_times
+.. reactpy:: _examples/set_counter_3_times
Despite the fact that we called ``set_count(count + 1)`` three times, the count only
increments by ``1``! This is perhaps a surprising result, but let's break what's
@@ -68,7 +68,7 @@ above as:
Even though, we called ``set_count`` three times with what might have seemed like
different values, every time we were actually just doing ``set_count(1)`` on each call.
-Only after the event handler returns will IDOM actually perform the next render where
+Only after the event handler returns will ReactPy actually perform the next render where
count is ``1``. When it does, ``number`` will be ``1`` and we'll be able to perform the
same subtitution as before to see what the next number will be after we click
"Increment":
@@ -87,7 +87,7 @@ Given what we :ref:`learned above `, we ought to
to reason about what should happen in the example below. What will be printed when the
"Increment" button is clicked?
-.. idom:: _examples/print_count_after_set
+.. reactpy:: _examples/print_count_after_set
If we use the same subtitution trick we saw before, we can rewrite these lines:
@@ -112,7 +112,7 @@ What if we slightly modify this example, by introducing a delay between when we
``set_number`` and when we print? Will this behavior remain the same? To add this delay
we'll use an :ref:`async event handler` and :func:`~asyncio.sleep` for some time:
-.. idom:: _examples/delayed_print_after_set
+.. reactpy:: _examples/delayed_print_after_set
Even though the render completed before the print statement took place, the behavior
remained the same! Despite the fact that the next render took place before the print
@@ -140,9 +140,9 @@ been sent yet, should not impact where the message is ultimately sent. We then n
ask what actually happens. Will it print “You said Hello to Alice” or “You said Hello to
Bob”?
-.. idom:: _examples/print_chat_message
+.. reactpy:: _examples/print_chat_message
-As it turns out, the code above matches the user's expectation. This is because IDOM
+As it turns out, the code above matches the user's expectation. This is because ReactPy
keeps the state values fixed within the event handlers defined during a particular
render. As a result, you don't need to worry about whether state has changed while
code in an event handler is running.
diff --git a/docs/source/guides/creating-interfaces/html-with-idom/index.rst b/docs/source/guides/creating-interfaces/html-with-reactpy/index.rst
similarity index 78%
rename from docs/source/guides/creating-interfaces/html-with-idom/index.rst
rename to docs/source/guides/creating-interfaces/html-with-reactpy/index.rst
index 6001b7a69..bdc249204 100644
--- a/docs/source/guides/creating-interfaces/html-with-idom/index.rst
+++ b/docs/source/guides/creating-interfaces/html-with-reactpy/index.rst
@@ -1,12 +1,12 @@
-HTML With IDOM
-==============
+HTML With ReactPy
+=================
In a typical Python-base web application the responsibility of defining the view along
with its backing data and logic are distributed between a client and server
-respectively. With IDOM, both these tasks are centralized in a single place. This is
+respectively. With ReactPy, both these tasks are centralized in a single place. This is
done by allowing HTML interfaces to be constructed in Python. Take a look at the two
code examples below. The first one shows how to make a basic title and todo list using
-standard HTML, the second uses IDOM in Python, and below is a view of what the HTML
+standard HTML, the second uses ReactPy in Python, and below is a view of what the HTML
would look like if displayed:
.. grid:: 1 1 2 2
@@ -27,7 +27,7 @@ would look like if displayed:
.. testcode::
- from idom import html
+ from reactpy import html
html.h1("My Todo List")
html.ul(
@@ -48,13 +48,13 @@ would look like if displayed:
-What this shows is that you can recreate the same HTML layouts with IDOM using functions
-from the :mod:`idom.html` module. These function share the same names as their
+What this shows is that you can recreate the same HTML layouts with ReactPy using functions
+from the :mod:`reactpy.html` module. These function share the same names as their
corresponding HTML tags. For instance, the `` `` element above has a similarly named
-:func:`~idom.html.h1` function. With that said, while the code above looks similar, it's
+:func:`~reactpy.html.h1` function. With that said, while the code above looks similar, it's
not very useful because we haven't captured the results from these function calls in a
variable. To do this we need to wrap up the layout above into a single
-:func:`~idom.html.div` and assign it to a variable:
+:func:`~reactpy.html.div` and assign it to a variable:
.. testcode::
@@ -83,8 +83,8 @@ to specify a URL to its ``src`` and use some ``style`` to modify and position it
tabindex="0"
/>
-In IDOM we add these attributes to elements using keyword arguments. There are two main
-notable differences though. First, all names in IDOM use ``snake_case`` instead of
+In ReactPy we add these attributes to elements using keyword arguments. There are two main
+notable differences though. First, all names in ReactPy use ``snake_case`` instead of
dash-separated words. For example, ``tabindex`` and ``margin-left`` become ``tab_index``
and ``margin_left`` respectively. Second, instead of specifying ``style`` using a
string, we use a dictionary. Given this, you can rewrite the `` `` element above as:
@@ -113,10 +113,10 @@ string, we use a dictionary. Given this, you can rewrite the `` `` element a
.. card::
- :link: /guides/understanding-idom/representing-html
+ :link: /guides/understanding-reactpy/representing-html
:link-type: doc
:octicon:`book` Read More
^^^^^^^^^^^^^^^^^^^^^^^^^
- Dive into the data structures IDOM uses to represent HTML
+ Dive into the data structures ReactPy uses to represent HTML
diff --git a/docs/source/guides/creating-interfaces/index.rst b/docs/source/guides/creating-interfaces/index.rst
index f8ec0016c..78466eaef 100644
--- a/docs/source/guides/creating-interfaces/index.rst
+++ b/docs/source/guides/creating-interfaces/index.rst
@@ -4,7 +4,7 @@ Creating Interfaces
.. toctree::
:hidden:
- html-with-idom/index
+ html-with-reactpy/index
your-first-components/index
rendering-data/index
@@ -15,8 +15,8 @@ Creating Interfaces
.. grid:: 1 2 2 2
- .. grid-item-card:: :octicon:`code-square` HTML with IDOM
- :link: html-with-idom/index
+ .. grid-item-card:: :octicon:`code-square` HTML with ReactPy
+ :link: html-with-reactpy/index
:link-type: doc
Construct HTML layouts from the basic units of user interface functionality.
@@ -34,20 +34,20 @@ Creating Interfaces
Use data to organize and render HTML elements and components.
-IDOM is a Python package for making user interfaces (UI). These interfaces are built
-from small elements of functionality like buttons text and images. IDOM allows you to
+ReactPy is a Python package for making user interfaces (UI). These interfaces are built
+from small elements of functionality like buttons text and images. ReactPy allows you to
combine these elements into reusable, nestable :ref:`"components" `. In the sections that follow you'll learn how these UI elements are created
and organized into components. Then, you'll use components to customize and
conditionally display more complex UIs.
-Section 1: HTML with IDOM
--------------------------
+Section 1: HTML with ReactPy
+----------------------------
In a typical Python-base web application the responsibility of defining the view along
with its backing data and logic are distributed between a client and server
-respectively. With IDOM, both these tasks are centralized in a single place. The most
+respectively. With ReactPy, both these tasks are centralized in a single place. The most
foundational pilar of this capability is formed by allowing HTML interfaces to be
constructed in Python. Let's consider the HTML sample below:
@@ -59,11 +59,11 @@ constructed in Python. Let's consider the HTML sample below:
Share it with the world!
-To recreate the same thing in IDOM you would write:
+To recreate the same thing in ReactPy you would write:
.. code-block::
- from idom import html
+ from reactpy import html
html.div(
html.h1("My Todo List"),
@@ -75,7 +75,7 @@ To recreate the same thing in IDOM you would write:
)
.. card::
- :link: html-with-idom/index
+ :link: html-with-reactpy/index
:link-type: doc
:octicon:`book` Read More
@@ -87,14 +87,14 @@ To recreate the same thing in IDOM you would write:
Section 2: Your First Components
--------------------------------
-The next building block in our journey with IDOM are components. At their core,
-components are just a normal Python functions that return :ref:`HTML `.
+The next building block in our journey with ReactPy are components. At their core,
+components are just a normal Python functions that return :ref:`HTML `.
The one special thing about them that we'll concern ourselves with now, is that to
create them we need to add an ``@component`` `decorator
`__. To see what this looks like in
practice we'll quickly make a ``Photo`` component:
-.. idom:: your-first-components/_examples/simple_photo
+.. reactpy:: your-first-components/_examples/simple_photo
.. card::
:link: your-first-components/index
@@ -116,7 +116,7 @@ from data in this way must be organized with :ref:`"keys" `` elements:
.. testcode::
- from idom import html
+ from reactpy import html
list_item_elements = [html.li(text) for text in tasks]
@@ -52,7 +52,7 @@ This list of elements can then be passed into a parent ```` element:
The last thing we have to do is return this from a component:
-.. idom:: _examples/todo_from_list
+.. reactpy:: _examples/todo_from_list
Filtering and Sorting Elements
@@ -105,13 +105,13 @@ and then ordering the elements based on the ``priority``:
We could then add this code to our ``DataList`` component:
-.. idom:: _examples/sorted_and_filtered_todo_list
+.. reactpy:: _examples/sorted_and_filtered_todo_list
Organizing Items With Keys
--------------------------
-If you run the examples above :ref:`in debug mode ` you'll
+If you run the examples above :ref:`in debug mode ` you'll
see the server log a bunch of errors that look something like:
.. code-block:: text
@@ -142,13 +142,13 @@ the element constructor:
list_item_elements = [html.li(t["text"], key=t["id"]) for t in tasks]
-This ``key`` tells IDOM which ```` element corresponds to which item of data in our
+This ``key`` tells ReactPy which `` `` element corresponds to which item of data in our
``tasks`` list. This becomes important if the order or number of items in your list can
change. In our case, if we decided to change whether we want to ``filter_by_priority``
or ``sort_by_priority`` the items in our ```` element would change. Given this,
here's how we'd change our component:
-.. idom:: _examples/todo_list_with_keys
+.. reactpy:: _examples/todo_list_with_keys
Keys for Components
@@ -161,7 +161,7 @@ exact same way that it does for standard HTML elements:
.. testcode::
- from idom import component
+ from reactpy import component
@component
@@ -189,7 +189,7 @@ exact same way that it does for standard HTML elements:
.. testcode::
- from idom import component
+ from reactpy import component
@component
def FunctionWithKeyParam(key):
@@ -288,10 +288,10 @@ use for each ``key``?
.. card::
- :link: /guides/understanding-idom/why-idom-needs-keys
+ :link: /guides/understanding-reactpy/why-reactpy-needs-keys
:link-type: doc
:octicon:`book` Read More
^^^^^^^^^^^^^^^^^^^^^^^^^
- Learn about why IDOM needs keys in the first place.
+ Learn about why ReactPy needs keys in the first place.
diff --git a/docs/source/guides/creating-interfaces/your-first-components/_examples/bad_conditional_todo_list.py b/docs/source/guides/creating-interfaces/your-first-components/_examples/bad_conditional_todo_list.py
index a5de11f77..1ed3268b6 100644
--- a/docs/source/guides/creating-interfaces/your-first-components/_examples/bad_conditional_todo_list.py
+++ b/docs/source/guides/creating-interfaces/your-first-components/_examples/bad_conditional_todo_list.py
@@ -1,4 +1,4 @@
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/creating-interfaces/your-first-components/_examples/good_conditional_todo_list.py b/docs/source/guides/creating-interfaces/your-first-components/_examples/good_conditional_todo_list.py
index f01753d40..cd9ab6fc0 100644
--- a/docs/source/guides/creating-interfaces/your-first-components/_examples/good_conditional_todo_list.py
+++ b/docs/source/guides/creating-interfaces/your-first-components/_examples/good_conditional_todo_list.py
@@ -1,4 +1,4 @@
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/creating-interfaces/your-first-components/_examples/nested_photos.py b/docs/source/guides/creating-interfaces/your-first-components/_examples/nested_photos.py
index 4c512b7e6..96f8531d3 100644
--- a/docs/source/guides/creating-interfaces/your-first-components/_examples/nested_photos.py
+++ b/docs/source/guides/creating-interfaces/your-first-components/_examples/nested_photos.py
@@ -1,4 +1,4 @@
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/creating-interfaces/your-first-components/_examples/parametrized_photos.py b/docs/source/guides/creating-interfaces/your-first-components/_examples/parametrized_photos.py
index 7eacb8f36..665dd8c86 100644
--- a/docs/source/guides/creating-interfaces/your-first-components/_examples/parametrized_photos.py
+++ b/docs/source/guides/creating-interfaces/your-first-components/_examples/parametrized_photos.py
@@ -1,4 +1,4 @@
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/creating-interfaces/your-first-components/_examples/simple_photo.py b/docs/source/guides/creating-interfaces/your-first-components/_examples/simple_photo.py
index c6b92c652..94fa6633f 100644
--- a/docs/source/guides/creating-interfaces/your-first-components/_examples/simple_photo.py
+++ b/docs/source/guides/creating-interfaces/your-first-components/_examples/simple_photo.py
@@ -1,4 +1,4 @@
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/creating-interfaces/your-first-components/_examples/todo_list.py b/docs/source/guides/creating-interfaces/your-first-components/_examples/todo_list.py
index 4f0053c4b..2ffd09261 100644
--- a/docs/source/guides/creating-interfaces/your-first-components/_examples/todo_list.py
+++ b/docs/source/guides/creating-interfaces/your-first-components/_examples/todo_list.py
@@ -1,4 +1,4 @@
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/creating-interfaces/your-first-components/_examples/wrap_in_div.py b/docs/source/guides/creating-interfaces/your-first-components/_examples/wrap_in_div.py
index 2ddcd1060..58ed79dd8 100644
--- a/docs/source/guides/creating-interfaces/your-first-components/_examples/wrap_in_div.py
+++ b/docs/source/guides/creating-interfaces/your-first-components/_examples/wrap_in_div.py
@@ -1,4 +1,4 @@
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/creating-interfaces/your-first-components/_examples/wrap_in_fragment.py b/docs/source/guides/creating-interfaces/your-first-components/_examples/wrap_in_fragment.py
index 027e253bf..cc54d8b71 100644
--- a/docs/source/guides/creating-interfaces/your-first-components/_examples/wrap_in_fragment.py
+++ b/docs/source/guides/creating-interfaces/your-first-components/_examples/wrap_in_fragment.py
@@ -1,4 +1,4 @@
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/creating-interfaces/your-first-components/index.rst b/docs/source/guides/creating-interfaces/your-first-components/index.rst
index 00b409ebb..00b53d1b7 100644
--- a/docs/source/guides/creating-interfaces/your-first-components/index.rst
+++ b/docs/source/guides/creating-interfaces/your-first-components/index.rst
@@ -1,10 +1,10 @@
Your First Components
=====================
-As we learned :ref:`earlier ` we can use IDOM to make rich structured
+As we learned :ref:`earlier ` we can use ReactPy to make rich structured
documents out of standard HTML elements. As these documents become larger and more
complex though, working with these tiny UI elements can become difficult. When this
-happens, IDOM allows you to group these elements together info "components". These
+happens, ReactPy allows you to group these elements together info "components". These
components can then be reused throughout your application.
@@ -16,9 +16,9 @@ component you just need to add a ``@component`` `decorator
`__ to a function. Functions
decorator in this way are known as **render function** and, by convention, we name them
like classes - with ``CamelCase``. So consider what we would do if we wanted to write,
-and then :ref:`display ` a ``Photo`` component:
+and then :ref:`display ` a ``Photo`` component:
-.. idom:: _examples/simple_photo
+.. reactpy:: _examples/simple_photo
.. warning::
@@ -39,7 +39,7 @@ can define a "parent" ``Gallery`` component that returns one or more ``Profile``
components. This is part of what makes components so powerful - you can define a
component once and use it wherever and however you need to:
-.. idom:: _examples/nested_photos
+.. reactpy:: _examples/nested_photos
Return a Single Root Element
@@ -48,17 +48,17 @@ Return a Single Root Element
Components must return a "single root element". That one root element may have children,
but you cannot for example, return a list of element from a component and expect it to
be rendered correctly. If you want to return multiple elements you must wrap them in
-something like a :func:`html.div `:
+something like a :func:`html.div `:
-.. idom:: _examples/wrap_in_div
+.. reactpy:: _examples/wrap_in_div
If don't want to add an extra ``div`` you can use a "fragment" instead with the
-:func:`html._ ` function:
+:func:`html._ ` function:
-.. idom:: _examples/wrap_in_fragment
+.. reactpy:: _examples/wrap_in_fragment
Fragments allow you to group elements together without leaving any trace in the UI. For
-example, the first code sample written with IDOM will produce the second HTML code
+example, the first code sample written with ReactPy will produce the second HTML code
block:
.. grid:: 1 2 2 2
@@ -69,7 +69,7 @@ block:
.. testcode::
- from idom import html
+ from reactpy import html
html.ul(
html._(
@@ -107,7 +107,7 @@ parent components to pass information to child components. Where standard HTML e
are parametrized by dictionaries, since components behave like typical functions you can
give them positional and keyword arguments as you would normally:
-.. idom:: _examples/parametrized_photos
+.. reactpy:: _examples/parametrized_photos
Conditional Rendering
@@ -118,17 +118,17 @@ conditions. Let's imagine that we had a basic todo list where only some of the i
have been completed. Below we have a basic implementation for such a list except that
the ``Item`` component doesn't change based on whether it's ``done``:
-.. idom:: _examples/todo_list
+.. reactpy:: _examples/todo_list
Let's imagine that we want to add a ✔ to the items which have been marked ``done=True``.
One way to do this might be to write an ``if`` statement where we return one ``li``
element if the item is ``done`` and a different one if it's not:
-.. idom:: _examples/bad_conditional_todo_list
+.. reactpy:: _examples/bad_conditional_todo_list
As you can see this accomplishes our goal! However, notice how similar ``html.li(name, "
✔")`` and ``html.li(name)`` are. While in this case it isn't especially harmful, we
could make our code a little easier to read and maintain by using an "inline" ``if``
statement.
-.. idom:: _examples/good_conditional_todo_list
+.. reactpy:: _examples/good_conditional_todo_list
diff --git a/docs/source/guides/escape-hatches/_examples/material_ui_button_no_action.py b/docs/source/guides/escape-hatches/_examples/material_ui_button_no_action.py
index 55817f9dd..f109326e8 100644
--- a/docs/source/guides/escape-hatches/_examples/material_ui_button_no_action.py
+++ b/docs/source/guides/escape-hatches/_examples/material_ui_button_no_action.py
@@ -1,4 +1,4 @@
-from idom import component, run, web
+from reactpy import component, run, web
mui = web.module_from_template(
diff --git a/docs/source/guides/escape-hatches/_examples/material_ui_button_on_click.py b/docs/source/guides/escape-hatches/_examples/material_ui_button_on_click.py
index e7c327ba0..ad3b13cb2 100644
--- a/docs/source/guides/escape-hatches/_examples/material_ui_button_on_click.py
+++ b/docs/source/guides/escape-hatches/_examples/material_ui_button_on_click.py
@@ -1,21 +1,21 @@
import json
-import idom
+import reactpy
-mui = idom.web.module_from_template(
+mui = reactpy.web.module_from_template(
"react@^17.0.0",
"@material-ui/core@4.12.4",
fallback="⌛",
)
-Button = idom.web.export(mui, "Button")
+Button = reactpy.web.export(mui, "Button")
-@idom.component
+@reactpy.component
def ViewButtonEvents():
- event, set_event = idom.hooks.use_state(None)
+ event, set_event = reactpy.hooks.use_state(None)
- return idom.html.div(
+ return reactpy.html.div(
Button(
{
"color": "primary",
@@ -24,8 +24,8 @@ def ViewButtonEvents():
},
"Click Me!",
),
- idom.html.pre(json.dumps(event, indent=2)),
+ reactpy.html.pre(json.dumps(event, indent=2)),
)
-idom.run(ViewButtonEvents)
+reactpy.run(ViewButtonEvents)
diff --git a/docs/source/guides/escape-hatches/_examples/super_simple_chart/main.py b/docs/source/guides/escape-hatches/_examples/super_simple_chart/main.py
index 2f2e17556..b9954b0f2 100644
--- a/docs/source/guides/escape-hatches/_examples/super_simple_chart/main.py
+++ b/docs/source/guides/escape-hatches/_examples/super_simple_chart/main.py
@@ -1,6 +1,6 @@
from pathlib import Path
-from idom import component, run, web
+from reactpy import component, run, web
file = Path(__file__).parent / "super-simple-chart.js"
diff --git a/docs/source/guides/escape-hatches/distributing-javascript.rst b/docs/source/guides/escape-hatches/distributing-javascript.rst
index dfca91fc9..a92166291 100644
--- a/docs/source/guides/escape-hatches/distributing-javascript.rst
+++ b/docs/source/guides/escape-hatches/distributing-javascript.rst
@@ -32,15 +32,15 @@ preparing any package that's been uploaded to NPM_. If you need to roll with you
private CDN, this will likely be more complicated.
In either case though, on the Python side, things are quite simple. You need only pass
-the URL where your package can be found to :func:`~idom.web.module.module_from_url`
+the URL where your package can be found to :func:`~reactpy.web.module.module_from_url`
where you can then load any of its exports:
.. code-block::
- import idom
+ import reactpy
your_module = ido.web.module_from_url("https://some.cdn/your-module")
- YourComponent = idom.web.export(your_module, "YourComponent")
+ YourComponent = reactpy.web.export(your_module, "YourComponent")
Distributing Javascript via PyPI_
@@ -52,7 +52,7 @@ briefly look at what's required. At a high level, we must consider how to...
1. bundle your Javascript into an `ECMAScript Module`)
2. include that Javascript bundle in a Python package
-3. use it as a component in your application using IDOM
+3. use it as a component in your application using ReactPy
In the descriptions to follow we'll be assuming that:
@@ -121,7 +121,7 @@ Your ``package.json`` should include the following:
"dependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1",
- "idom-client-react": "^0.8.5",
+ "@reactpy/client": "^0.8.5",
...
},
...
@@ -159,17 +159,17 @@ we'll be writing ``widget.py`` under that assumption.
};
Your ``widget.py`` file should then load the neighboring bundle file using
-:func:`~idom.web.module.module_from_file`. Then components from that bundle can be
-loaded with :func:`~idom.web.module.export`.
+:func:`~reactpy.web.module.module_from_file`. Then components from that bundle can be
+loaded with :func:`~reactpy.web.module.export`.
.. code-block::
from pathlib import Path
- import idom
+ import reactpy
_BUNDLE_PATH = Path(__file__).parent / "bundle.js"
- _WEB_MODULE = idom.web.module_from_file(
+ _WEB_MODULE = reactpy.web.module_from_file(
# Note that this is the same name from package.json - this must be globally
# unique since it must share a namespace with all other javascript packages.
name="YOUR-PACKAGE-NAME",
@@ -179,16 +179,16 @@ loaded with :func:`~idom.web.module.export`.
)
# Your module must provide a named export for YourFirstComponent
- YourFirstComponent = idom.web.export(_WEB_MODULE, "YourFirstComponent")
+ YourFirstComponent = reactpy.web.export(_WEB_MODULE, "YourFirstComponent")
# It's possible to export multiple components at once
- YourSecondComponent, YourThirdComponent = idom.web.export(
+ YourSecondComponent, YourThirdComponent = reactpy.web.export(
_WEB_MODULE, ["YourSecondComponent", "YourThirdComponent"]
)
.. note::
- When :data:`idom.config.IDOM_DEBUG_MODE` is active, named exports will be validated.
+ When :data:`reactpy.config.REACTPY_DEBUG_MODE` is active, named exports will be validated.
The remaining files that we need to create are concerned with creating a Python package.
We won't cover all the details here, so refer to the Setuptools_ documentation for
@@ -230,10 +230,10 @@ commands in Setuptools like ``build``, ``sdist``, and ``develop``:
name=PACKAGE_NAME,
version="0.0.1",
packages=find_packages(exclude=["tests*"]),
- classifiers=["Framework :: IDOM", ...],
- keywords=["IDOM", "components", ...],
- # install IDOM with this package
- install_requires=["idom"],
+ classifiers=["Framework :: ReactPy", ...],
+ keywords=["ReactPy", "components", ...],
+ # install ReactPy with this package
+ install_requires=["reactpy"],
# required in order to include static files like bundle.js using MANIFEST.in
include_package_data=True,
# we need access to the file system, so cannot be run from a zip file
@@ -297,7 +297,7 @@ up and running as quickly as possible.
.. _install NPM: https://www.npmjs.com/get-npm
.. _CDN: https://en.wikipedia.org/wiki/Content_delivery_network
.. _PyPI: https://pypi.org/
-.. _template repository: https://github.com/idom-team/idom-react-component-cookiecutter
+.. _template repository: https://github.com/reactive-python/reactpy-react-component-cookiecutter
.. _web module: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
.. _Rollup: https://rollupjs.org/guide/en/
.. _Webpack: https://webpack.js.org/
diff --git a/docs/source/guides/escape-hatches/javascript-components.rst b/docs/source/guides/escape-hatches/javascript-components.rst
index 4e0177dcf..f66ca60fb 100644
--- a/docs/source/guides/escape-hatches/javascript-components.rst
+++ b/docs/source/guides/escape-hatches/javascript-components.rst
@@ -3,12 +3,12 @@
Javascript Components
=====================
-While IDOM is a great tool for displaying HTML and responding to browser events with
+While ReactPy is a great tool for displaying HTML and responding to browser events with
pure Python, there are other projects which already allow you to do this inside
`Jupyter Notebooks `__
or in standard
`web apps `__.
-The real power of IDOM comes from its ability to seamlessly leverage the existing
+The real power of ReactPy comes from its ability to seamlessly leverage the existing
Javascript ecosystem. This can be accomplished in different ways for different reasons:
.. list-table::
@@ -18,7 +18,7 @@ Javascript ecosystem. This can be accomplished in different ways for different r
- Use Case
* - :ref:`Dynamically Loaded Components`
- - You want to **quickly experiment** with IDOM and the Javascript ecosystem.
+ - You want to **quickly experiment** with ReactPy and the Javascript ecosystem.
* - :ref:`Custom Javascript Components`
- You want to create polished software that can be **easily shared** with others.
@@ -35,18 +35,18 @@ Dynamically Loaded Components
Javascript` for more info. Instead, it's best used during exploratory phases of
development.
-IDOM makes it easy to draft your code when you're in the early stages of development by
+ReactPy makes it easy to draft your code when you're in the early stages of development by
using a CDN_ to dynamically load Javascript packages on the fly. In this example we'll
be using the ubiquitous React-based UI framework `Material UI`_.
-.. idom:: _examples/material_ui_button_no_action
+.. reactpy:: _examples/material_ui_button_no_action
So now that we can display a Material UI Button we probably want to make it do
something. Thankfully there's nothing new to learn here, you can pass event handlers to
the button just as you did when :ref:`getting started `. Thus, all
we need to do is add an ``onClick`` handler to the component:
-.. idom:: _examples/material_ui_button_on_click
+.. reactpy:: _examples/material_ui_button_on_click
.. _Custom Javascript Component:
@@ -55,7 +55,7 @@ Custom Javascript Components
----------------------------
For projects that will be shared with others, we recommend bundling your Javascript with
-Rollup_ or Webpack_ into a `web module`_. IDOM also provides a `template repository`_
+Rollup_ or Webpack_ into a `web module`_. ReactPy also provides a `template repository`_
that can be used as a blueprint to build a library of React components.
To work as intended, the Javascript bundle must export a function ``bind()`` that
@@ -132,7 +132,7 @@ Javascript that can run directly in the browser. This means we can't use fancy s
like `JSX `__ and instead will use
`htm `__ to simulate JSX in plain Javascript.
-.. idom:: _examples/super_simple_chart
+.. reactpy:: _examples/super_simple_chart
.. Links
@@ -140,7 +140,7 @@ like `JSX `__ and instead will us
.. _Material UI: https://material-ui.com/
.. _CDN: https://en.wikipedia.org/wiki/Content_delivery_network
-.. _template repository: https://github.com/idom-team/idom-react-component-cookiecutter
+.. _template repository: https://github.com/reactive-python/reactpy-react-component-cookiecutter
.. _web module: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
.. _Rollup: https://rollupjs.org/guide/en/
.. _Webpack: https://webpack.js.org/
diff --git a/docs/source/guides/getting-started/_examples/debug_error_example.py b/docs/source/guides/getting-started/_examples/debug_error_example.py
index cb0b6b405..36e5b4910 100644
--- a/docs/source/guides/getting-started/_examples/debug_error_example.py
+++ b/docs/source/guides/getting-started/_examples/debug_error_example.py
@@ -1,4 +1,4 @@
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/getting-started/_examples/hello_world.py b/docs/source/guides/getting-started/_examples/hello_world.py
index 1ad68582e..f38d9e38f 100644
--- a/docs/source/guides/getting-started/_examples/hello_world.py
+++ b/docs/source/guides/getting-started/_examples/hello_world.py
@@ -1,4 +1,4 @@
-from idom import component, html, run
+from reactpy import component, html, run
@component
diff --git a/docs/source/guides/getting-started/_examples/run_fastapi.py b/docs/source/guides/getting-started/_examples/run_fastapi.py
index 607ad7776..ce9974617 100644
--- a/docs/source/guides/getting-started/_examples/run_fastapi.py
+++ b/docs/source/guides/getting-started/_examples/run_fastapi.py
@@ -1,7 +1,7 @@
# :lines: 11-
-from idom import run
-from idom.backend import fastapi as fastapi_server
+from reactpy import run
+from reactpy.backend import fastapi as fastapi_server
# the run() function is the entry point for examples
@@ -10,8 +10,8 @@
from fastapi import FastAPI
-from idom import component, html
-from idom.backend.fastapi import configure
+from reactpy import component, html
+from reactpy.backend.fastapi import configure
@component
diff --git a/docs/source/guides/getting-started/_examples/run_flask.py b/docs/source/guides/getting-started/_examples/run_flask.py
index 310aca60e..29503fcc1 100644
--- a/docs/source/guides/getting-started/_examples/run_flask.py
+++ b/docs/source/guides/getting-started/_examples/run_flask.py
@@ -1,7 +1,7 @@
# :lines: 11-
-from idom import run
-from idom.backend import flask as flask_server
+from reactpy import run
+from reactpy.backend import flask as flask_server
# the run() function is the entry point for examples
@@ -10,8 +10,8 @@
from flask import Flask
-from idom import component, html
-from idom.backend.flask import configure
+from reactpy import component, html
+from reactpy.backend.flask import configure
@component
diff --git a/docs/source/guides/getting-started/_examples/run_sanic.py b/docs/source/guides/getting-started/_examples/run_sanic.py
index d5e8434db..9e5f14b45 100644
--- a/docs/source/guides/getting-started/_examples/run_sanic.py
+++ b/docs/source/guides/getting-started/_examples/run_sanic.py
@@ -1,7 +1,7 @@
# :lines: 11-
-from idom import run
-from idom.backend import sanic as sanic_server
+from reactpy import run
+from reactpy.backend import sanic as sanic_server
# the run() function is the entry point for examples
@@ -10,8 +10,8 @@
from sanic import Sanic
-from idom import component, html
-from idom.backend.sanic import configure
+from reactpy import component, html
+from reactpy.backend.sanic import configure
@component
diff --git a/docs/source/guides/getting-started/_examples/run_starlette.py b/docs/source/guides/getting-started/_examples/run_starlette.py
index 0010c5271..ffb500f21 100644
--- a/docs/source/guides/getting-started/_examples/run_starlette.py
+++ b/docs/source/guides/getting-started/_examples/run_starlette.py
@@ -1,7 +1,7 @@
# :lines: 11-
-from idom import run
-from idom.backend import starlette as starlette_server
+from reactpy import run
+from reactpy.backend import starlette as starlette_server
# the run() function is the entry point for examples
@@ -10,8 +10,8 @@
from starlette.applications import Starlette
-from idom import component, html
-from idom.backend.starlette import configure
+from reactpy import component, html
+from reactpy.backend.starlette import configure
@component
diff --git a/docs/source/guides/getting-started/_examples/run_tornado.py b/docs/source/guides/getting-started/_examples/run_tornado.py
index 0c1b35353..03109a1d3 100644
--- a/docs/source/guides/getting-started/_examples/run_tornado.py
+++ b/docs/source/guides/getting-started/_examples/run_tornado.py
@@ -1,7 +1,7 @@
# :lines: 11-
-from idom import run
-from idom.backend import tornado as tornado_server
+from reactpy import run
+from reactpy.backend import tornado as tornado_server
# the run() function is the entry point for examples
@@ -11,8 +11,8 @@
import tornado.ioloop
import tornado.web
-from idom import component, html
-from idom.backend.tornado import configure
+from reactpy import component, html
+from reactpy.backend.tornado import configure
@component
diff --git a/docs/source/guides/getting-started/_examples/sample_app.py b/docs/source/guides/getting-started/_examples/sample_app.py
index 332035e87..b457ca243 100644
--- a/docs/source/guides/getting-started/_examples/sample_app.py
+++ b/docs/source/guides/getting-started/_examples/sample_app.py
@@ -1,4 +1,4 @@
-import idom
+import reactpy
-idom.run(idom.sample.SampleApp)
+reactpy.run(reactpy.sample.SampleApp)
diff --git a/docs/source/guides/getting-started/_static/embed-doc-ex.html b/docs/source/guides/getting-started/_static/embed-doc-ex.html
index 027a32694..659ba250a 100644
--- a/docs/source/guides/getting-started/_static/embed-doc-ex.html
+++ b/docs/source/guides/getting-started/_static/embed-doc-ex.html
@@ -1,8 +1,8 @@
-
+
diff --git a/docs/source/guides/getting-started/_static/embed-idom-view/main.py b/docs/source/guides/getting-started/_static/embed-idom-view/main.py
deleted file mode 100644
index 32db294ee..000000000
--- a/docs/source/guides/getting-started/_static/embed-idom-view/main.py
+++ /dev/null
@@ -1,23 +0,0 @@
-from sanic import Sanic
-from sanic.response import file
-
-from idom import component, html
-from idom.backend.sanic import Options, configure
-
-
-app = Sanic("MyApp")
-
-
-@app.route("/")
-async def index(request):
- return await file("index.html")
-
-
-@component
-def IdomView():
- return html.code("This text came from an IDOM App")
-
-
-configure(app, IdomView, Options(url_prefix="/_idom"))
-
-app.run(host="127.0.0.1", port=5000)
diff --git a/docs/source/guides/getting-started/_static/embed-idom-view/index.html b/docs/source/guides/getting-started/_static/embed-reactpy-view/index.html
similarity index 65%
rename from docs/source/guides/getting-started/_static/embed-idom-view/index.html
rename to docs/source/guides/getting-started/_static/embed-reactpy-view/index.html
index 9488a91a3..146d715e4 100644
--- a/docs/source/guides/getting-started/_static/embed-idom-view/index.html
+++ b/docs/source/guides/getting-started/_static/embed-reactpy-view/index.html
@@ -6,23 +6,26 @@
This is an Example App
- Just below is an embedded IDOM view...
-
+ Just below is an embedded ReactPy view...
+
diff --git a/docs/source/guides/getting-started/_static/embed-reactpy-view/main.py b/docs/source/guides/getting-started/_static/embed-reactpy-view/main.py
new file mode 100644
index 000000000..2ff60ea91
--- /dev/null
+++ b/docs/source/guides/getting-started/_static/embed-reactpy-view/main.py
@@ -0,0 +1,23 @@
+from sanic import Sanic
+from sanic.response import file
+
+from reactpy import component, html
+from reactpy.backend.sanic import Options, configure
+
+
+app = Sanic("MyApp")
+
+
+@app.route("/")
+async def index(request):
+ return await file("index.html")
+
+
+@component
+def ReactPyView():
+ return html.code("This text came from an ReactPy App")
+
+
+configure(app, ReactPyView, Options(url_prefix="/_reactpy"))
+
+app.run(host="127.0.0.1", port=5000)
diff --git a/docs/source/guides/getting-started/_static/embed-idom-view/screenshot.png b/docs/source/guides/getting-started/_static/embed-reactpy-view/screenshot.png
similarity index 100%
rename from docs/source/guides/getting-started/_static/embed-idom-view/screenshot.png
rename to docs/source/guides/getting-started/_static/embed-reactpy-view/screenshot.png
diff --git a/docs/source/guides/getting-started/_static/idom-in-jupyterlab.gif b/docs/source/guides/getting-started/_static/reactpy-in-jupyterlab.gif
similarity index 100%
rename from docs/source/guides/getting-started/_static/idom-in-jupyterlab.gif
rename to docs/source/guides/getting-started/_static/reactpy-in-jupyterlab.gif
diff --git a/docs/source/guides/getting-started/index.rst b/docs/source/guides/getting-started/index.rst
index 7d05d868e..dd210be60 100644
--- a/docs/source/guides/getting-started/index.rst
+++ b/docs/source/guides/getting-started/index.rst
@@ -4,8 +4,8 @@ Getting Started
.. toctree::
:hidden:
- installing-idom
- running-idom
+ installing-reactpy
+ running-reactpy
.. dropdown:: :octicon:`bookmark-fill;2em` What You'll Learn
:color: info
@@ -14,56 +14,56 @@ Getting Started
.. grid:: 1 2 2 2
- .. grid-item-card:: :octicon:`tools` Installing IDOM
- :link: installing-idom
+ .. grid-item-card:: :octicon:`tools` Installing ReactPy
+ :link: installing-reactpy
:link-type: doc
- Learn how IDOM can be installed in a variety of different ways - with
+ Learn how ReactPy can be installed in a variety of different ways - with
different web servers and even in different frameworks.
- .. grid-item-card:: :octicon:`play` Running IDOM
- :link: running-idom
+ .. grid-item-card:: :octicon:`play` Running ReactPy
+ :link: running-reactpy
:link-type: doc
- See how IDOM can be run with a variety of different production servers or be
+ See how ReactPy can be run with a variety of different production servers or be
added to existing applications.
-The fastest way to get started with IDOM is to try it out in a `Juptyer Notebook
-`__.
+The fastest way to get started with ReactPy is to try it out in a `Juptyer Notebook
+`__.
If you want to use a Notebook to work through the examples shown in this documentation,
-you'll need to replace calls to ``idom.run(App)`` with a line at the end of each cell
+you'll need to replace calls to ``reactpy.run(App)`` with a line at the end of each cell
that constructs the ``App()`` in question. If that doesn't make sense, the introductory
notebook linked below will demonstrate how to do this:
.. card::
- :link: https://mybinder.org/v2/gh/idom-team/idom-jupyter/main?urlpath=lab/tree/notebooks/introduction.ipynb
+ :link: https://mybinder.org/v2/gh/reactive-python/reactpy-jupyter/main?urlpath=lab/tree/notebooks/introduction.ipynb
- .. image:: _static/idom-in-jupyterlab.gif
+ .. image:: _static/reactpy-in-jupyterlab.gif
:scale: 72%
:align: center
-Section 1: Installing IDOM
---------------------------
+Section 1: Installing ReactPy
+-----------------------------
-The next fastest option is to install IDOM along with a supported server (like
+The next fastest option is to install ReactPy along with a supported server (like
``starlette``) with ``pip``:
.. code-block:: bash
- pip install "idom[starlette]"
+ pip install "reactpy[starlette]"
To check that everything is working you can run the sample application:
.. code-block:: bash
- python -c "import idom; idom.run(idom.sample.SampleApp)"
+ python -c "import reactpy; reactpy.run(reactpy.sample.SampleApp)"
.. note::
This launches a simple development server which is good enough for testing, but
probably not what you want to use in production. When deploying in production,
- there's a number of different ways of :ref:`running IDOM `.
+ there's a number of different ways of :ref:`running ReactPy `.
You should then see a few log messages:
@@ -78,7 +78,7 @@ something like this:
.. card::
- .. idom-view:: _examples/sample_app
+ .. reactpy-view:: _examples/sample_app
If you get a ``RuntimeError`` similar to the following:
@@ -86,38 +86,38 @@ If you get a ``RuntimeError`` similar to the following:
Found none of the following builtin server implementations...
-Then be sure you run ``pip install "idom[starlette]"`` instead of just ``idom``. For
-anything else, report your issue in IDOM's :discussion-type:`discussion forum
+Then be sure you run ``pip install "reactpy[starlette]"`` instead of just ``reactpy``. For
+anything else, report your issue in ReactPy's :discussion-type:`discussion forum
`.
.. card::
- :link: installing-idom
+ :link: installing-reactpy
:link-type: doc
:octicon:`book` Read More
^^^^^^^^^^^^^^^^^^^^^^^^^
- Learn how IDOM can be installed in a variety of different ways - with different web
+ Learn how ReactPy can be installed in a variety of different ways - with different web
servers and even in different frameworks.
-Section 2: Running IDOM
------------------------
+Section 2: Running ReactPy
+--------------------------
-Once you've :ref:`installed IDOM `, you'll want to learn how to run an
+Once you've :ref:`installed ReactPy `, you'll want to learn how to run an
application. Throughout most of the examples in this documentation, you'll see the
-:func:`~idom.backend.utils.run` function used. While it's convenient tool for
+:func:`~reactpy.backend.utils.run` function used. While it's convenient tool for
development it shouldn't be used in production settings - it's slow, and could leak
secrets through debug log messages.
-.. idom:: _examples/hello_world
+.. reactpy:: _examples/hello_world
.. card::
- :link: running-idom
+ :link: running-reactpy
:link-type: doc
:octicon:`book` Read More
^^^^^^^^^^^^^^^^^^^^^^^^^
- See how IDOM can be run with a variety of different production servers or be
+ See how ReactPy can be run with a variety of different production servers or be
added to existing applications.
diff --git a/docs/source/guides/getting-started/installing-idom.rst b/docs/source/guides/getting-started/installing-reactpy.rst
similarity index 59%
rename from docs/source/guides/getting-started/installing-idom.rst
rename to docs/source/guides/getting-started/installing-reactpy.rst
index 6c3ad9ce9..61356ea55 100644
--- a/docs/source/guides/getting-started/installing-idom.rst
+++ b/docs/source/guides/getting-started/installing-reactpy.rst
@@ -1,28 +1,28 @@
-Installing IDOM
-===============
+Installing ReactPy
+==================
-You will typically ``pip`` install IDOM to alongside one of it's natively supported
-backends. For example, if we want to run IDOM using the `Starlette
+You will typically ``pip`` install ReactPy to alongside one of it's natively supported
+backends. For example, if we want to run ReactPy using the `Starlette
`__ backend you would run
.. code-block:: bash
- pip install "idom[starlette]"
+ pip install "reactpy[starlette]"
-If you want to install a "pure" version of IDOM without a backend implementation you can
+If you want to install a "pure" version of ReactPy without a backend implementation you can
do so without any installation extras. You might do this if you wanted to :ref:`use a
custom backend ` or if you wanted to manually pin your
dependencies:
.. code-block:: bash
- pip install idom
+ pip install reactpy
Native Backends
---------------
-IDOM includes built-in support for a variety backend implementations. To install the
+ReactPy includes built-in support for a variety backend implementations. To install the
required dependencies for each you should substitute ``starlette`` from the ``pip
install`` command above with one of the options below:
@@ -36,19 +36,19 @@ If you need to, you can install more than one option by separating them with com
.. code-block:: bash
- pip install "idom[fastapi,flask,sanic,starlette,tornado]"
+ pip install "reactpy[fastapi,flask,sanic,starlette,tornado]"
-Once this is complete you should be able to :ref:`run IDOM ` with your
+Once this is complete you should be able to :ref:`run ReactPy ` with your
chosen implementation.
Other Backends
--------------
-While IDOM can run in a variety of contexts, sometimes frameworks require extra work in
-order to integrate with them. In these cases, the IDOM team distributes bindings for
+While ReactPy can run in a variety of contexts, sometimes frameworks require extra work in
+order to integrate with them. In these cases, the ReactPy team distributes bindings for
those frameworks as separate Python packages. For documentation on how to install and
-run IDOM in these supported frameworks, follow the links below:
+run ReactPy in these supported frameworks, follow the links below:
.. raw:: html
@@ -75,21 +75,21 @@ run IDOM in these supported frameworks, follow the links below:
.. grid:: 3
.. grid-item-card::
- :link: https://github.com/idom-team/django-idom
+ :link: https://github.com/reactive-python/django-reactpy
:img-background: _static/logo-django.svg
:class-card: card-logo-image
:transparent-text-color:`Django`
.. grid-item-card::
- :link: https://github.com/idom-team/idom-jupyter
+ :link: https://github.com/reactive-python/reactpy-jupyter
:img-background: _static/logo-jupyter.svg
:class-card: card-logo-image
:transparent-text-color:`Jupyter`
.. grid-item-card::
- :link: https://github.com/idom-team/idom-dash
+ :link: https://github.com/reactive-python/reactpy-dash
:img-background: _static/logo-plotly.svg
:class-card: card-logo-image
@@ -99,15 +99,15 @@ run IDOM in these supported frameworks, follow the links below:
For Development
---------------
-If you want to contribute to the development of IDOM or modify it, you'll want to
-install a development version of IDOM. This involves cloning the repository where IDOM's
+If you want to contribute to the development of ReactPy or modify it, you'll want to
+install a development version of ReactPy. This involves cloning the repository where ReactPy's
source is maintained, and setting up a :ref:`development environment`. From there you'll
-be able to modifying IDOM's source code and :ref:`run its tests ` to
+be able to modifying ReactPy's source code and :ref:`run its tests ` to
ensure the modifications you've made are backwards compatible. If you want to add a new
-feature to IDOM you should write your own test that validates its behavior.
+feature to ReactPy you should write your own test that validates its behavior.
-If you have questions about how to modify IDOM or help with its development, be sure to
-:discussion:`start a discussion `. The IDOM team are always
+If you have questions about how to modify ReactPy or help with its development, be sure to
+:discussion:`start a discussion `. The ReactPy team are always
excited to :ref:`welcome ` new contributions and contributors
of all kinds
@@ -118,4 +118,4 @@ of all kinds
:octicon:`book` Read More
^^^^^^^^^^^^^^^^^^^^^^^^^
- Learn more about how to contribute to the development of IDOM.
+ Learn more about how to contribute to the development of ReactPy.
diff --git a/docs/source/guides/getting-started/running-idom.rst b/docs/source/guides/getting-started/running-reactpy.rst
similarity index 67%
rename from docs/source/guides/getting-started/running-idom.rst
rename to docs/source/guides/getting-started/running-reactpy.rst
index c0ae0e449..8abbd574f 100644
--- a/docs/source/guides/getting-started/running-idom.rst
+++ b/docs/source/guides/getting-started/running-reactpy.rst
@@ -1,20 +1,20 @@
-Running IDOM
-============
+Running ReactPy
+===============
-The simplest way to run IDOM is with the :func:`~idom.backend.utils.run` function. This
+The simplest way to run ReactPy is with the :func:`~reactpy.backend.utils.run` function. This
is the method you'll see used throughout this documentation. However, this executes your
application using a development server which is great for testing, but probably not what
-if you're :ref:`deploying in production `. Below are some
-more robust and performant ways of running IDOM with various supported servers.
+if you're :ref:`deploying in production `. Below are some
+more robust and performant ways of running ReactPy with various supported servers.
-Running IDOM in Production
---------------------------
+Running ReactPy in Production
+-----------------------------
-The first thing you'll need to do if you want to run IDOM in production is choose a
+The first thing you'll need to do if you want to run ReactPy in production is choose a
backend implementation and follow its documentation on how to create and run an
application. This is the backend :ref:`you probably chose ` when
-installing IDOM. Then you'll need to configure that application with an IDOM view. We
+installing ReactPy. Then you'll need to configure that application with an ReactPy view. We
show the basics of how to set up, and then run, each supported backend below, but all
implementations will follow a pattern similar to the following:
@@ -22,8 +22,8 @@ implementations will follow a pattern similar to the following:
from my_chosen_backend import Application
- from idom import component, html
- from idom.backend.my_chosen_backend import configure
+ from reactpy import component, html
+ from reactpy.backend.my_chosen_backend import configure
@component
@@ -41,7 +41,7 @@ or `WSGI `__ server from the command line.
Running with `FastAPI `__
.......................................................
-.. idom:: _examples/run_fastapi
+.. reactpy:: _examples/run_fastapi
Then assuming you put this in ``main.py``, you can run the ``app`` using the `Uvicorn
`__ ASGI server:
@@ -54,7 +54,7 @@ Then assuming you put this in ``main.py``, you can run the ``app`` using the `Uv
Running with `Flask `__
.............................................................
-.. idom:: _examples/run_flask
+.. reactpy:: _examples/run_flask
Then assuming you put this in ``main.py``, you can run the ``app`` using the `Gunicorn
`__ WSGI server:
@@ -67,7 +67,7 @@ Then assuming you put this in ``main.py``, you can run the ``app`` using the `Gu
Running with `Sanic `__
...................................................
-.. idom:: _examples/run_sanic
+.. reactpy:: _examples/run_sanic
Then assuming you put this in ``main.py``, you can run the ``app`` using Sanic's builtin
server:
@@ -80,7 +80,7 @@ server:
Running with `Starlette `__
......................................................
-.. idom:: _examples/run_starlette
+.. reactpy:: _examples/run_starlette
Then assuming you put this in ``main.py``, you can run the application using the
`Uvicorn `__ ASGI server:
@@ -93,17 +93,17 @@ Then assuming you put this in ``main.py``, you can run the application using the
Running with `Tornado `__
................................................................
-.. idom:: _examples/run_tornado
+.. reactpy:: _examples/run_tornado
Tornado is run using it's own builtin server rather than an external WSGI or ASGI
server.
-Running IDOM in Debug Mode
---------------------------
+Running ReactPy in Debug Mode
+-----------------------------
-IDOM provides a debug mode that is turned off by default. This can be enabled when you
-run your application by setting the ``IDOM_DEBUG_MODE`` environment variable.
+ReactPy provides a debug mode that is turned off by default. This can be enabled when you
+run your application by setting the ``REACTPY_DEBUG_MODE`` environment variable.
.. tab-set::
@@ -111,22 +111,22 @@ run your application by setting the ``IDOM_DEBUG_MODE`` environment variable.
.. code-block::
- export IDOM_DEBUG_MODE=1
- python my_idom_app.py
+ export REACTPY_DEBUG_MODE=1
+ python my_reactpy_app.py
.. tab-item:: Command Prompt
.. code-block:: text
- set IDOM_DEBUG_MODE=1
- python my_idom_app.py
+ set REACTPY_DEBUG_MODE=1
+ python my_reactpy_app.py
.. tab-item:: PowerShell
.. code-block:: powershell
- $env:IDOM_DEBUG_MODE = "1"
- python my_idom_app.py
+ $env:REACTPY_DEBUG_MODE = "1"
+ python my_reactpy_app.py
.. danger::
@@ -140,35 +140,35 @@ Among other things, running in this mode:
Errors will be displayed where the uppermost component is located in the view:
-.. idom:: _examples/debug_error_example
+.. reactpy:: _examples/debug_error_example
Backend Configuration Options
-----------------------------
-IDOM's various backend implementations come with ``Options`` that can be passed to their
+ReactPy's various backend implementations come with ``Options`` that can be passed to their
respective ``configure()`` functions in the following way:
.. code-block::
- from idom.backend. import configure, Options
+ from reactpy.backend. import configure, Options
configure(app, MyComponent, Options(...))
To learn more read about the options for your chosen backend ````:
-- :class:`idom.backend.fastapi.Options`
-- :class:`idom.backend.flask.Options`
-- :class:`idom.backend.sanic.Options`
-- :class:`idom.backend.starlette.Options`
-- :class:`idom.backend.tornado.Options`
+- :class:`reactpy.backend.fastapi.Options`
+- :class:`reactpy.backend.flask.Options`
+- :class:`reactpy.backend.sanic.Options`
+- :class:`reactpy.backend.starlette.Options`
+- :class:`reactpy.backend.tornado.Options`
Embed in an Existing Webpage
----------------------------
-IDOM provides a Javascript client called ``idom-client-react`` that can be used to embed
-IDOM views within an existing applications. This is actually how the interactive
+ReactPy provides a Javascript client called ``@reactpy/client`` that can be used to embed
+ReactPy views within an existing applications. This is actually how the interactive
examples throughout this documentation have been created. You can try this out by
embedding one the examples from this documentation into your own webpage:
@@ -193,7 +193,7 @@ embedding one the examples from this documentation into your own webpage:
As mentioned though, this is connecting to the server that is hosting this
documentation. If you want to connect to a view from your own server, you'll need to
change the URL above to one you provide. One way to do this might be to add to an
-existing application. Another would be to run IDOM in an adjacent web server instance
+existing application. Another would be to run ReactPy in an adjacent web server instance
that you coordinate with something like `NGINX `__. For the sake
of simplicity, we'll assume you do something similar to the following in an existing
Python app:
@@ -202,12 +202,12 @@ Python app:
.. tab-item:: main.py
- .. literalinclude:: _static/embed-idom-view/main.py
+ .. literalinclude:: _static/embed-reactpy-view/main.py
:language: python
.. tab-item:: index.html
- .. literalinclude:: _static/embed-idom-view/index.html
+ .. literalinclude:: _static/embed-reactpy-view/index.html
:language: html
After running ``python main.py``, you should be able to navigate to
@@ -216,6 +216,6 @@ After running ``python main.py``, you should be able to navigate to
.. card::
:text-align: center
- .. image:: _static/embed-idom-view/screenshot.png
+ .. image:: _static/embed-reactpy-view/screenshot.png
:width: 500px
diff --git a/docs/source/guides/managing-state/index.rst b/docs/source/guides/managing-state/index.rst
index 971c563b4..0578bafdd 100644
--- a/docs/source/guides/managing-state/index.rst
+++ b/docs/source/guides/managing-state/index.rst
@@ -75,14 +75,14 @@ Section 2: Shared Component State
Sometimes, you want the state of two components to always change together. To do it,
remove state from both of them, move it to their closest common parent, and then pass it
down to them via props. This is known as “lifting state up”, and it’s one of the most
-common things you will do writing code with IDOM.
+common things you will do writing code with ReactPy.
In the example below the search input and the list of elements below share the same
state, the state represents the food name. Note how the component ``Table`` gets called
at each change of state. The component is observing the state and reacting to state
changes automatically, just like it would do in React.
-.. idom:: sharing-component-state/_examples/synced_inputs
+.. reactpy:: sharing-component-state/_examples/synced_inputs
.. card::
:link: sharing-component-state/index
diff --git a/docs/source/guides/managing-state/sharing-component-state/_examples/filterable_list/main.py b/docs/source/guides/managing-state/sharing-component-state/_examples/filterable_list/main.py
index 2132f8482..b07424158 100644
--- a/docs/source/guides/managing-state/sharing-component-state/_examples/filterable_list/main.py
+++ b/docs/source/guides/managing-state/sharing-component-state/_examples/filterable_list/main.py
@@ -1,7 +1,7 @@
import json
from pathlib import Path
-from idom import component, hooks, html, run
+from reactpy import component, hooks, html, run
HERE = Path(__file__)
diff --git a/docs/source/guides/managing-state/sharing-component-state/_examples/synced_inputs/main.py b/docs/source/guides/managing-state/sharing-component-state/_examples/synced_inputs/main.py
index cf7aa3d82..e8bcdf333 100644
--- a/docs/source/guides/managing-state/sharing-component-state/_examples/synced_inputs/main.py
+++ b/docs/source/guides/managing-state/sharing-component-state/_examples/synced_inputs/main.py
@@ -1,4 +1,4 @@
-from idom import component, hooks, html, run
+from reactpy import component, hooks, html, run
@component
diff --git a/docs/source/guides/managing-state/sharing-component-state/index.rst b/docs/source/guides/managing-state/sharing-component-state/index.rst
index e7971054c..54b61335a 100644
--- a/docs/source/guides/managing-state/sharing-component-state/index.rst
+++ b/docs/source/guides/managing-state/sharing-component-state/index.rst
@@ -8,7 +8,7 @@ Sharing Component State
Sometimes, you want the state of two components to always change together. To do it,
remove state from both of them, move it to their closest common parent, and then pass it
down to them via props. This is known as “lifting state up”, and it’s one of the most
-common things you will do writing code with IDOM.
+common things you will do writing code with ReactPy.
Synced Inputs
@@ -18,7 +18,7 @@ In the code below the two input boxes are synchronized, this happens because the
state. The state is shared via the parent component ``SyncedInputs``. Check the ``value``
and ``set_value`` variables.
-.. idom:: _examples/synced_inputs
+.. reactpy:: _examples/synced_inputs
Filterable List
@@ -31,7 +31,7 @@ Note how the component ``Table`` gets called at each change of state. The
component is observing the state and reacting to state changes automatically,
just like it would do in React.
-.. idom:: _examples/filterable_list
+.. reactpy:: _examples/filterable_list
.. note::
diff --git a/docs/source/guides/understanding-idom/why-idom-needs-keys.rst b/docs/source/guides/understanding-idom/why-idom-needs-keys.rst
deleted file mode 100644
index 02d8613c4..000000000
--- a/docs/source/guides/understanding-idom/why-idom-needs-keys.rst
+++ /dev/null
@@ -1,8 +0,0 @@
-.. _Why IDOM Needs Keys:
-
-Why IDOM Needs Keys 🚧
-======================
-
-.. note::
-
- Under construction 🚧
diff --git a/docs/source/guides/understanding-idom/_static/idom-flow-diagram.svg b/docs/source/guides/understanding-reactpy/_static/idom-flow-diagram.svg
similarity index 99%
rename from docs/source/guides/understanding-idom/_static/idom-flow-diagram.svg
rename to docs/source/guides/understanding-reactpy/_static/idom-flow-diagram.svg
index 27c78b0b2..9077913ca 100644
--- a/docs/source/guides/understanding-idom/_static/idom-flow-diagram.svg
+++ b/docs/source/guides/understanding-reactpy/_static/idom-flow-diagram.svg
@@ -13,7 +13,7 @@
viewBox="-0.5 -0.5 680 580"
content="<mxfile host="app.diagrams.net" modified="2020-09-07T18:34:20.858Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36" etag="IvUE9xI9CxZQnD7O0sJm" version="13.6.6" type="device"><diagram id="3GUrj3vU2Wc3lj3yRkW7" name="Page-1">7Zpdb9owFIZ/DZetkrgEuCy027R1XSWkddqdiU8Sqw5mjvnar5+d2CEhFEpbPkZBlUqO7WP7+D0PdpIG6iWzzwKP4u+cAGt4Dpk10E3D89wrz2voP4fMc0sLdXJDJCgxlRaGPv0Lxtg01jElkFYqSs6ZpKOqMeDDIQSyYsNC8Gm1WshZtdcRjqBm6AeY1a2PlMg4t7abzsL+BWgU255dx5Qk2FY2hjTGhE9LJnTbQD3Bucy/JbMeMB08G5e83adnSouBCRjKlzTAv+WFQ760viXebfT49/4J/cIXfu5lgtnYTLjh+Uz564ZcuVUBw0Fe4P8Z65F2e3wsKAhVdA/ThVlPUM5Zta72cZFma3qtKqjRzsot/Mj8zzocWMMdnvOxtGY1ocFyVWXLh2fNXqV7T/DxkICet6uKpzGV0B/lE5kqmSpbLBNmikPKWI8zLrK2iGBoh4Gyp1LwJyiV+EEbBmFRYuWAihFMQEiYPbs8brHoKluAJyDFXFUxDTzX6MQkim8upwvVFckUlxRn62Ej9KjwvNCC+mLksIU0WkcojRuajrAMYt3Jx5ZHcX0wfbSPUB+PoL46fRCTs0LQwQnSOUKF9BiF4dofl4H4iGppHpwn7iqgLEUahuRab+rUVcBwmtKgGtxqqJr1cINLmtBaFe6O30LYL4ILpLYv3BjaUujs/rAcOWsTwLCkk6r7VeE0PTxwmmXLbGml5naVllYkVUkUgGlV3hBucFRcW0cSiwhkzVG2usW037DgG/mwddJvQZQ8l7/2f9yrsge9qXhpumtp3OGBOuhUtIcZjYZamEomqkPU1flJ1Uni2hQklBDtoytAzQAPMn+Ouh7pCGcxb3YbzRtlYdp9FwdPUcaWkkw/ZZ91DDAnIeN/cf4oC3hNAj5LDOfSayNUUYz7NkEbLxduq9qEh2EKO5GcHdyZMdsxxmu9E2PQ8s/Hjhlj1/fMmNcwRg/R3JLxnJ0wZ8MuZYfMQXtjDjoz5zXMcd9rX+PteV/jXR2eOT9vfnw/s2ZVIp42a1Ztqd+bNWEIfrDyyEpanYHj/AesQWgDIl7KmmVHNWjtmDW2+8Pub1TJ7aR6W+VMnCId90+c/QEH7eNAdYLAqZ2DXguc2sls18A5igPVGTjr0vGkgbOP09QJAqd2c/e1wKndbt41cI7gNHUGzvp0PGXgXG3cYW+rpkcYpDx4gkJM2z9xzNb+gadUUq5lI3J+FPpiEMqVoEtjPNI+klmk39e6TNRAxqPLBAv9LxgLNu+KbD4VYNpXl7SICE7j7GGns/J2U/bR1ahQisqHp1ijR/Cukn35o07fvku2TLANJO5s/6RTXS5e6MoVuHgtDt3+Aw==</diagram></mxfile>"
id="svg4818"
- sodipodi:docname="idom-flow-diagram.svg"
+ sodipodi:docname="reactpy-flow-diagram.svg"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)">
diff --git a/docs/source/guides/understanding-idom/_static/live-examples-in-docs.gif b/docs/source/guides/understanding-reactpy/_static/live-examples-in-docs.gif
similarity index 100%
rename from docs/source/guides/understanding-idom/_static/live-examples-in-docs.gif
rename to docs/source/guides/understanding-reactpy/_static/live-examples-in-docs.gif
diff --git a/docs/source/guides/understanding-idom/_static/mvc-flow-diagram.svg b/docs/source/guides/understanding-reactpy/_static/mvc-flow-diagram.svg
similarity index 100%
rename from docs/source/guides/understanding-idom/_static/mvc-flow-diagram.svg
rename to docs/source/guides/understanding-reactpy/_static/mvc-flow-diagram.svg
diff --git a/docs/source/guides/understanding-idom/_static/npm-download-trends.png b/docs/source/guides/understanding-reactpy/_static/npm-download-trends.png
similarity index 100%
rename from docs/source/guides/understanding-idom/_static/npm-download-trends.png
rename to docs/source/guides/understanding-reactpy/_static/npm-download-trends.png
diff --git a/docs/source/guides/understanding-idom/index.rst b/docs/source/guides/understanding-reactpy/index.rst
similarity index 74%
rename from docs/source/guides/understanding-idom/index.rst
rename to docs/source/guides/understanding-reactpy/index.rst
index 389995553..3e0b2ab72 100644
--- a/docs/source/guides/understanding-idom/index.rst
+++ b/docs/source/guides/understanding-reactpy/index.rst
@@ -1,5 +1,5 @@
-Understanding IDOM
-==================
+Understanding ReactPy
+=====================
.. toctree::
:hidden:
@@ -7,7 +7,7 @@ Understanding IDOM
representing-html
what-are-components
the-rendering-pipeline
- why-idom-needs-keys
+ why-reactpy-needs-keys
the-rendering-process
layout-render-servers
writing-tests
diff --git a/docs/source/guides/understanding-idom/layout-render-servers.rst b/docs/source/guides/understanding-reactpy/layout-render-servers.rst
similarity index 100%
rename from docs/source/guides/understanding-idom/layout-render-servers.rst
rename to docs/source/guides/understanding-reactpy/layout-render-servers.rst
diff --git a/docs/source/guides/understanding-idom/representing-html.rst b/docs/source/guides/understanding-reactpy/representing-html.rst
similarity index 89%
rename from docs/source/guides/understanding-idom/representing-html.rst
rename to docs/source/guides/understanding-reactpy/representing-html.rst
index ffae0d331..5784a5a63 100644
--- a/docs/source/guides/understanding-idom/representing-html.rst
+++ b/docs/source/guides/understanding-reactpy/representing-html.rst
@@ -7,10 +7,10 @@ Representing HTML 🚧
Under construction 🚧
-We've already discussed how to contruct HTML with IDOM in a :ref:`previous section `, but we skimmed over the question of the data structure we use to represent
+We've already discussed how to contruct HTML with ReactPy in a :ref:`previous section `, but we skimmed over the question of the data structure we use to represent
it. Let's reconsider the examples from before - on the top is some HTML and on the
-bottom is the corresponding code to create it in IDOM:
+bottom is the corresponding code to create it in ReactPy:
.. code-block:: html
@@ -24,7 +24,7 @@ bottom is the corresponding code to create it in IDOM:
.. testcode::
- from idom import html
+ from reactpy import html
layout = html.div(
html.h1("My Todo List"),
diff --git a/docs/source/guides/understanding-idom/the-rendering-pipeline.rst b/docs/source/guides/understanding-reactpy/the-rendering-pipeline.rst
similarity index 100%
rename from docs/source/guides/understanding-idom/the-rendering-pipeline.rst
rename to docs/source/guides/understanding-reactpy/the-rendering-pipeline.rst
diff --git a/docs/source/guides/understanding-idom/the-rendering-process.rst b/docs/source/guides/understanding-reactpy/the-rendering-process.rst
similarity index 100%
rename from docs/source/guides/understanding-idom/the-rendering-process.rst
rename to docs/source/guides/understanding-reactpy/the-rendering-process.rst
diff --git a/docs/source/guides/understanding-idom/what-are-components.rst b/docs/source/guides/understanding-reactpy/what-are-components.rst
similarity index 100%
rename from docs/source/guides/understanding-idom/what-are-components.rst
rename to docs/source/guides/understanding-reactpy/what-are-components.rst
diff --git a/docs/source/guides/understanding-reactpy/why-reactpy-needs-keys.rst b/docs/source/guides/understanding-reactpy/why-reactpy-needs-keys.rst
new file mode 100644
index 000000000..e570b8f41
--- /dev/null
+++ b/docs/source/guides/understanding-reactpy/why-reactpy-needs-keys.rst
@@ -0,0 +1,8 @@
+.. _Why ReactPy Needs Keys:
+
+Why ReactPy Needs Keys 🚧
+=========================
+
+.. note::
+
+ Under construction 🚧
diff --git a/docs/source/guides/understanding-idom/writing-tests.rst b/docs/source/guides/understanding-reactpy/writing-tests.rst
similarity index 100%
rename from docs/source/guides/understanding-idom/writing-tests.rst
rename to docs/source/guides/understanding-reactpy/writing-tests.rst
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 5260157fc..bf7936f8f 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -1,11 +1,11 @@
.. card::
This documentation is still under construction 🚧. We welcome your `feedback
- `__!
+ `__!
-What is IDOM?
-=============
+ReactPy
+=======
.. toctree::
:hidden:
@@ -16,7 +16,7 @@ What is IDOM?
guides/adding-interactivity/index
guides/managing-state/index
guides/escape-hatches/index
- guides/understanding-idom/index
+ guides/understanding-reactpy/index
.. toctree::
:hidden:
@@ -35,55 +35,46 @@ What is IDOM?
about/changelog
about/contributor-guide
about/credits-and-licenses
- Source Code
- Community
+ Source Code
+ Community
-
-IDOM is a Python web framework for building **interactive websites without needing a
-single line of Javascript**. This is accomplished by breaking down complex applications
-into nestable and reusable chunks of code called :ref:`"components" ` that allow you to focus on what your application does rather than how it
-does it.
-
-Ecosystem independence is also a core feature of IDOM. It can be added to existing
-applications built on a variety of sync and async web servers, as well as integrated
-with other frameworks like Django, Jupyter, and Plotly Dash. Not only does this mean
-you're free to choose what technology stack to run on, but on top of that, you can run
-the exact same components wherever you need them. For example, you can take a component
-originally developed in a Jupyter Notebook and embed it in your production application
-without changing anything about the component itself.
+ReactPy is a library for building user interfaces in Python without Javascript. ReactPy
+interfaces are made from :ref:`components ` which look and behave
+similarly to this found in `ReactJS `__. Designed with simplicity
+in mind, ReactPy can be used by those without web development experience while also
+being powerful enough to grow with your ambitions.
At a Glance
-----------
-To get a rough idea of how to write apps in IDOM, take a look at the tiny `"hello world"
+To get a rough idea of how to write apps in ReactPy, take a look at the tiny `"hello world"
`__ application below:
-.. idom:: guides/getting-started/_examples/hello_world
+.. reactpy:: guides/getting-started/_examples/hello_world
.. hint::
- Try clicking the **▶️ result** tab to see what this displays!
+ Try clicking the **🚀 result** tab to see what this displays!
-So what exactly does this code do? First, it imports a few tools from ``idom`` that will
+So what exactly does this code do? First, it imports a few tools from ``reactpy`` that will
get used to describe and execute an application. Then, we create an ``App`` function
which will define the content the application displays. Specifically, it displays a kind
of HTML element called an ``h1`` `section heading
`__.
Importantly though, a ``@component`` decorator has been applied to the ``App`` function
to turn it into a :ref:`component `. Finally, we :ref:`run
-` a development web server by passing the ``App`` component to the
+` a development web server by passing the ``App`` component to the
``run()`` function.
.. note::
- See :ref:`Running IDOM in Production` to learn how to use a production-grade server
- to run IDOM.
+ See :ref:`Running ReactPy in Production` to learn how to use a production-grade server
+ to run ReactPy.
-Learning IDOM
--------------
+Learning ReactPy
+----------------
This documentation is broken up into chapters and sections that introduce you to
concepts step by step with detailed explanations and lots of examples. You should feel
@@ -97,20 +88,20 @@ Chapter 1 - :ref:`Getting Started`
-----------------------------------
If you want to follow along with examples in the sections that follow, you'll want to
-start here so you can :ref:`install IDOM `. This section also contains
-more detailed information about how to :ref:`run IDOM ` in different
-contexts. For example, if you want to embed IDOM into an existing application, or run
-IDOM within a Jupyter Notebook, this is where you can learn how to do those things.
+start here so you can :ref:`install ReactPy `. This section also contains
+more detailed information about how to :ref:`run ReactPy ` in different
+contexts. For example, if you want to embed ReactPy into an existing application, or run
+ReactPy within a Jupyter Notebook, this is where you can learn how to do those things.
.. grid:: 1 2 2 2
.. grid-item::
- .. image:: _static/install-and-run-idom.gif
+ .. image:: _static/install-and-run-reactpy.gif
.. grid-item::
- .. image:: guides/getting-started/_static/idom-in-jupyterlab.gif
+ .. image:: guides/getting-started/_static/reactpy-in-jupyterlab.gif
.. card::
:link: guides/getting-started/index
@@ -119,20 +110,20 @@ IDOM within a Jupyter Notebook, this is where you can learn how to do those thin
:octicon:`book` Read More
^^^^^^^^^^^^^^^^^^^^^^^^^
- Install IDOM and run it in a variety of different ways - with different web servers
- and frameworks. You'll even embed IDOM into an existing app.
+ Install ReactPy and run it in a variety of different ways - with different web servers
+ and frameworks. You'll even embed ReactPy into an existing app.
Chapter 2 - :ref:`Creating Interfaces`
--------------------------------------
-IDOM is a Python package for making user interfaces (UI). These interfaces are built
-from small elements of functionality like buttons text and images. IDOM allows you to
+ReactPy is a Python package for making user interfaces (UI). These interfaces are built
+from small elements of functionality like buttons text and images. ReactPy allows you to
combine these elements into reusable :ref:`"components" `. In the
sections that follow you'll learn how these UI elements are created and organized into
components. Then, you'll use this knowledge to create interfaces from raw data:
-.. idom:: guides/creating-interfaces/rendering-data/_examples/todo_list_with_keys
+.. reactpy:: guides/creating-interfaces/rendering-data/_examples/todo_list_with_keys
.. card::
:link: guides/creating-interfaces/index
@@ -151,16 +142,16 @@ Components often need to change what’s on the screen as a result of an interac
example, typing into the form should update the input field, clicking a “Comment” button
should bring up a text input field, clicking “Buy” should put a product in the shopping
cart. Components need to “remember” things like the current input value, the current
-image, the shopping cart. In IDOM, this kind of component-specific memory is created and
+image, the shopping cart. In ReactPy, this kind of component-specific memory is created and
updated with a "hook" called ``use_state()`` that creates a **state variable** and
**state setter** respectively:
-.. idom:: guides/adding-interactivity/components-with-state/_examples/adding_state_variable
+.. reactpy:: guides/adding-interactivity/components-with-state/_examples/adding_state_variable
-In IDOM, ``use_state``, as well as any other function whose name starts with ``use``, is
-called a "hook". These are special functions that should only be called while IDOM is
+In ReactPy, ``use_state``, as well as any other function whose name starts with ``use``, is
+called a "hook". These are special functions that should only be called while ReactPy is
:ref:`rendering `. They let you "hook into" the different
-capabilities of IDOM's components of which ``use_state`` is just one (well get into the
+capabilities of ReactPy's components of which ``use_state`` is just one (well get into the
other :ref:`later `).
.. card::
@@ -200,8 +191,8 @@ Chapter 5 - :ref:`Escape Hatches`
Under construction 🚧
-Chapter 6 - :ref:`Understanding IDOM`
--------------------------------------
+Chapter 6 - :ref:`Understanding ReactPy`
+----------------------------------------
.. card::
:link: guides/escape-hatches/index
diff --git a/docs/source/reference/_examples/character_movement/main.py b/docs/source/reference/_examples/character_movement/main.py
index 6183d9199..6bdb328e0 100644
--- a/docs/source/reference/_examples/character_movement/main.py
+++ b/docs/source/reference/_examples/character_movement/main.py
@@ -1,8 +1,8 @@
from pathlib import Path
from typing import NamedTuple
-from idom import component, html, run, use_state
-from idom.widgets import image
+from reactpy import component, html, run, use_state
+from reactpy.widgets import image
HERE = Path(__file__)
diff --git a/docs/source/reference/_examples/click_count.py b/docs/source/reference/_examples/click_count.py
index 040da3cf1..3ee2c89c5 100644
--- a/docs/source/reference/_examples/click_count.py
+++ b/docs/source/reference/_examples/click_count.py
@@ -1,13 +1,13 @@
-import idom
+import reactpy
-@idom.component
+@reactpy.component
def ClickCount():
- count, set_count = idom.hooks.use_state(0)
+ count, set_count = reactpy.hooks.use_state(0)
- return idom.html.button(
+ return reactpy.html.button(
{"on_click": lambda event: set_count(count + 1)}, [f"Click count: {count}"]
)
-idom.run(ClickCount)
+reactpy.run(ClickCount)
diff --git a/docs/source/reference/_examples/material_ui_switch.py b/docs/source/reference/_examples/material_ui_switch.py
index 9e4363b74..ed66d83de 100644
--- a/docs/source/reference/_examples/material_ui_switch.py
+++ b/docs/source/reference/_examples/material_ui_switch.py
@@ -1,15 +1,15 @@
-import idom
+import reactpy
-mui = idom.web.module_from_template("react", "@material-ui/core@^5.0", fallback="⌛")
-Switch = idom.web.export(mui, "Switch")
+mui = reactpy.web.module_from_template("react", "@material-ui/core@^5.0", fallback="⌛")
+Switch = reactpy.web.export(mui, "Switch")
-@idom.component
+@reactpy.component
def DayNightSwitch():
- checked, set_checked = idom.hooks.use_state(False)
+ checked, set_checked = reactpy.hooks.use_state(False)
- return idom.html.div(
+ return reactpy.html.div(
Switch(
{
"checked": checked,
@@ -20,4 +20,4 @@ def DayNightSwitch():
)
-idom.run(DayNightSwitch)
+reactpy.run(DayNightSwitch)
diff --git a/docs/source/reference/_examples/matplotlib_plot.py b/docs/source/reference/_examples/matplotlib_plot.py
index c19d2b19b..af7a95e67 100644
--- a/docs/source/reference/_examples/matplotlib_plot.py
+++ b/docs/source/reference/_examples/matplotlib_plot.py
@@ -2,24 +2,24 @@
import matplotlib.pyplot as plt
-import idom
-from idom.widgets import image
+import reactpy
+from reactpy.widgets import image
-@idom.component
+@reactpy.component
def PolynomialPlot():
- coefficients, set_coefficients = idom.hooks.use_state([0])
+ coefficients, set_coefficients = reactpy.hooks.use_state([0])
x = [n for n in linspace(-1, 1, 50)]
y = [polynomial(value, coefficients) for value in x]
- return idom.html.div(
+ return reactpy.html.div(
plot(f"{len(coefficients)} Term Polynomial", x, y),
ExpandableNumberInputs(coefficients, set_coefficients),
)
-@idom.component
+@reactpy.component
def ExpandableNumberInputs(values, set_values):
inputs = []
for i in range(len(values)):
@@ -36,11 +36,11 @@ def add_input():
def del_input():
set_values(values[:-1])
- return idom.html.div(
- idom.html.div(
+ return reactpy.html.div(
+ reactpy.html.div(
"add/remove term:",
- idom.html.button({"on_click": lambda event: add_input()}, "+"),
- idom.html.button({"on_click": lambda event: del_input()}, "-"),
+ reactpy.html.button({"on_click": lambda event: add_input()}, "+"),
+ reactpy.html.button({"on_click": lambda event: del_input()}, "-"),
),
inputs,
)
@@ -57,15 +57,15 @@ def plot(title, x, y):
def poly_coef_input(index, callback):
- return idom.html.div(
+ return reactpy.html.div(
{"style": {"margin-top": "5px"}, "key": index},
- idom.html.label(
+ reactpy.html.label(
"C",
- idom.html.sub(index),
+ reactpy.html.sub(index),
" × X",
- idom.html.sup(index),
+ reactpy.html.sup(index),
),
- idom.html.input({"type": "number", "on_change": callback}),
+ reactpy.html.input({"type": "number", "on_change": callback}),
)
@@ -82,4 +82,4 @@ def linspace(start, stop, n):
yield start + h * i
-idom.run(PolynomialPlot)
+reactpy.run(PolynomialPlot)
diff --git a/docs/source/reference/_examples/network_graph.py b/docs/source/reference/_examples/network_graph.py
index 70187782d..f31bd96b0 100644
--- a/docs/source/reference/_examples/network_graph.py
+++ b/docs/source/reference/_examples/network_graph.py
@@ -1,17 +1,17 @@
import random
-import idom
+import reactpy
-react_cytoscapejs = idom.web.module_from_template(
+react_cytoscapejs = reactpy.web.module_from_template(
"react",
"react-cytoscapejs",
fallback="⌛",
)
-Cytoscape = idom.web.export(react_cytoscapejs, "default")
+Cytoscape = reactpy.web.export(react_cytoscapejs, "default")
-@idom.component
+@reactpy.component
def RandomNetworkGraph():
return Cytoscape(
{
@@ -38,4 +38,4 @@ def random_network(number_of_nodes):
return nodes + conns
-idom.run(RandomNetworkGraph)
+reactpy.run(RandomNetworkGraph)
diff --git a/docs/source/reference/_examples/pigeon_maps.py b/docs/source/reference/_examples/pigeon_maps.py
index ab0157f73..5241a0259 100644
--- a/docs/source/reference/_examples/pigeon_maps.py
+++ b/docs/source/reference/_examples/pigeon_maps.py
@@ -1,11 +1,11 @@
-import idom
+import reactpy
-pigeon_maps = idom.web.module_from_template("react", "pigeon-maps", fallback="⌛")
-Map, Marker = idom.web.export(pigeon_maps, ["Map", "Marker"])
+pigeon_maps = reactpy.web.module_from_template("react", "pigeon-maps", fallback="⌛")
+Map, Marker = reactpy.web.export(pigeon_maps, ["Map", "Marker"])
-@idom.component
+@reactpy.component
def MapWithMarkers():
marker_anchor, add_marker_anchor, remove_marker_anchor = use_set()
@@ -35,7 +35,7 @@ def MapWithMarkers():
def use_set(initial_value=None):
- values, set_values = idom.hooks.use_state(initial_value or set())
+ values, set_values = reactpy.hooks.use_state(initial_value or set())
def add_value(lat_lon):
set_values(values.union({lat_lon}))
@@ -46,4 +46,4 @@ def remove_value(lat_lon):
return values, add_value, remove_value
-idom.run(MapWithMarkers)
+reactpy.run(MapWithMarkers)
diff --git a/docs/source/reference/_examples/simple_dashboard.py b/docs/source/reference/_examples/simple_dashboard.py
index 81e696489..3d592f775 100644
--- a/docs/source/reference/_examples/simple_dashboard.py
+++ b/docs/source/reference/_examples/simple_dashboard.py
@@ -2,28 +2,28 @@
import random
import time
-import idom
-from idom.widgets import Input
+import reactpy
+from reactpy.widgets import Input
-victory = idom.web.module_from_template(
+victory = reactpy.web.module_from_template(
"react",
"victory-line",
fallback="⌛",
# not usually required (see issue #461 for more info)
unmount_before_update=True,
)
-VictoryLine = idom.web.export(victory, "VictoryLine")
+VictoryLine = reactpy.web.export(victory, "VictoryLine")
-@idom.component
+@reactpy.component
def RandomWalk():
- mu = idom.hooks.use_ref(0)
- sigma = idom.hooks.use_ref(1)
+ mu = reactpy.hooks.use_ref(0)
+ sigma = reactpy.hooks.use_ref(1)
- return idom.html.div(
+ return reactpy.html.div(
RandomWalkGraph(mu, sigma),
- idom.html.style(
+ reactpy.html.style(
"""
.number-input-container {margin-bottom: 20px}
.number-input-container input {width: 48%;float: left}
@@ -45,12 +45,12 @@ def RandomWalk():
)
-@idom.component
+@reactpy.component
def RandomWalkGraph(mu, sigma):
interval = use_interval(0.5)
- data, set_data = idom.hooks.use_state([{"x": 0, "y": 0}] * 50)
+ data, set_data = reactpy.hooks.use_state([{"x": 0, "y": 0}] * 50)
- @idom.hooks.use_effect
+ @reactpy.hooks.use_effect
async def animate():
await interval
last_data_point = data[-1]
@@ -71,27 +71,27 @@ async def animate():
)
-@idom.component
+@reactpy.component
def NumberInput(label, value, set_value_callback, domain):
minimum, maximum, step = domain
attrs = {"min": minimum, "max": maximum, "step": step}
- value, set_value = idom.hooks.use_state(value)
+ value, set_value = reactpy.hooks.use_state(value)
def update_value(value):
set_value(value)
set_value_callback(value)
- return idom.html.fieldset(
+ return reactpy.html.fieldset(
{"class_name": "number-input-container"},
- idom.html.legend({"style": {"font-size": "medium"}}, label),
+ reactpy.html.legend({"style": {"font-size": "medium"}}, label),
Input(update_value, "number", value, attributes=attrs, cast=float),
Input(update_value, "range", value, attributes=attrs, cast=float),
)
def use_interval(rate):
- usage_time = idom.hooks.use_ref(time.time())
+ usage_time = reactpy.hooks.use_ref(time.time())
async def interval() -> None:
await asyncio.sleep(rate - (time.time() - usage_time.current))
@@ -100,4 +100,4 @@ async def interval() -> None:
return asyncio.ensure_future(interval())
-idom.run(RandomWalk)
+reactpy.run(RandomWalk)
diff --git a/docs/source/reference/_examples/slideshow.py b/docs/source/reference/_examples/slideshow.py
index 3c6488932..b490b3feb 100644
--- a/docs/source/reference/_examples/slideshow.py
+++ b/docs/source/reference/_examples/slideshow.py
@@ -1,14 +1,14 @@
-import idom
+import reactpy
-@idom.component
+@reactpy.component
def Slideshow():
- index, set_index = idom.hooks.use_state(0)
+ index, set_index = reactpy.hooks.use_state(0)
def next_image(event):
set_index(index + 1)
- return idom.html.img(
+ return reactpy.html.img(
{
"src": f"https://picsum.photos/id/{index}/800/300",
"style": {"cursor": "pointer"},
@@ -17,4 +17,4 @@ def next_image(event):
)
-idom.run(Slideshow)
+reactpy.run(Slideshow)
diff --git a/docs/source/reference/_examples/snake_game.py b/docs/source/reference/_examples/snake_game.py
index 34955c438..eecfea173 100644
--- a/docs/source/reference/_examples/snake_game.py
+++ b/docs/source/reference/_examples/snake_game.py
@@ -3,7 +3,7 @@
import random
import time
-import idom
+import reactpy
class GameState(enum.Enum):
@@ -13,25 +13,25 @@ class GameState(enum.Enum):
play = 3
-@idom.component
+@reactpy.component
def GameView():
- game_state, set_game_state = idom.hooks.use_state(GameState.init)
+ game_state, set_game_state = reactpy.hooks.use_state(GameState.init)
if game_state == GameState.play:
return GameLoop(grid_size=6, block_scale=50, set_game_state=set_game_state)
- start_button = idom.html.button(
+ start_button = reactpy.html.button(
{"on_click": lambda event: set_game_state(GameState.play)}, "Start"
)
if game_state == GameState.won:
- menu = idom.html.div(idom.html.h3("You won!"), start_button)
+ menu = reactpy.html.div(reactpy.html.h3("You won!"), start_button)
elif game_state == GameState.lost:
- menu = idom.html.div(idom.html.h3("You lost"), start_button)
+ menu = reactpy.html.div(reactpy.html.h3("You lost"), start_button)
else:
- menu = idom.html.div(idom.html.h3("Click to play"), start_button)
+ menu = reactpy.html.div(reactpy.html.h3("Click to play"), start_button)
- menu_style = idom.html.style(
+ menu_style = reactpy.html.style(
"""
.snake-game-menu h3 {
margin-top: 0px !important;
@@ -39,7 +39,7 @@ def GameView():
"""
)
- return idom.html.div({"class_name": "snake-game-menu"}, menu_style, menu)
+ return reactpy.html.div({"class_name": "snake-game-menu"}, menu_style, menu)
class Direction(enum.Enum):
@@ -49,19 +49,21 @@ class Direction(enum.Enum):
ArrowRight = (1, 0)
-@idom.component
+@reactpy.component
def GameLoop(grid_size, block_scale, set_game_state):
# we `use_ref` here to capture the latest direction press without any delay
- direction = idom.hooks.use_ref(Direction.ArrowRight.value)
+ direction = reactpy.hooks.use_ref(Direction.ArrowRight.value)
# capture the last direction of travel that was rendered
last_direction = direction.current
- snake, set_snake = idom.hooks.use_state([(grid_size // 2 - 1, grid_size // 2 - 1)])
+ snake, set_snake = reactpy.hooks.use_state(
+ [(grid_size // 2 - 1, grid_size // 2 - 1)]
+ )
food, set_food = use_snake_food(grid_size, snake)
grid = create_grid(grid_size, block_scale)
- @idom.event(prevent_default=True)
+ @reactpy.event(prevent_default=True)
def on_direction_change(event):
if hasattr(Direction, event["key"]):
maybe_new_direction = Direction[event["key"]].value
@@ -71,7 +73,7 @@ def on_direction_change(event):
if direction_vector_sum != (0, 0):
direction.current = maybe_new_direction
- grid_wrapper = idom.html.div({"on_key_down": on_direction_change}, grid)
+ grid_wrapper = reactpy.html.div({"on_key_down": on_direction_change}, grid)
assign_grid_block_color(grid, food, "blue")
@@ -88,7 +90,7 @@ def on_direction_change(event):
interval = use_interval(0.5)
- @idom.hooks.use_effect
+ @reactpy.hooks.use_effect
async def animate():
if new_game_state is not None:
await asyncio.sleep(1)
@@ -118,7 +120,7 @@ def use_snake_food(grid_size, current_snake):
grid_points = {(x, y) for x in range(grid_size) for y in range(grid_size)}
points_not_in_snake = grid_points.difference(current_snake)
- food, _set_food = idom.hooks.use_state(current_snake[-1])
+ food, _set_food = reactpy.hooks.use_state(current_snake[-1])
def set_food():
_set_food(random.choice(list(points_not_in_snake)))
@@ -127,7 +129,7 @@ def set_food():
def use_interval(rate):
- usage_time = idom.hooks.use_ref(time.time())
+ usage_time = reactpy.hooks.use_ref(time.time())
async def interval() -> None:
await asyncio.sleep(rate - (time.time() - usage_time.current))
@@ -137,7 +139,7 @@ async def interval() -> None:
def create_grid(grid_size, block_scale):
- return idom.html.div(
+ return reactpy.html.div(
{
"style": {
"height": f"{block_scale * grid_size}px",
@@ -151,7 +153,7 @@ def create_grid(grid_size, block_scale):
"tab_index": -1,
},
[
- idom.html.div(
+ reactpy.html.div(
{"style": {"height": f"{block_scale}px"}, "key": i},
[
create_grid_block("black", block_scale, key=i)
@@ -164,7 +166,7 @@ def create_grid(grid_size, block_scale):
def create_grid_block(color, block_scale, key):
- return idom.html.div(
+ return reactpy.html.div(
{
"style": {
"height": f"{block_scale}px",
@@ -183,4 +185,4 @@ def assign_grid_block_color(grid, point, color):
block["attributes"]["style"]["backgroundColor"] = color
-idom.run(GameView)
+reactpy.run(GameView)
diff --git a/docs/source/reference/_examples/todo.py b/docs/source/reference/_examples/todo.py
index a6648e8b0..f688f57be 100644
--- a/docs/source/reference/_examples/todo.py
+++ b/docs/source/reference/_examples/todo.py
@@ -1,9 +1,9 @@
-import idom
+import reactpy
-@idom.component
+@reactpy.component
def Todo():
- items, set_items = idom.hooks.use_state([])
+ items, set_items = reactpy.hooks.use_state([])
async def add_new_task(event):
if event["key"] == "Enter":
@@ -16,18 +16,20 @@ async def add_new_task(event):
async def remove_task(event, index=index):
set_items(items[:index] + items[index + 1 :])
- task_text = idom.html.td(idom.html.p(text))
- delete_button = idom.html.td({"on_click": remove_task}, idom.html.button(["x"]))
- tasks.append(idom.html.tr(task_text, delete_button))
+ task_text = reactpy.html.td(reactpy.html.p(text))
+ delete_button = reactpy.html.td(
+ {"on_click": remove_task}, reactpy.html.button(["x"])
+ )
+ tasks.append(reactpy.html.tr(task_text, delete_button))
- task_input = idom.html.input({"on_key_down": add_new_task})
- task_table = idom.html.table(tasks)
+ task_input = reactpy.html.input({"on_key_down": add_new_task})
+ task_table = reactpy.html.table(tasks)
- return idom.html.div(
- idom.html.p("press enter to add a task:"),
+ return reactpy.html.div(
+ reactpy.html.p("press enter to add a task:"),
task_input,
task_table,
)
-idom.run(Todo)
+reactpy.run(Todo)
diff --git a/docs/source/reference/_examples/use_reducer_counter.py b/docs/source/reference/_examples/use_reducer_counter.py
index 22a43efdd..44009422c 100644
--- a/docs/source/reference/_examples/use_reducer_counter.py
+++ b/docs/source/reference/_examples/use_reducer_counter.py
@@ -1,4 +1,4 @@
-import idom
+import reactpy
def reducer(count, action):
@@ -12,15 +12,15 @@ def reducer(count, action):
raise ValueError(f"Unknown action '{action}'")
-@idom.component
+@reactpy.component
def Counter():
- count, dispatch = idom.hooks.use_reducer(reducer, 0)
- return idom.html.div(
+ count, dispatch = reactpy.hooks.use_reducer(reducer, 0)
+ return reactpy.html.div(
f"Count: {count}",
- idom.html.button({"on_click": lambda event: dispatch("reset")}, "Reset"),
- idom.html.button({"on_click": lambda event: dispatch("increment")}, "+"),
- idom.html.button({"on_click": lambda event: dispatch("decrement")}, "-"),
+ reactpy.html.button({"on_click": lambda event: dispatch("reset")}, "Reset"),
+ reactpy.html.button({"on_click": lambda event: dispatch("increment")}, "+"),
+ reactpy.html.button({"on_click": lambda event: dispatch("decrement")}, "-"),
)
-idom.run(Counter)
+reactpy.run(Counter)
diff --git a/docs/source/reference/_examples/use_state_counter.py b/docs/source/reference/_examples/use_state_counter.py
index 42a8b249a..b2d8c84a9 100644
--- a/docs/source/reference/_examples/use_state_counter.py
+++ b/docs/source/reference/_examples/use_state_counter.py
@@ -1,4 +1,4 @@
-import idom
+import reactpy
def increment(last_count):
@@ -9,16 +9,18 @@ def decrement(last_count):
return last_count - 1
-@idom.component
+@reactpy.component
def Counter():
initial_count = 0
- count, set_count = idom.hooks.use_state(initial_count)
- return idom.html.div(
+ count, set_count = reactpy.hooks.use_state(initial_count)
+ return reactpy.html.div(
f"Count: {count}",
- idom.html.button({"on_click": lambda event: set_count(initial_count)}, "Reset"),
- idom.html.button({"on_click": lambda event: set_count(increment)}, "+"),
- idom.html.button({"on_click": lambda event: set_count(decrement)}, "-"),
+ reactpy.html.button(
+ {"on_click": lambda event: set_count(initial_count)}, "Reset"
+ ),
+ reactpy.html.button({"on_click": lambda event: set_count(increment)}, "+"),
+ reactpy.html.button({"on_click": lambda event: set_count(decrement)}, "-"),
)
-idom.run(Counter)
+reactpy.run(Counter)
diff --git a/docs/source/reference/_examples/victory_chart.py b/docs/source/reference/_examples/victory_chart.py
index e2c48d34e..43bf2dbde 100644
--- a/docs/source/reference/_examples/victory_chart.py
+++ b/docs/source/reference/_examples/victory_chart.py
@@ -1,8 +1,8 @@
-import idom
+import reactpy
-victory = idom.web.module_from_template("react", "victory-bar", fallback="⌛")
-VictoryBar = idom.web.export(victory, "VictoryBar")
+victory = reactpy.web.module_from_template("react", "victory-bar", fallback="⌛")
+VictoryBar = reactpy.web.export(victory, "VictoryBar")
bar_style = {"parent": {"width": "500px"}, "data": {"fill": "royalblue"}}
-idom.run(idom.component(lambda: VictoryBar({"style": bar_style})))
+reactpy.run(reactpy.component(lambda: VictoryBar({"style": bar_style})))
diff --git a/docs/source/reference/hooks-api.rst b/docs/source/reference/hooks-api.rst
index f9e9340c1..ca8123e85 100644
--- a/docs/source/reference/hooks-api.rst
+++ b/docs/source/reference/hooks-api.rst
@@ -49,7 +49,7 @@ accepts a single argument (the previous state) and returns the next state. Consi
simply use case of a counter where we've pulled out logic for increment and
decremented the count:
-.. idom:: _examples/use_state_counter
+.. reactpy:: _examples/use_state_counter
We use the functional form for the "+" and "-" buttons since the next ``count`` depends
on the previous value, while for the "Reset" button we simple assign the
@@ -102,7 +102,7 @@ component render functions.
.. note::
Normally in React the ``did_render`` function is called once an update has been
- committed to the screen. Since no such action is performed by IDOM, and the time
+ committed to the screen. Since no such action is performed by ReactPy, and the time
at which the update is displayed cannot be known we are unable to achieve parity
with this behavior.
@@ -153,7 +153,7 @@ Here, a new connection will be established whenever a new ``url`` is set.
Async Effects
.............
-A behavior unique to IDOM's implementation of ``use_effect`` is that it natively
+A behavior unique to ReactPy's implementation of ``use_effect`` is that it natively
supports ``async`` functions:
.. code-block::
@@ -199,7 +199,7 @@ Use Context
value = use_context(MyContext)
Accepts a context object (the value returned from
-:func:`idom.core.hooks.create_context`) and returns the current context value for that
+:func:`reactpy.core.hooks.create_context`) and returns the current context value for that
context. The current context value is determined by the ``value`` argument passed to the
nearest ``MyContext`` in the tree.
@@ -235,7 +235,7 @@ may be slightly more performant as well as being preferable since there is only
We can rework the :ref:`Functional Updates` counter example to use ``use_reducer``:
-.. idom:: _examples/use_reducer_counter
+.. reactpy:: _examples/use_reducer_counter
.. note::
@@ -298,8 +298,8 @@ Use Ref
ref_container = use_ref(initial_value)
-Returns a mutable :class:`~idom.utils.Ref` object that has a single
-:attr:`~idom.utils.Ref.current` attribute that at first contains the ``initial_state``.
+Returns a mutable :class:`~reactpy.utils.Ref` object that has a single
+:attr:`~reactpy.utils.Ref.current` attribute that at first contains the ``initial_state``.
The identity of the ``Ref`` object will be preserved for the lifetime of the component.
A ``Ref`` is most useful if you need to incur side effects since updating its
@@ -329,7 +329,7 @@ Only call outside flow controls
**Don't call hooks inside loops, conditions, or nested functions.** Instead you must
always call hooks at the top level of your functions. By adhering to this rule you
ensure that hooks are always called in the exact same order. This fact is what allows
-IDOM to preserve the state of hooks between multiple calls to ``useState`` and
+ReactPy to preserve the state of hooks between multiple calls to ``useState`` and
``useEffect`` calls.
@@ -342,33 +342,33 @@ Only call in render functions
- ✅ Call Hooks from another custom hook
-Following this rule ensures stateful logic for IDOM component is always clearly
+Following this rule ensures stateful logic for ReactPy component is always clearly
separated from the rest of your codebase.
Flake8 Plugin
-------------
-We provide a Flake8 plugin called `flake8-idom-hooks `_ that helps
+We provide a Flake8 plugin called `flake8-reactpy-hooks `_ that helps
to enforce the two rules described above. You can ``pip`` install it directly, or with
-the ``lint`` extra for IDOM:
+the ``lint`` extra for ReactPy:
.. code-block:: bash
- pip install flake8-idom-hooks
+ pip install flake8-reactpy-hooks
Once installed running, ``flake8`` on your code will start catching errors. For example:
.. code-block:: bash
- flake8 my_idom_components.py
+ flake8 my_reactpy_components.py
Might produce something like the following output:
.. code-block:: text
- ./my_idom_components:10:8 ROH102 hook 'use_effect' used inside if statement
- ./my_idom_components:23:4 ROH102 hook 'use_state' used outside component or hook definition
+ ./my_reactpy_components:10:8 ROH102 hook 'use_effect' used inside if statement
+ ./my_reactpy_components:23:4 ROH102 hook 'use_state' used outside component or hook definition
See the Flake8 docs for
`more info `__.
@@ -376,4 +376,4 @@ See the Flake8 docs for
.. links
.. =====
-.. _Flake8 Linter Plugin: https://github.com/idom-team/flake8-idom-hooks
+.. _Flake8 Linter Plugin: https://github.com/reactive-python/flake8-reactpy-hooks
diff --git a/docs/source/reference/specifications.rst b/docs/source/reference/specifications.rst
index c2f9f68e4..3a5c94893 100644
--- a/docs/source/reference/specifications.rst
+++ b/docs/source/reference/specifications.rst
@@ -5,7 +5,7 @@ Describes various data structures and protocols used to define and communicate v
document object models (:ref:`VDOM`). The definitions below follow in the footsteps of
`a specification `_
created by `Nteract `_ and which was built into
-`JupyterLab `_. While IDOM's specification
+`JupyterLab `_. While ReactPy's specification
for VDOM is fairly well established, it should not be relied until it's been fully
adopted by the aforementioned organizations.
@@ -13,7 +13,7 @@ adopted by the aforementioned organizations.
VDOM
----
-A set of definitions that explain how IDOM creates a virtual representation of
+A set of definitions that explain how ReactPy creates a virtual representation of
the document object model. We'll begin by looking at a bit of HTML that we'll convert
into its VDOM representation:
@@ -35,13 +35,13 @@ into its VDOM representation:
.. code-block:: python
- import idom
+ import reactpy
async def a_python_callback(new):
...
- name_input_view = idom.html.div(
- idom.html.input(
+ name_input_view = reactpy.html.div(
+ reactpy.html.input(
{
"type": "text",
"minLength": 4,
diff --git a/noxfile.py b/noxfile.py
index 9e64c02fe..beca6166e 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -1,67 +1,35 @@
from __future__ import annotations
-import functools
import os
-import re
+from argparse import REMAINDER
+from dataclasses import replace
from pathlib import Path
-from typing import Any, Callable, TypeVar
+from shutil import rmtree
+from typing import Sequence
-import nox
-from nox.sessions import Session
+from noxopt import Annotated, NoxOpt, Option, Session
ROOT = Path(__file__).parent
-SRC = ROOT / "src"
-POSARGS_PATTERN = re.compile(r"^(\w+)\[(.+)\]$")
-TRUE_VALUES = {"true", "True", "TRUE", "1"}
+CLIENT_DIR = ROOT / "src" / "client"
+REMAINING_ARGS = Option(nargs=REMAINDER, type=str)
-_Return = TypeVar("_Return")
+group = NoxOpt(auto_tag=True)
-def do_first(
- first_session_func: Callable[[Session], None]
-) -> Callable[[Callable[[Session], _Return]], Callable[[Session], _Return]]:
- """Decorator for functions defining session actions that should happen first
-
- >>> @do_first
- >>> def setup(session):
- >>> ... # do some setup
- >>>
- >>> @setup
- >>> def the_actual_session(session):
- >>> ... # so actual work
-
- This makes it quick an easy to define common setup actions.
- """
-
- def setup(
- second_session_func: Callable[[Session], _Return]
- ) -> Callable[[Session], _Return]:
- @functools.wraps(second_session_func)
- def wrapper(session: Session) -> Any:
- first_session_func(session)
- return second_session_func(session)
-
- return wrapper
-
- return setup
-
-
-@do_first
-def apply_standard_pip_upgrades(session: Session) -> None:
+@group.setup
+def setup_checks(
+ session: Session,
+ ci: Annotated[bool, Option(help="whether running in CI")] = False,
+) -> None:
session.install("--upgrade", "pip")
-
-
-@do_first
-def install_latest_npm_in_ci(session: Session) -> None:
- if os.environ.get("CI") in TRUE_VALUES:
+ if ci:
session.log("Running in CI environment - installing latest NPM")
session.run("npm", "install", "-g", "npm@latest", external=True)
-@nox.session(reuse_venv=True)
-@apply_standard_pip_upgrades
+@group.session
def format(session: Session) -> None:
"""Auto format Python and Javascript code"""
# format Python
@@ -70,7 +38,7 @@ def format(session: Session) -> None:
session.run("isort", ".")
# format client Javascript
- session.chdir(SRC / "client")
+ session.chdir(CLIENT_DIR)
session.run("npm", "run", "format", external=True)
# format docs Javascript
@@ -78,33 +46,30 @@ def format(session: Session) -> None:
session.run("npm", "run", "format", external=True)
-@nox.session(reuse_venv=True)
-@apply_standard_pip_upgrades
+@group.session
def example(session: Session) -> None:
"""Run an example"""
session.install("matplotlib")
- install_idom_dev(session)
+ install_reactpy_dev(session)
session.run(
"python",
"scripts/one_example.py",
*session.posargs,
- env=get_idom_script_env(),
+ env=get_reactpy_script_env(),
)
-@nox.session(reuse_venv=True)
-@install_latest_npm_in_ci
-@apply_standard_pip_upgrades
+@group.session
def docs(session: Session) -> None:
"""Build and display documentation in the browser (automatically reloads on change)"""
install_requirements_file(session, "build-docs")
- install_idom_dev(session)
+ install_reactpy_dev(session)
session.run(
"python",
"scripts/live_docs.py",
"--open-browser",
# watch python source too
- "--watch=src/idom",
+ "--watch=src/reactpy",
# for some reason this matches absolute paths
"--ignore=**/_auto/*",
"--ignore=**/_static/custom.js",
@@ -116,11 +81,11 @@ def docs(session: Session) -> None:
"html",
"docs/source",
"docs/build",
- env={**os.environ, **get_idom_script_env()},
+ env={**os.environ, **get_reactpy_script_env()},
)
-@nox.session
+@group.session
def docs_in_docker(session: Session) -> None:
"""Build a docker image for the documentation and run it to mimic production"""
session.run(
@@ -130,7 +95,7 @@ def docs_in_docker(session: Session) -> None:
"--file",
"docs/Dockerfile",
"--tag",
- "idom-docs:latest",
+ "reactpy-docs:latest",
external=True,
)
session.run(
@@ -142,97 +107,71 @@ def docs_in_docker(session: Session) -> None:
"-e",
"DEBUG=1",
"--rm",
- "idom-docs:latest",
+ "reactpy-docs:latest",
external=True,
)
-@nox.session
-def test(session: Session) -> None:
- """Run the complete test suite"""
- session.notify("test_python", posargs=session.posargs)
- session.notify("test_docs")
- session.notify("test_javascript")
-
-
-@nox.session
-def test_python(session: Session) -> None:
- """Run all Python checks"""
- session.notify("test_python_suite", posargs=session.posargs)
- session.notify("test_python_types")
- session.notify("test_python_style")
- session.notify("test_python_build")
-
-
-@nox.session
-def test_javascript(session: Session) -> None:
- """Run all Javascript checks"""
- session.notify("test_javascript_suite")
- session.notify("test_javascript_build")
- session.notify("test_javascript_style")
-
-
-@nox.session
-@install_latest_npm_in_ci
-@apply_standard_pip_upgrades
-def test_python_suite(session: Session) -> None:
+@group.session
+def check_python_tests(
+ session: Session,
+ no_cov: Annotated[bool, Option(help="turn off coverage checks")] = False,
+ headed: Annotated[bool, Option(help="run tests with a headed browser")] = False,
+ pytest: Annotated[Sequence[str], replace(REMAINING_ARGS, help="pytest args")] = (),
+) -> None:
"""Run the Python-based test suite"""
- session.env["IDOM_DEBUG_MODE"] = "1"
+ session.env["REACTPY_DEBUG_MODE"] = "1"
install_requirements_file(session, "test-env")
session.run("playwright", "install", "chromium")
- args = ["pytest", "--reruns", "3", "--reruns-delay", "1", *session.posargs]
- check_cov = "--no-cov" not in session.posargs
- if check_cov:
- args = ["coverage", "run", "--source=src/idom", "--module", *args]
- install_idom_dev(session)
- else:
- args.remove("--no-cov")
+ args = ["pytest", *pytest]
+ if headed:
+ args.append("--headed")
+
+ if no_cov:
session.log("Coverage won't be checked")
session.install(".[all]")
+ else:
+ args = ["coverage", "run", "--source=src/reactpy", "--module", *args]
+ install_reactpy_dev(session)
session.run(*args)
- if check_cov:
+ if not no_cov:
session.run("coverage", "report")
-@nox.session
-@apply_standard_pip_upgrades
-def test_python_types(session: Session) -> None:
+@group.session
+def check_python_types(session: Session) -> None:
"""Perform a static type analysis of the Python codebase"""
install_requirements_file(session, "check-types")
install_requirements_file(session, "pkg-deps")
install_requirements_file(session, "pkg-extras")
session.run("mypy", "--version")
- session.run("mypy", "--show-error-codes", "--strict", "src/idom")
+ session.run("mypy", "--show-error-codes", "--strict", "src/reactpy")
-@nox.session
-@apply_standard_pip_upgrades
-def test_python_style(session: Session) -> None:
+@group.session
+def check_python_format(session: Session) -> None:
"""Check that Python style guidelines are being followed"""
install_requirements_file(session, "check-style")
- session.run("flake8", "src/idom", "tests", "docs")
+ session.run("flake8", "src/reactpy", "tests", "docs")
session.run("black", ".", "--check")
session.run("isort", ".", "--check-only")
-@nox.session
-@apply_standard_pip_upgrades
-def test_python_build(session: Session) -> None:
+@group.session
+def check_python_build(session: Session) -> None:
"""Test whether the Python package can be build for distribution"""
install_requirements_file(session, "build-pkg")
session.run("python", "-m", "build", "--sdist", "--wheel", "--outdir", "dist", ".")
-@nox.session
-@install_latest_npm_in_ci
-@apply_standard_pip_upgrades
-def test_docs(session: Session) -> None:
+@group.session
+def check_docs(session: Session) -> None:
"""Verify that the docs build and that doctests pass"""
install_requirements_file(session, "build-docs")
- install_idom_dev(session)
+ install_reactpy_dev(session)
session.run(
"sphinx-build",
"-a", # re-write all output files
@@ -249,42 +188,47 @@ def test_docs(session: Session) -> None:
session.run("docker", "build", ".", "--file", "docs/Dockerfile", external=True)
-@do_first
-@install_latest_npm_in_ci
-def setup_client_env(session: Session) -> None:
- session.chdir(SRC / "client")
+@group.setup("check-javascript")
+def setup_javascript_checks(session: Session) -> None:
+ session.chdir(CLIENT_DIR)
session.run("npm", "install", external=True)
-@nox.session
-@setup_client_env
-def test_javascript_suite(session: Session) -> None:
+@group.session
+def check_javascript_suite(session: Session) -> None:
"""Run the Javascript-based test suite and ensure it bundles succesfully"""
session.run("npm", "run", "test", external=True)
-@nox.session
-@setup_client_env
-def test_javascript_build(session: Session) -> None:
+@group.session
+def check_javascript_build(session: Session) -> None:
"""Run the Javascript-based test suite and ensure it bundles succesfully"""
session.run("npm", "run", "test", external=True)
-@nox.session
-@setup_client_env
-def test_javascript_style(session: Session) -> None:
+@group.session
+def check_javascript_format(session: Session) -> None:
"""Check that Javascript style guidelines are being followed"""
session.run("npm", "run", "check-format", external=True)
-@nox.session
-def build_js(session: Session) -> None:
+@group.session
+def build_javascript(session: Session) -> None:
"""Build javascript client code"""
- session.chdir(SRC / "client")
+ session.chdir(CLIENT_DIR)
session.run("npm", "run", "build", external=True)
-@nox.session
+@group.session
+def build_python(session: Session) -> None:
+ """Build javascript client code"""
+ rmtree(str(ROOT / "build"))
+ rmtree(str(ROOT / "dist"))
+ session.install("build", "wheel")
+ session.run("python", "-m", "build", "--sdist", "--wheel", "--outdir", "dist", ".")
+
+
+@group.session
def tag(session: Session) -> None:
"""Create a new git tag"""
try:
@@ -355,7 +299,7 @@ def tag(session: Session) -> None:
session.run("git", "push", "origin", "main", "--tags", external=True)
-@nox.session(reuse_venv=True)
+@group.session
def changes_since_release(session: Session) -> None:
"""Output the latest changes since the last release"""
session.install("requests", "python-dateutil")
@@ -368,7 +312,7 @@ def install_requirements_file(session: Session, name: str) -> None:
session.install("-r", str(file_path))
-def install_idom_dev(session: Session, extras: str = "all") -> None:
+def install_reactpy_dev(session: Session, extras: str = "all") -> None:
session.run("pip", "--version")
if "--no-install" not in session.posargs:
session.install("-e", f".[{extras}]")
@@ -384,12 +328,12 @@ def set_version(new: str) -> None:
(ROOT / "VERSION").write_text(new.strip() + "\n")
-def get_idom_script_env() -> dict[str, str]:
+def get_reactpy_script_env() -> dict[str, str]:
return {
"PYTHONPATH": os.getcwd(),
- "IDOM_DEBUG_MODE": os.environ.get("IDOM_DEBUG_MODE", "1"),
- "IDOM_TESTING_DEFAULT_TIMEOUT": os.environ.get(
- "IDOM_TESTING_DEFAULT_TIMEOUT", "6.0"
+ "REACTPY_DEBUG_MODE": os.environ.get("REACTPY_DEBUG_MODE", "1"),
+ "REACTPY_TESTING_DEFAULT_TIMEOUT": os.environ.get(
+ "REACTPY_TESTING_DEFAULT_TIMEOUT", "6.0"
),
- "IDOM_CHECK_VDOM_SPEC": os.environ.get("IDOM_CHECK_VDOM_SPEC", "0"),
+ "REACTPY_CHECK_VDOM_SPEC": os.environ.get("REACTPY_CHECK_VDOM_SPEC", "0"),
}
diff --git a/pyproject.toml b/pyproject.toml
index dd81399e6..d912115a7 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -38,7 +38,7 @@ exclude_lines = [
'if TYPE_CHECKING[\s:]',
]
omit = [
- "src/idom/__main__.py",
+ "src/reactpy/__main__.py",
]
[tool.pydocstyle]
diff --git a/requirements/nox-deps.txt b/requirements/nox-deps.txt
index 816817c67..218b48093 100644
--- a/requirements/nox-deps.txt
+++ b/requirements/nox-deps.txt
@@ -1 +1,2 @@
nox
+noxopt
diff --git a/scripts/changes_since_release.py b/scripts/changes_since_release.py
index dfaa840dc..b12f6f94f 100644
--- a/scripts/changes_since_release.py
+++ b/scripts/changes_since_release.py
@@ -6,7 +6,7 @@
REPO_NAME,
date_range_query,
last_release_date,
- search_idom_repo,
+ search_reactpy_repo,
)
@@ -34,7 +34,7 @@ def show_issues(format: str):
print(SECTION_FORMAT_TEMPLATES[format]("Closed Issues"))
template = ISSUE_FORMAT_TEMPLATES[format]
query = f"type:issue closed:{date_range_query(last_release_date())}"
- for issue in search_idom_repo(query):
+ for issue in search_reactpy_repo(query):
print(template(**issue))
@@ -42,7 +42,7 @@ def show_pull_requests(format: str = "text"):
print(SECTION_FORMAT_TEMPLATES[format]("Merged Pull Requests"))
template = PULL_REQUEST_FORMAT_TEMPLATES[format]
query = f"type:pr merged:{date_range_query(last_release_date())}"
- for pull in search_idom_repo(query):
+ for pull in search_reactpy_repo(query):
print(template(**pull))
diff --git a/scripts/common/github_utils.py b/scripts/common/github_utils.py
index d7e892894..f72d6a78c 100644
--- a/scripts/common/github_utils.py
+++ b/scripts/common/github_utils.py
@@ -7,7 +7,7 @@
from dateutil.parser import isoparse
-REPO_NAME = "idom-team/idom"
+REPO_NAME = "reactive-python/reactpy"
def last_release_date() -> datetime:
@@ -30,7 +30,7 @@ def date_range_query(
return start.isoformat() + ".." + stop.isoformat()
-def search_idom_repo(query: str) -> Iterator[Any]:
+def search_reactpy_repo(query: str) -> Iterator[Any]:
page = 0
while True:
page += 1
diff --git a/scripts/live_docs.py b/scripts/live_docs.py
index 960225577..3f7d8b207 100644
--- a/scripts/live_docs.py
+++ b/scripts/live_docs.py
@@ -14,15 +14,15 @@
)
from docs.app import make_app, reload_examples
-from idom.backend.sanic import serve_development_app
-from idom.testing import clear_idom_web_modules_dir
+from reactpy.backend.sanic import serve_development_app
+from reactpy.testing import clear_reactpy_web_modules_dir
# these environment variable are used in custom Sphinx extensions
-os.environ["IDOM_DOC_EXAMPLE_SERVER_HOST"] = "127.0.0.1:5555"
-os.environ["IDOM_DOC_STATIC_SERVER_HOST"] = ""
+os.environ["REACTPY_DOC_EXAMPLE_SERVER_HOST"] = "127.0.0.1:5555"
+os.environ["REACTPY_DOC_STATIC_SERVER_HOST"] = ""
-_running_idom_servers = []
+_running_reactpy_servers = []
def wrap_builder(old_builder):
@@ -54,7 +54,7 @@ async def set_thread_event_when_started():
thread_started.wait()
def new_builder():
- clear_idom_web_modules_dir()
+ clear_reactpy_web_modules_dir()
reload_examples()
old_builder()
diff --git a/scripts/one_example.py b/scripts/one_example.py
index 706dd5182..079bd7a6a 100644
--- a/scripts/one_example.py
+++ b/scripts/one_example.py
@@ -3,9 +3,9 @@
from os.path import getmtime
from threading import Event, Thread
-import idom
+import reactpy
from docs.examples import all_example_names, get_example_files_by_name, load_one_example
-from idom.widgets import _hotswap
+from reactpy.widgets import _hotswap
EXAMPLE_NAME_SET = all_example_names()
@@ -41,7 +41,7 @@ def update_component():
for file in get_example_files_by_name(ex_name):
on_file_change(file, update_component)
- idom.run(component)
+ reactpy.run(component)
def _example_name_input() -> str:
diff --git a/scripts/update_versions.py b/scripts/update_versions.py
index 2a8236178..949bf1709 100644
--- a/scripts/update_versions.py
+++ b/scripts/update_versions.py
@@ -7,7 +7,7 @@
ROOT = Path("__file__").parent.parent
VERSION_FILE = ROOT / Path("VERSION")
-PY_PKG_INIT_FILE = ROOT / "src" / "idom" / "__init__.py"
+PY_PKG_INIT_FILE = ROOT / "src" / "reactpy" / "__init__.py"
JS_ROOT_DIR = ROOT / "src" / "client"
JS_PACKAGE_JSON_FILES = [
pkg_dir / "package.json" for pkg_dir in (JS_ROOT_DIR / "packages").iterdir()
diff --git a/setup.py b/setup.py
index 0dc0e66d0..e0f998876 100644
--- a/setup.py
+++ b/setup.py
@@ -31,7 +31,7 @@ def list2cmdline(cmd_list):
# the name of the project
-NAME = "idom"
+NAME = "reactpy"
# basic paths used to gather files
ROOT_DIR = Path(__file__).parent
@@ -53,7 +53,7 @@ def list2cmdline(cmd_list):
"description": "It's React, but in Python",
"author": "Ryan Morshead",
"author_email": "ryan.morshead@gmail.com",
- "url": "https://github.com/rmorshea/idom",
+ "url": "https://github.com/rmorshea/reactpy",
"license": "MIT",
"platforms": "Linux, Mac OS X, Windows",
"keywords": ["interactive", "widgets", "DOM", "React"],
@@ -149,7 +149,7 @@ def list2cmdline(cmd_list):
# Command Line Interface
# --------------------------------------------------------------------------------------
-package["entry_points"] = {"console_scripts": ["idom=idom.__main__:app"]}
+package["entry_points"] = {"console_scripts": ["reactpy=reactpy.__main__:app"]}
# --------------------------------------------------------------------------------------
# Build Javascript
diff --git a/src/client/README.md b/src/client/README.md
index 1cfd1079e..e99df49c0 100644
--- a/src/client/README.md
+++ b/src/client/README.md
@@ -1,3 +1,3 @@
-# IDOM Client
+# ReactPy Client
-An ES6 Javascript client for IDOM
+An ES6 Javascript client for ReactPy
diff --git a/src/client/index.html b/src/client/index.html
index 87f0244f2..a7a3cff4f 100644
--- a/src/client/index.html
+++ b/src/client/index.html
@@ -8,7 +8,7 @@
diff --git a/src/client/package-lock.json b/src/client/package-lock.json
index 9bd69146c..b5a4bae3e 100644
--- a/src/client/package-lock.json
+++ b/src/client/package-lock.json
@@ -46,15 +46,25 @@
"node": ">=12"
}
},
+ "node_modules/@reactpy/app": {
+ "resolved": "packages/app",
+ "link": true
+ },
+ "node_modules/@reactpy/client": {
+ "resolved": "packages/client",
+ "link": true
+ },
"node_modules/abab": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
- "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q=="
+ "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==",
+ "dev": true
},
"node_modules/acorn": {
"version": "7.4.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
+ "dev": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -66,6 +76,7 @@
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz",
"integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==",
+ "dev": true,
"dependencies": {
"acorn": "^7.1.1",
"acorn-walk": "^7.1.1"
@@ -75,6 +86,7 @@
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz",
"integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==",
+ "dev": true,
"engines": {
"node": ">=0.4.0"
}
@@ -83,6 +95,7 @@
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "dev": true,
"dependencies": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
@@ -98,6 +111,7 @@
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
"integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==",
+ "dev": true,
"dependencies": {
"safer-buffer": "~2.1.0"
}
@@ -106,6 +120,7 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
+ "dev": true,
"engines": {
"node": ">=0.8"
}
@@ -113,12 +128,14 @@
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
- "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
+ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
+ "dev": true
},
"node_modules/aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
"integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=",
+ "dev": true,
"engines": {
"node": "*"
}
@@ -126,12 +143,14 @@
"node_modules/aws4": {
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz",
- "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="
+ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==",
+ "dev": true
},
"node_modules/bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
+ "dev": true,
"dependencies": {
"tweetnacl": "^0.14.3"
}
@@ -139,12 +158,14 @@
"node_modules/browser-process-hrtime": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz",
- "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow=="
+ "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==",
+ "dev": true
},
"node_modules/bufferutil": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.6.tgz",
"integrity": "sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw==",
+ "dev": true,
"hasInstallScript": true,
"optional": true,
"peer": true,
@@ -158,12 +179,14 @@
"node_modules/caseless": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
- "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
+ "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
+ "dev": true
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "dev": true,
"dependencies": {
"delayed-stream": "~1.0.0"
},
@@ -174,17 +197,20 @@
"node_modules/core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
- "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
+ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
+ "dev": true
},
"node_modules/cssom": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz",
- "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw=="
+ "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==",
+ "dev": true
},
"node_modules/cssstyle": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz",
"integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==",
+ "dev": true,
"dependencies": {
"cssom": "~0.3.6"
},
@@ -195,12 +221,14 @@
"node_modules/cssstyle/node_modules/cssom": {
"version": "0.3.8",
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz",
- "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg=="
+ "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==",
+ "dev": true
},
"node_modules/dashdash": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
+ "dev": true,
"dependencies": {
"assert-plus": "^1.0.0"
},
@@ -212,6 +240,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz",
"integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==",
+ "dev": true,
"dependencies": {
"abab": "^2.0.3",
"whatwg-mimetype": "^2.3.0",
@@ -224,17 +253,20 @@
"node_modules/decimal.js": {
"version": "10.2.1",
"resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.1.tgz",
- "integrity": "sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw=="
+ "integrity": "sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw==",
+ "dev": true
},
"node_modules/deep-is": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
- "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="
+ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
+ "dev": true
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
+ "dev": true,
"engines": {
"node": ">=0.4.0"
}
@@ -243,6 +275,7 @@
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz",
"integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==",
+ "dev": true,
"engines": {
"node": ">=6"
}
@@ -251,6 +284,7 @@
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz",
"integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==",
+ "dev": true,
"engines": {
"node": ">=0.3.1"
}
@@ -259,6 +293,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz",
"integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==",
+ "dev": true,
"dependencies": {
"webidl-conversions": "^5.0.0"
},
@@ -270,6 +305,7 @@
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz",
"integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==",
+ "dev": true,
"engines": {
"node": ">=8"
}
@@ -278,6 +314,7 @@
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
"integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
+ "dev": true,
"dependencies": {
"jsbn": "~0.1.0",
"safer-buffer": "^2.1.0"
@@ -607,6 +644,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz",
"integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==",
+ "dev": true,
"dependencies": {
"esprima": "^4.0.1",
"estraverse": "^5.2.0",
@@ -628,6 +666,7 @@
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true,
"optional": true,
"engines": {
"node": ">=0.10.0"
@@ -637,6 +676,7 @@
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+ "dev": true,
"bin": {
"esparse": "bin/esparse.js",
"esvalidate": "bin/esvalidate.js"
@@ -649,6 +689,7 @@
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+ "dev": true,
"engines": {
"node": ">=4.0"
}
@@ -657,6 +698,7 @@
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+ "dev": true,
"engines": {
"node": ">=0.10.0"
}
@@ -664,12 +706,14 @@
"node_modules/extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
- "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
+ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
+ "dev": true
},
"node_modules/extsprintf": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
+ "dev": true,
"engines": [
"node >=0.6.0"
]
@@ -677,22 +721,20 @@
"node_modules/fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
- "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
- },
- "node_modules/fast-json-patch": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.1.tgz",
- "integrity": "sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ=="
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+ "dev": true
},
"node_modules/fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
- "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
+ "dev": true
},
"node_modules/fast-levenshtein": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
- "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="
+ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
+ "dev": true
},
"node_modules/foreach": {
"version": "2.0.6",
@@ -703,6 +745,7 @@
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=",
+ "dev": true,
"engines": {
"node": "*"
}
@@ -711,6 +754,7 @@
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
+ "dev": true,
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
@@ -744,6 +788,7 @@
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
+ "dev": true,
"dependencies": {
"assert-plus": "^1.0.0"
}
@@ -752,6 +797,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
"integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=",
+ "dev": true,
"engines": {
"node": ">=4"
}
@@ -761,6 +807,7 @@
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
"integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
"deprecated": "this library is no longer supported",
+ "dev": true,
"dependencies": {
"ajv": "^6.12.3",
"har-schema": "^2.0.0"
@@ -790,6 +837,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",
"integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==",
+ "dev": true,
"dependencies": {
"whatwg-encoding": "^1.0.5"
},
@@ -801,6 +849,7 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
+ "dev": true,
"dependencies": {
"assert-plus": "^1.0.0",
"jsprim": "^1.2.2",
@@ -815,6 +864,7 @@
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "dev": true,
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3"
},
@@ -822,14 +872,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/idom-app-react": {
- "resolved": "packages/idom-app-react",
- "link": true
- },
- "node_modules/idom-client-react": {
- "resolved": "packages/idom-client-react",
- "link": true
- },
"node_modules/is-core-module": {
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz",
@@ -845,17 +887,20 @@
"node_modules/is-potential-custom-element-name": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz",
- "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ=="
+ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==",
+ "dev": true
},
"node_modules/is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
- "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
+ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
+ "dev": true
},
"node_modules/isstream": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
- "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
+ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
+ "dev": true
},
"node_modules/js-tokens": {
"version": "4.0.0",
@@ -865,12 +910,14 @@
"node_modules/jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
- "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
+ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
+ "dev": true
},
"node_modules/jsdom": {
"version": "16.5.0",
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.5.0.tgz",
"integrity": "sha512-QxZH0nmDTnTTVI0YDm4RUlaUPl5dcyn62G5TMDNfMmTW+J1u1v9gCR8WR+WZ6UghAa7nKJjDOFaI00eMMWvJFQ==",
+ "dev": true,
"dependencies": {
"abab": "^2.0.5",
"acorn": "^8.0.5",
@@ -915,6 +962,7 @@
"version": "8.8.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz",
"integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==",
+ "dev": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -933,22 +981,26 @@
"node_modules/json-schema": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
- "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="
+ "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==",
+ "dev": true
},
"node_modules/json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
- "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
+ "dev": true
},
"node_modules/json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
- "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
+ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
+ "dev": true
},
"node_modules/jsprim": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz",
"integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==",
+ "dev": true,
"dependencies": {
"assert-plus": "1.0.0",
"extsprintf": "1.3.0",
@@ -963,6 +1015,7 @@
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz",
"integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==",
+ "dev": true,
"engines": {
"node": ">=6"
}
@@ -971,6 +1024,7 @@
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
"integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==",
+ "dev": true,
"dependencies": {
"prelude-ls": "~1.1.2",
"type-check": "~0.3.2"
@@ -982,7 +1036,8 @@
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
- "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
+ "dev": true
},
"node_modules/loose-envify": {
"version": "1.4.0",
@@ -999,6 +1054,7 @@
"version": "1.47.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
"integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==",
+ "dev": true,
"engines": {
"node": ">= 0.6"
}
@@ -1007,6 +1063,7 @@
"version": "2.1.30",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
"integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
+ "dev": true,
"dependencies": {
"mime-db": "1.47.0"
},
@@ -1018,6 +1075,7 @@
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz",
"integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==",
+ "dev": true,
"engines": {
"node": ">=4"
}
@@ -1038,6 +1096,7 @@
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz",
"integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==",
+ "dev": true,
"optional": true,
"peer": true,
"bin": {
@@ -1049,12 +1108,14 @@
"node_modules/nwsapi": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz",
- "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ=="
+ "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==",
+ "dev": true
},
"node_modules/oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==",
+ "dev": true,
"engines": {
"node": "*"
}
@@ -1071,6 +1132,7 @@
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
"integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
+ "dev": true,
"dependencies": {
"deep-is": "~0.1.3",
"fast-levenshtein": "~2.0.6",
@@ -1086,7 +1148,8 @@
"node_modules/parse5": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz",
- "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw=="
+ "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==",
+ "dev": true
},
"node_modules/path-parse": {
"version": "1.0.7",
@@ -1097,7 +1160,8 @@
"node_modules/performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
- "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
+ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
+ "dev": true
},
"node_modules/picocolors": {
"version": "1.0.0",
@@ -1142,6 +1206,7 @@
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
"integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==",
+ "dev": true,
"engines": {
"node": ">= 0.8.0"
}
@@ -1150,6 +1215,7 @@
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz",
"integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==",
+ "dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
@@ -1170,12 +1236,14 @@
"node_modules/psl": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
- "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ=="
+ "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==",
+ "dev": true
},
"node_modules/punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
+ "dev": true,
"engines": {
"node": ">=6"
}
@@ -1184,6 +1252,7 @@
"version": "6.5.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz",
"integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==",
+ "dev": true,
"engines": {
"node": ">=0.6"
}
@@ -1191,7 +1260,8 @@
"node_modules/querystringify": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
- "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
+ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==",
+ "dev": true
},
"node_modules/react": {
"version": "16.14.0",
@@ -1230,6 +1300,7 @@
"resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
"integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==",
"deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142",
+ "dev": true,
"dependencies": {
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
@@ -1260,6 +1331,7 @@
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz",
"integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==",
+ "dev": true,
"dependencies": {
"lodash": "^4.17.19"
},
@@ -1275,6 +1347,7 @@
"resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz",
"integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==",
"deprecated": "request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142",
+ "dev": true,
"dependencies": {
"request-promise-core": "1.1.4",
"stealthy-require": "^1.1.1",
@@ -1291,6 +1364,7 @@
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
"integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
+ "dev": true,
"dependencies": {
"psl": "^1.1.28",
"punycode": "^2.1.1"
@@ -1303,6 +1377,7 @@
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
"integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
+ "dev": true,
"dependencies": {
"psl": "^1.1.28",
"punycode": "^2.1.1"
@@ -1314,7 +1389,8 @@
"node_modules/requires-port": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
- "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
+ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
+ "dev": true
},
"node_modules/resolve": {
"version": "1.22.1",
@@ -1337,6 +1413,7 @@
"version": "1.7.4",
"resolved": "https://registry.npmjs.org/sade/-/sade-1.7.4.tgz",
"integrity": "sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==",
+ "dev": true,
"dependencies": {
"mri": "^1.1.0"
},
@@ -1348,6 +1425,7 @@
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "dev": true,
"funding": [
{
"type": "github",
@@ -1366,12 +1444,14 @@
"node_modules/safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
- "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+ "dev": true
},
"node_modules/saxes": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz",
"integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==",
+ "dev": true,
"dependencies": {
"xmlchars": "^2.2.0"
},
@@ -1401,6 +1481,7 @@
"version": "1.16.1",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
"integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==",
+ "dev": true,
"dependencies": {
"asn1": "~0.2.3",
"assert-plus": "^1.0.0",
@@ -1420,6 +1501,7 @@
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz",
"integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=",
+ "dev": true,
"engines": {
"node": ">=0.10.0"
}
@@ -1439,12 +1521,14 @@
"node_modules/symbol-tree": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
- "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="
+ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",
+ "dev": true
},
"node_modules/totalist": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/totalist/-/totalist-2.0.0.tgz",
"integrity": "sha512-+Y17F0YzxfACxTyjfhnJQEe7afPA0GSpYlFkl2VFMxYP7jshQf9gXV7cH47EfToBumFThfKBvfAcoUn6fdNeRQ==",
+ "dev": true,
"engines": {
"node": ">=6"
}
@@ -1453,6 +1537,7 @@
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz",
"integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==",
+ "dev": true,
"dependencies": {
"psl": "^1.1.33",
"punycode": "^2.1.1",
@@ -1467,6 +1552,7 @@
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-2.0.2.tgz",
"integrity": "sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg==",
+ "dev": true,
"dependencies": {
"punycode": "^2.1.1"
},
@@ -1478,6 +1564,7 @@
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
+ "dev": true,
"dependencies": {
"safe-buffer": "^5.0.1"
},
@@ -1488,12 +1575,14 @@
"node_modules/tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
- "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
+ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
+ "dev": true
},
"node_modules/type-check": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
"integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==",
+ "dev": true,
"dependencies": {
"prelude-ls": "~1.1.2"
},
@@ -1505,6 +1594,7 @@
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz",
"integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==",
+ "dev": true,
"engines": {
"node": ">= 4.0.0"
}
@@ -1513,6 +1603,7 @@
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
"integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+ "dev": true,
"dependencies": {
"punycode": "^2.1.0"
}
@@ -1521,6 +1612,7 @@
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
"integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",
+ "dev": true,
"dependencies": {
"querystringify": "^2.1.1",
"requires-port": "^1.0.0"
@@ -1530,6 +1622,7 @@
"version": "5.0.9",
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz",
"integrity": "sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q==",
+ "dev": true,
"hasInstallScript": true,
"optional": true,
"peer": true,
@@ -1544,6 +1637,7 @@
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
+ "dev": true,
"bin": {
"uuid": "bin/uuid"
}
@@ -1552,6 +1646,7 @@
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.1.tgz",
"integrity": "sha512-JGxttnOGDFs77FaZ0yMUHIzczzQ5R1IlDeNW6Wymw6gAscwMdAffVOP6TlxLIfReZyK8tahoGwWZaTCJzNFDkg==",
+ "dev": true,
"dependencies": {
"dequal": "^2.0.0",
"diff": "^5.0.0",
@@ -1570,6 +1665,7 @@
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
+ "dev": true,
"engines": [
"node >=0.6.0"
],
@@ -1676,6 +1772,7 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz",
"integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==",
+ "dev": true,
"dependencies": {
"browser-process-hrtime": "^1.0.0"
}
@@ -1684,6 +1781,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz",
"integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==",
+ "dev": true,
"dependencies": {
"xml-name-validator": "^3.0.0"
},
@@ -1695,6 +1793,7 @@
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
"integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==",
+ "dev": true,
"engines": {
"node": ">=10.4"
}
@@ -1703,6 +1802,7 @@
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz",
"integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==",
+ "dev": true,
"dependencies": {
"iconv-lite": "0.4.24"
}
@@ -1710,12 +1810,14 @@
"node_modules/whatwg-mimetype": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz",
- "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g=="
+ "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==",
+ "dev": true
},
"node_modules/whatwg-url": {
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.5.0.tgz",
"integrity": "sha512-fy+R77xWv0AiqfLl4nuGUlQ3/6b5uNfQ4WAbGQVMYshCTCCPK9psC1nWh3XHuxGVCtlcDDQPQW1csmmIQo+fwg==",
+ "dev": true,
"dependencies": {
"lodash": "^4.7.0",
"tr46": "^2.0.2",
@@ -1729,6 +1831,7 @@
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
+ "dev": true,
"engines": {
"node": ">=0.10.0"
}
@@ -1737,6 +1840,7 @@
"version": "7.5.7",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz",
"integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==",
+ "dev": true,
"engines": {
"node": ">=8.3.0"
},
@@ -1756,30 +1860,30 @@
"node_modules/xml-name-validator": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",
- "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw=="
+ "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==",
+ "dev": true
},
"node_modules/xmlchars": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
- "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw=="
+ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",
+ "dev": true
},
- "packages/idom-app-react": {
+ "packages/@reactpy/app": {
"version": "1.0.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
- "idom-client-react": "file:packages/idom-client-react",
+ "@reactpy/client": "file:packages/@reactpy/client",
"preact": "^10.7.0"
},
"devDependencies": {
"prettier": "^2.5.1"
}
},
- "packages/idom-app-react/node_modules/idom-client-react": {
- "resolved": "packages/idom-app-react/packages/idom-client-react",
- "link": true
- },
- "packages/idom-app-react/packages/idom-client-react": {
+ "packages/@reactpy/app/packages/@reactpy/client": {
"version": "0.0.1",
+ "extraneous": true,
"dependencies": {
"fast-json-patch": "^3.0.0-1",
"htm": "^3.0.3",
@@ -1789,8 +1893,81 @@
"uvu": "^0.5.1"
}
},
- "packages/idom-client-react": {
+ "packages/@reactpy/client": {
"version": "1.0.0",
+ "extraneous": true,
+ "license": "MIT",
+ "dependencies": {
+ "htm": "^3.0.3",
+ "json-pointer": "^0.6.2"
+ },
+ "devDependencies": {
+ "jsdom": "16.5.0",
+ "lodash": "^4.17.21",
+ "prettier": "^2.5.1",
+ "uvu": "^0.5.1"
+ },
+ "peerDependencies": {
+ "react": ">=16",
+ "react-dom": ">=16"
+ }
+ },
+ "packages/app": {
+ "name": "@reactpy/app",
+ "version": "1.0.0-a6",
+ "license": "MIT",
+ "dependencies": {
+ "@reactpy/client": "file:packages/client",
+ "preact": "^10.7.0"
+ },
+ "devDependencies": {
+ "prettier": "^2.5.1"
+ }
+ },
+ "packages/app/node_modules/@reactpy/client": {
+ "resolved": "packages/app/packages/client",
+ "link": true
+ },
+ "packages/app/packages/client": {},
+ "packages/client": {
+ "name": "@reactpy/client",
+ "version": "1.0.0-a6",
+ "license": "MIT",
+ "dependencies": {
+ "htm": "^3.0.3",
+ "json-pointer": "^0.6.2"
+ },
+ "devDependencies": {
+ "jsdom": "16.5.0",
+ "lodash": "^4.17.21",
+ "prettier": "^2.5.1",
+ "uvu": "^0.5.1"
+ },
+ "peerDependencies": {
+ "react": ">=16",
+ "react-dom": ">=16"
+ }
+ },
+ "packages/idom-app-react": {
+ "name": "@reactpy/app",
+ "version": "1.0.0-a5",
+ "extraneous": true,
+ "license": "MIT",
+ "dependencies": {
+ "@reactpy/client": "file:packages/@reactpy/client",
+ "preact": "^10.7.0"
+ },
+ "devDependencies": {
+ "prettier": "^2.5.1"
+ }
+ },
+ "packages/idom-app-react/packages/@reactpy/client": {
+ "extraneous": true
+ },
+ "packages/idom-client-react": {
+ "name": "@reactpy/client",
+ "version": "1.0.0-a5",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"htm": "^3.0.3",
@@ -1823,20 +2000,47 @@
"dev": true,
"optional": true
},
+ "@reactpy/app": {
+ "version": "file:packages/app",
+ "requires": {
+ "@reactpy/client": "file:packages/client",
+ "preact": "^10.7.0",
+ "prettier": "^2.5.1"
+ },
+ "dependencies": {
+ "@reactpy/client": {
+ "version": "file:packages/app/packages/client"
+ }
+ }
+ },
+ "@reactpy/client": {
+ "version": "file:packages/client",
+ "requires": {
+ "htm": "^3.0.3",
+ "jsdom": "16.5.0",
+ "json-pointer": "^0.6.2",
+ "lodash": "^4.17.21",
+ "prettier": "^2.5.1",
+ "uvu": "^0.5.1"
+ }
+ },
"abab": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
- "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q=="
+ "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==",
+ "dev": true
},
"acorn": {
"version": "7.4.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
- "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A=="
+ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
+ "dev": true
},
"acorn-globals": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz",
"integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==",
+ "dev": true,
"requires": {
"acorn": "^7.1.1",
"acorn-walk": "^7.1.1"
@@ -1845,12 +2049,14 @@
"acorn-walk": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz",
- "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA=="
+ "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==",
+ "dev": true
},
"ajv": {
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "dev": true,
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
@@ -1862,6 +2068,7 @@
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
"integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==",
+ "dev": true,
"requires": {
"safer-buffer": "~2.1.0"
}
@@ -1869,27 +2076,32 @@
"assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
- "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
+ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
+ "dev": true
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
- "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
+ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
+ "dev": true
},
"aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
- "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
+ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=",
+ "dev": true
},
"aws4": {
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz",
- "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="
+ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==",
+ "dev": true
},
"bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
+ "dev": true,
"requires": {
"tweetnacl": "^0.14.3"
}
@@ -1897,12 +2109,14 @@
"browser-process-hrtime": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz",
- "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow=="
+ "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==",
+ "dev": true
},
"bufferutil": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.6.tgz",
"integrity": "sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw==",
+ "dev": true,
"optional": true,
"peer": true,
"requires": {
@@ -1912,12 +2126,14 @@
"caseless": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
- "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
+ "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
+ "dev": true
},
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "dev": true,
"requires": {
"delayed-stream": "~1.0.0"
}
@@ -1925,17 +2141,20 @@
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
- "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
+ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
+ "dev": true
},
"cssom": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz",
- "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw=="
+ "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==",
+ "dev": true
},
"cssstyle": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz",
"integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==",
+ "dev": true,
"requires": {
"cssom": "~0.3.6"
},
@@ -1943,7 +2162,8 @@
"cssom": {
"version": "0.3.8",
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz",
- "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg=="
+ "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==",
+ "dev": true
}
}
},
@@ -1951,6 +2171,7 @@
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
+ "dev": true,
"requires": {
"assert-plus": "^1.0.0"
}
@@ -1959,6 +2180,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz",
"integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==",
+ "dev": true,
"requires": {
"abab": "^2.0.3",
"whatwg-mimetype": "^2.3.0",
@@ -1968,32 +2190,38 @@
"decimal.js": {
"version": "10.2.1",
"resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.1.tgz",
- "integrity": "sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw=="
+ "integrity": "sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw==",
+ "dev": true
},
"deep-is": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
- "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="
+ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
+ "dev": true
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
- "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
+ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
+ "dev": true
},
"dequal": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz",
- "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug=="
+ "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==",
+ "dev": true
},
"diff": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz",
- "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w=="
+ "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==",
+ "dev": true
},
"domexception": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz",
"integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==",
+ "dev": true,
"requires": {
"webidl-conversions": "^5.0.0"
},
@@ -2001,7 +2229,8 @@
"webidl-conversions": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz",
- "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA=="
+ "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==",
+ "dev": true
}
}
},
@@ -2009,6 +2238,7 @@
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
"integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
+ "dev": true,
"requires": {
"jsbn": "~0.1.0",
"safer-buffer": "^2.1.0"
@@ -2158,6 +2388,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz",
"integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==",
+ "dev": true,
"requires": {
"esprima": "^4.0.1",
"estraverse": "^5.2.0",
@@ -2170,6 +2401,7 @@
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true,
"optional": true
}
}
@@ -2177,47 +2409,50 @@
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
- "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+ "dev": true
},
"estraverse": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
- "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="
+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+ "dev": true
},
"esutils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
- "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="
+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+ "dev": true
},
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
- "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
+ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
+ "dev": true
},
"extsprintf": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
- "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
+ "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
+ "dev": true
},
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
- "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
- },
- "fast-json-patch": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.1.tgz",
- "integrity": "sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ=="
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+ "dev": true
},
"fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
- "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
+ "dev": true
},
"fast-levenshtein": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
- "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="
+ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
+ "dev": true
},
"foreach": {
"version": "2.0.6",
@@ -2227,12 +2462,14 @@
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
- "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
+ "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=",
+ "dev": true
},
"form-data": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
+ "dev": true,
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
@@ -2256,6 +2493,7 @@
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
+ "dev": true,
"requires": {
"assert-plus": "^1.0.0"
}
@@ -2263,12 +2501,14 @@
"har-schema": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
- "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
+ "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=",
+ "dev": true
},
"har-validator": {
"version": "5.1.5",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
"integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
+ "dev": true,
"requires": {
"ajv": "^6.12.3",
"har-schema": "^2.0.0"
@@ -2292,6 +2532,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",
"integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==",
+ "dev": true,
"requires": {
"whatwg-encoding": "^1.0.5"
}
@@ -2300,6 +2541,7 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
+ "dev": true,
"requires": {
"assert-plus": "^1.0.0",
"jsprim": "^1.2.2",
@@ -2310,42 +2552,11 @@
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "dev": true,
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
},
- "idom-app-react": {
- "version": "file:packages/idom-app-react",
- "requires": {
- "idom-client-react": "file:packages/idom-client-react",
- "preact": "^10.7.0",
- "prettier": "^2.5.1"
- },
- "dependencies": {
- "idom-client-react": {
- "version": "file:packages/idom-app-react/packages/idom-client-react",
- "requires": {
- "fast-json-patch": "^3.0.0-1",
- "htm": "^3.0.3",
- "jsdom": "16.5.0",
- "lodash": "^4.17.21",
- "prettier": "^2.5.1",
- "uvu": "^0.5.1"
- }
- }
- }
- },
- "idom-client-react": {
- "version": "file:packages/idom-client-react",
- "requires": {
- "htm": "^3.0.3",
- "jsdom": "16.5.0",
- "json-pointer": "^0.6.2",
- "lodash": "^4.17.21",
- "prettier": "^2.5.1",
- "uvu": "^0.5.1"
- }
- },
"is-core-module": {
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz",
@@ -2358,17 +2569,20 @@
"is-potential-custom-element-name": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz",
- "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ=="
+ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==",
+ "dev": true
},
"is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
- "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
+ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
+ "dev": true
},
"isstream": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
- "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
+ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
+ "dev": true
},
"js-tokens": {
"version": "4.0.0",
@@ -2377,12 +2591,14 @@
"jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
- "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
+ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
+ "dev": true
},
"jsdom": {
"version": "16.5.0",
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.5.0.tgz",
"integrity": "sha512-QxZH0nmDTnTTVI0YDm4RUlaUPl5dcyn62G5TMDNfMmTW+J1u1v9gCR8WR+WZ6UghAa7nKJjDOFaI00eMMWvJFQ==",
+ "dev": true,
"requires": {
"abab": "^2.0.5",
"acorn": "^8.0.5",
@@ -2415,7 +2631,8 @@
"acorn": {
"version": "8.8.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz",
- "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w=="
+ "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==",
+ "dev": true
}
}
},
@@ -2430,22 +2647,26 @@
"json-schema": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
- "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="
+ "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==",
+ "dev": true
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
- "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
+ "dev": true
},
"json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
- "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
+ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
+ "dev": true
},
"jsprim": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz",
"integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==",
+ "dev": true,
"requires": {
"assert-plus": "1.0.0",
"extsprintf": "1.3.0",
@@ -2456,12 +2677,14 @@
"kleur": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz",
- "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA=="
+ "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==",
+ "dev": true
},
"levn": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
"integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==",
+ "dev": true,
"requires": {
"prelude-ls": "~1.1.2",
"type-check": "~0.3.2"
@@ -2470,7 +2693,8 @@
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
- "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
+ "dev": true
},
"loose-envify": {
"version": "1.4.0",
@@ -2482,12 +2706,14 @@
"mime-db": {
"version": "1.47.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
- "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw=="
+ "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==",
+ "dev": true
},
"mime-types": {
"version": "2.1.30",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
"integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
+ "dev": true,
"requires": {
"mime-db": "1.47.0"
}
@@ -2495,7 +2721,8 @@
"mri": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz",
- "integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ=="
+ "integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==",
+ "dev": true
},
"nanoid": {
"version": "3.3.4",
@@ -2507,18 +2734,21 @@
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz",
"integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==",
+ "dev": true,
"optional": true,
"peer": true
},
"nwsapi": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz",
- "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ=="
+ "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==",
+ "dev": true
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
- "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
+ "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==",
+ "dev": true
},
"object-assign": {
"version": "4.1.1",
@@ -2528,6 +2758,7 @@
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
"integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
+ "dev": true,
"requires": {
"deep-is": "~0.1.3",
"fast-levenshtein": "~2.0.6",
@@ -2540,7 +2771,8 @@
"parse5": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz",
- "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw=="
+ "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==",
+ "dev": true
},
"path-parse": {
"version": "1.0.7",
@@ -2551,7 +2783,8 @@
"performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
- "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
+ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
+ "dev": true
},
"picocolors": {
"version": "1.0.0",
@@ -2578,12 +2811,14 @@
"prelude-ls": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
- "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w=="
+ "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==",
+ "dev": true
},
"prettier": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz",
- "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg=="
+ "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==",
+ "dev": true
},
"prop-types": {
"version": "15.7.2",
@@ -2597,22 +2832,26 @@
"psl": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
- "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ=="
+ "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==",
+ "dev": true
},
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
- "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
+ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
+ "dev": true
},
"qs": {
"version": "6.5.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz",
- "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA=="
+ "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==",
+ "dev": true
},
"querystringify": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
- "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
+ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==",
+ "dev": true
},
"react": {
"version": "16.14.0",
@@ -2641,6 +2880,7 @@
"version": "2.88.2",
"resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
"integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==",
+ "dev": true,
"requires": {
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
@@ -2668,6 +2908,7 @@
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
"integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
+ "dev": true,
"requires": {
"psl": "^1.1.28",
"punycode": "^2.1.1"
@@ -2679,6 +2920,7 @@
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz",
"integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==",
+ "dev": true,
"requires": {
"lodash": "^4.17.19"
}
@@ -2687,6 +2929,7 @@
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz",
"integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==",
+ "dev": true,
"requires": {
"request-promise-core": "1.1.4",
"stealthy-require": "^1.1.1",
@@ -2697,6 +2940,7 @@
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
"integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
+ "dev": true,
"requires": {
"psl": "^1.1.28",
"punycode": "^2.1.1"
@@ -2707,7 +2951,8 @@
"requires-port": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
- "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
+ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
+ "dev": true
},
"resolve": {
"version": "1.22.1",
@@ -2724,6 +2969,7 @@
"version": "1.7.4",
"resolved": "https://registry.npmjs.org/sade/-/sade-1.7.4.tgz",
"integrity": "sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==",
+ "dev": true,
"requires": {
"mri": "^1.1.0"
}
@@ -2731,17 +2977,20 @@
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
- "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "dev": true
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
- "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+ "dev": true
},
"saxes": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz",
"integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==",
+ "dev": true,
"requires": {
"xmlchars": "^2.2.0"
}
@@ -2764,6 +3013,7 @@
"version": "1.16.1",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
"integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==",
+ "dev": true,
"requires": {
"asn1": "~0.2.3",
"assert-plus": "^1.0.0",
@@ -2779,7 +3029,8 @@
"stealthy-require": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz",
- "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks="
+ "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=",
+ "dev": true
},
"supports-preserve-symlinks-flag": {
"version": "1.0.0",
@@ -2790,17 +3041,20 @@
"symbol-tree": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
- "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="
+ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",
+ "dev": true
},
"totalist": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/totalist/-/totalist-2.0.0.tgz",
- "integrity": "sha512-+Y17F0YzxfACxTyjfhnJQEe7afPA0GSpYlFkl2VFMxYP7jshQf9gXV7cH47EfToBumFThfKBvfAcoUn6fdNeRQ=="
+ "integrity": "sha512-+Y17F0YzxfACxTyjfhnJQEe7afPA0GSpYlFkl2VFMxYP7jshQf9gXV7cH47EfToBumFThfKBvfAcoUn6fdNeRQ==",
+ "dev": true
},
"tough-cookie": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz",
"integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==",
+ "dev": true,
"requires": {
"psl": "^1.1.33",
"punycode": "^2.1.1",
@@ -2812,6 +3066,7 @@
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-2.0.2.tgz",
"integrity": "sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg==",
+ "dev": true,
"requires": {
"punycode": "^2.1.1"
}
@@ -2820,6 +3075,7 @@
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
+ "dev": true,
"requires": {
"safe-buffer": "^5.0.1"
}
@@ -2827,12 +3083,14 @@
"tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
- "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
+ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
+ "dev": true
},
"type-check": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
"integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==",
+ "dev": true,
"requires": {
"prelude-ls": "~1.1.2"
}
@@ -2840,12 +3098,14 @@
"universalify": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz",
- "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg=="
+ "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==",
+ "dev": true
},
"uri-js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
"integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+ "dev": true,
"requires": {
"punycode": "^2.1.0"
}
@@ -2854,6 +3114,7 @@
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
"integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",
+ "dev": true,
"requires": {
"querystringify": "^2.1.1",
"requires-port": "^1.0.0"
@@ -2863,6 +3124,7 @@
"version": "5.0.9",
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz",
"integrity": "sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q==",
+ "dev": true,
"optional": true,
"peer": true,
"requires": {
@@ -2872,12 +3134,14 @@
"uuid": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
- "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
+ "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
+ "dev": true
},
"uvu": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.1.tgz",
"integrity": "sha512-JGxttnOGDFs77FaZ0yMUHIzczzQ5R1IlDeNW6Wymw6gAscwMdAffVOP6TlxLIfReZyK8tahoGwWZaTCJzNFDkg==",
+ "dev": true,
"requires": {
"dequal": "^2.0.0",
"diff": "^5.0.0",
@@ -2890,6 +3154,7 @@
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
+ "dev": true,
"requires": {
"assert-plus": "^1.0.0",
"core-util-is": "1.0.2",
@@ -2954,6 +3219,7 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz",
"integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==",
+ "dev": true,
"requires": {
"browser-process-hrtime": "^1.0.0"
}
@@ -2962,6 +3228,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz",
"integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==",
+ "dev": true,
"requires": {
"xml-name-validator": "^3.0.0"
}
@@ -2969,12 +3236,14 @@
"webidl-conversions": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
- "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w=="
+ "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==",
+ "dev": true
},
"whatwg-encoding": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz",
"integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==",
+ "dev": true,
"requires": {
"iconv-lite": "0.4.24"
}
@@ -2982,12 +3251,14 @@
"whatwg-mimetype": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz",
- "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g=="
+ "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==",
+ "dev": true
},
"whatwg-url": {
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.5.0.tgz",
"integrity": "sha512-fy+R77xWv0AiqfLl4nuGUlQ3/6b5uNfQ4WAbGQVMYshCTCCPK9psC1nWh3XHuxGVCtlcDDQPQW1csmmIQo+fwg==",
+ "dev": true,
"requires": {
"lodash": "^4.7.0",
"tr46": "^2.0.2",
@@ -2997,23 +3268,27 @@
"word-wrap": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
- "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ=="
+ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
+ "dev": true
},
"ws": {
"version": "7.5.7",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz",
"integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==",
+ "dev": true,
"requires": {}
},
"xml-name-validator": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",
- "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw=="
+ "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==",
+ "dev": true
},
"xmlchars": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
- "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw=="
+ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",
+ "dev": true
}
}
}
diff --git a/src/client/package.json b/src/client/package.json
index 03056fb12..55f0ef10c 100644
--- a/src/client/package.json
+++ b/src/client/package.json
@@ -5,7 +5,7 @@
"license": "MIT",
"repository": {
"type": "git",
- "url": "https://github.com/idom-team/idom"
+ "url": "https://github.com/reactive-python/reactpy"
},
"scripts": {
"build": "vite build",
diff --git a/src/client/packages/idom-app-react/package-lock.json b/src/client/packages/app/package-lock.json
similarity index 83%
rename from src/client/packages/idom-app-react/package-lock.json
rename to src/client/packages/app/package-lock.json
index 73cd13fc2..9d1075eb8 100644
--- a/src/client/packages/idom-app-react/package-lock.json
+++ b/src/client/packages/app/package-lock.json
@@ -1,23 +1,23 @@
{
- "name": "idom-app-react",
+ "name": "@reactpy/app",
"version": "0.38.0-a1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
- "name": "idom-app-react",
+ "name": "@reactpy/app",
"version": "0.38.0-a1",
"license": "MIT",
"dependencies": {
- "idom-client-react": "file:packages/idom-client-react",
+ "@reactpy/client": "file:packages/@reactpy/client",
"preact": "^10.7.0"
},
"devDependencies": {
"prettier": "^2.5.1"
}
},
- "node_modules/idom-client-react": {
- "resolved": "packages/idom-client-react",
+ "node_modules/@reactpy/client": {
+ "resolved": "packages/@reactpy/client",
"link": true
},
"node_modules/preact": {
@@ -44,11 +44,11 @@
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
- "packages/idom-client-react": {}
+ "packages/@reactpy/client": {}
},
"dependencies": {
- "idom-client-react": {
- "version": "file:packages/idom-client-react"
+ "@reactpy/client": {
+ "version": "file:packages/@reactpy/client"
},
"preact": {
"version": "10.7.0",
diff --git a/src/client/packages/idom-app-react/package.json b/src/client/packages/app/package.json
similarity index 64%
rename from src/client/packages/idom-app-react/package.json
rename to src/client/packages/app/package.json
index bfb8f5680..308b279f3 100644
--- a/src/client/packages/idom-app-react/package.json
+++ b/src/client/packages/app/package.json
@@ -1,19 +1,19 @@
{
"author": "Ryan Morshead",
"dependencies": {
- "idom-client-react": "file:packages/idom-client-react",
+ "@reactpy/client": "file:packages/client",
"preact": "^10.7.0"
},
- "description": "A client application for IDOM implemented in React",
+ "description": "A client application for ReactPy implemented in React",
"devDependencies": {
"prettier": "^2.5.1"
},
"license": "MIT",
"main": "src/index.js",
- "name": "idom-app-react",
+ "name": "@reactpy/app",
"repository": {
"type": "git",
- "url": "https://github.com/idom-team/idom"
+ "url": "https://github.com/reactive-python/reactpy"
},
"scripts": {
"check-format": "prettier --check ./src",
diff --git a/src/client/packages/idom-app-react/src/index.js b/src/client/packages/app/src/index.js
similarity index 92%
rename from src/client/packages/idom-app-react/src/index.js
rename to src/client/packages/app/src/index.js
index 68ebbfee1..27d62ce09 100644
--- a/src/client/packages/idom-app-react/src/index.js
+++ b/src/client/packages/app/src/index.js
@@ -1,4 +1,4 @@
-import { mountWithLayoutServer, LayoutServerInfo } from "idom-client-react";
+import { mountWithLayoutServer, LayoutServerInfo } from "@reactpy/client";
export function mount(mountPoint) {
const serverInfo = new LayoutServerInfo({
diff --git a/src/client/packages/idom-client-react/.gitignore b/src/client/packages/client/.gitignore
similarity index 100%
rename from src/client/packages/idom-client-react/.gitignore
rename to src/client/packages/client/.gitignore
diff --git a/src/client/packages/client/README.md b/src/client/packages/client/README.md
new file mode 100644
index 000000000..a01929943
--- /dev/null
+++ b/src/client/packages/client/README.md
@@ -0,0 +1,3 @@
+# @reactpy/client
+
+A client for ReactPy implemented in React
diff --git a/src/client/packages/idom-client-react/package.json b/src/client/packages/client/package.json
similarity index 80%
rename from src/client/packages/idom-client-react/package.json
rename to src/client/packages/client/package.json
index cd66445b1..7d3ef214f 100644
--- a/src/client/packages/idom-client-react/package.json
+++ b/src/client/packages/client/package.json
@@ -4,7 +4,7 @@
"htm": "^3.0.3",
"json-pointer": "^0.6.2"
},
- "description": "A client for IDOM implemented in React",
+ "description": "A client for ReactPy implemented in React",
"devDependencies": {
"jsdom": "16.5.0",
"lodash": "^4.17.21",
@@ -16,14 +16,14 @@
],
"license": "MIT",
"main": "src/index.js",
- "name": "idom-client-react",
+ "name": "@reactpy/client",
"peerDependencies": {
"react": ">=16",
"react-dom": ">=16"
},
"repository": {
"type": "git",
- "url": "https://github.com/idom-team/idom"
+ "url": "https://github.com/reactive-python/reactpy"
},
"scripts": {
"check-format": "prettier --check ./src ./tests",
diff --git a/src/client/packages/idom-client-react/src/components.js b/src/client/packages/client/src/components.js
similarity index 100%
rename from src/client/packages/idom-client-react/src/components.js
rename to src/client/packages/client/src/components.js
diff --git a/src/client/packages/idom-client-react/src/contexts.js b/src/client/packages/client/src/contexts.js
similarity index 100%
rename from src/client/packages/idom-client-react/src/contexts.js
rename to src/client/packages/client/src/contexts.js
diff --git a/src/client/packages/idom-client-react/src/element-utils.js b/src/client/packages/client/src/element-utils.js
similarity index 100%
rename from src/client/packages/idom-client-react/src/element-utils.js
rename to src/client/packages/client/src/element-utils.js
diff --git a/src/client/packages/idom-client-react/src/event-to-object.js b/src/client/packages/client/src/event-to-object.js
similarity index 100%
rename from src/client/packages/idom-client-react/src/event-to-object.js
rename to src/client/packages/client/src/event-to-object.js
diff --git a/src/client/packages/idom-client-react/src/import-source.js b/src/client/packages/client/src/import-source.js
similarity index 100%
rename from src/client/packages/idom-client-react/src/import-source.js
rename to src/client/packages/client/src/import-source.js
diff --git a/src/client/packages/idom-client-react/src/index.js b/src/client/packages/client/src/index.js
similarity index 100%
rename from src/client/packages/idom-client-react/src/index.js
rename to src/client/packages/client/src/index.js
diff --git a/src/client/packages/idom-client-react/src/mount.js b/src/client/packages/client/src/mount.js
similarity index 92%
rename from src/client/packages/idom-client-react/src/mount.js
rename to src/client/packages/client/src/mount.js
index 5b12985bb..c7472eb12 100644
--- a/src/client/packages/idom-client-react/src/mount.js
+++ b/src/client/packages/client/src/mount.js
@@ -36,7 +36,7 @@ function mountLayoutWithReconnectingWebSocket(
const updateHookPromise = new LazyPromise();
socket.onopen = (event) => {
- console.info(`IDOM WebSocket connected.`);
+ console.info(`ReactPy WebSocket connected.`);
if (mountState.everMounted) {
ReactDOM.unmountComponentAtNode(element);
@@ -57,7 +57,7 @@ function mountLayoutWithReconnectingWebSocket(
socket.onclose = (event) => {
if (!maxReconnectTimeout) {
- console.info(`IDOM WebSocket connection lost.`);
+ console.info(`ReactPy WebSocket connection lost.`);
return;
}
@@ -67,7 +67,7 @@ function mountLayoutWithReconnectingWebSocket(
);
console.info(
- `IDOM WebSocket connection lost. Reconnecting in ${reconnectTimeout} seconds...`
+ `ReactPy WebSocket connection lost. Reconnecting in ${reconnectTimeout} seconds...`
);
setTimeout(function () {
diff --git a/src/client/packages/idom-client-react/src/server.js b/src/client/packages/client/src/server.js
similarity index 90%
rename from src/client/packages/idom-client-react/src/server.js
rename to src/client/packages/client/src/server.js
index b9925f4d5..557f228f7 100644
--- a/src/client/packages/idom-client-react/src/server.js
+++ b/src/client/packages/client/src/server.js
@@ -40,7 +40,7 @@ export function LayoutServerInfo({ host, port, path, query, secure }) {
}
this.path = {
- stream: `${wsBaseUrl}/_idom/stream${pathName}${query}`,
- module: (source) => `/_idom/modules/${source}`,
+ stream: `${wsBaseUrl}/_reactpy/stream${pathName}${query}`,
+ module: (source) => `/_reactpy/modules/${source}`,
};
}
diff --git a/src/client/packages/idom-client-react/tests/event-to-object.test.js b/src/client/packages/client/tests/event-to-object.test.js
similarity index 100%
rename from src/client/packages/idom-client-react/tests/event-to-object.test.js
rename to src/client/packages/client/tests/event-to-object.test.js
diff --git a/src/client/packages/idom-client-react/tests/tooling/dom.js b/src/client/packages/client/tests/tooling/dom.js
similarity index 100%
rename from src/client/packages/idom-client-react/tests/tooling/dom.js
rename to src/client/packages/client/tests/tooling/dom.js
diff --git a/src/client/packages/idom-client-react/tests/tooling/setup.js b/src/client/packages/client/tests/tooling/setup.js
similarity index 100%
rename from src/client/packages/idom-client-react/tests/tooling/setup.js
rename to src/client/packages/client/tests/tooling/setup.js
diff --git a/src/client/packages/idom-client-react/README.md b/src/client/packages/idom-client-react/README.md
deleted file mode 100644
index b4366c5c4..000000000
--- a/src/client/packages/idom-client-react/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# idom-client-react
-A client for IDOM implemented in React
diff --git a/src/client/public/assets/reactpy-logo.ico b/src/client/public/assets/reactpy-logo.ico
new file mode 100644
index 000000000..62be5f5ba
Binary files /dev/null and b/src/client/public/assets/reactpy-logo.ico differ
diff --git a/src/client/public/idom-logo-square-small.svg b/src/client/public/idom-logo-square-small.svg
deleted file mode 100644
index eb36c7b11..000000000
--- a/src/client/public/idom-logo-square-small.svg
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- image/svg+xml
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/client/vite.config.js b/src/client/vite.config.js
index bbcb8ed43..7bfe66bca 100644
--- a/src/client/vite.config.js
+++ b/src/client/vite.config.js
@@ -1,12 +1,12 @@
import { defineConfig } from "vite";
export default defineConfig({
- build: { outDir: "../idom/_client", emptyOutDir: true },
+ build: { outDir: "../reactpy/_client", emptyOutDir: true },
resolve: {
alias: {
react: "preact/compat",
"react-dom": "preact/compat",
},
},
- base: "/_idom",
+ base: "/_reactpy",
});
diff --git a/src/idom/__main__.py b/src/idom/__main__.py
deleted file mode 100644
index 632269ae4..000000000
--- a/src/idom/__main__.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import click
-
-import idom
-from idom._console.rewrite_camel_case_props import rewrite_camel_case_props
-from idom._console.rewrite_keys import rewrite_keys
-
-
-@click.group()
-@click.version_option(idom.__version__, prog_name=idom.__name__)
-def app() -> None:
- pass
-
-
-app.add_command(rewrite_keys)
-app.add_command(rewrite_camel_case_props)
-
-
-if __name__ == "__main__":
- app()
diff --git a/src/idom/testing/__init__.py b/src/idom/testing/__init__.py
deleted file mode 100644
index e674e4555..000000000
--- a/src/idom/testing/__init__.py
+++ /dev/null
@@ -1,23 +0,0 @@
-from .backend import BackendFixture
-from .common import HookCatcher, StaticEventHandler, clear_idom_web_modules_dir, poll
-from .display import DisplayFixture
-from .logs import (
- LogAssertionError,
- assert_idom_did_log,
- assert_idom_did_not_log,
- capture_idom_logs,
-)
-
-
-__all__ = [
- "assert_idom_did_not_log",
- "assert_idom_did_log",
- "capture_idom_logs",
- "clear_idom_web_modules_dir",
- "DisplayFixture",
- "HookCatcher",
- "LogAssertionError",
- "poll",
- "BackendFixture",
- "StaticEventHandler",
-]
diff --git a/src/idom/__init__.py b/src/reactpy/__init__.py
similarity index 55%
rename from src/idom/__init__.py
rename to src/reactpy/__init__.py
index 21acc4ad6..c9adf6cb2 100644
--- a/src/idom/__init__.py
+++ b/src/reactpy/__init__.py
@@ -1,10 +1,10 @@
-from idom import backend, config, html, logging, sample, svg, types, web, widgets
-from idom.backend.hooks import use_connection, use_location, use_scope
-from idom.backend.utils import run
-from idom.core import hooks
-from idom.core.component import component
-from idom.core.events import event
-from idom.core.hooks import (
+from reactpy import backend, config, html, logging, sample, svg, types, web, widgets
+from reactpy.backend.hooks import use_connection, use_location, use_scope
+from reactpy.backend.utils import run
+from reactpy.core import hooks
+from reactpy.core.component import component
+from reactpy.core.events import event
+from reactpy.core.hooks import (
create_context,
use_callback,
use_context,
@@ -15,13 +15,13 @@
use_ref,
use_state,
)
-from idom.core.layout import Layout
-from idom.core.serve import Stop
-from idom.core.vdom import vdom
-from idom.utils import Ref, html_to_vdom, vdom_to_html
+from reactpy.core.layout import Layout
+from reactpy.core.serve import Stop
+from reactpy.core.vdom import vdom
+from reactpy.utils import Ref, html_to_vdom, vdom_to_html
-__author__ = "idom-team"
+__author__ = "The Reactive Python Team"
__version__ = "1.0.0" # DO NOT MODIFY
__all__ = [
diff --git a/src/reactpy/__main__.py b/src/reactpy/__main__.py
new file mode 100644
index 000000000..d70ddf684
--- /dev/null
+++ b/src/reactpy/__main__.py
@@ -0,0 +1,19 @@
+import click
+
+import reactpy
+from reactpy._console.rewrite_camel_case_props import rewrite_camel_case_props
+from reactpy._console.rewrite_keys import rewrite_keys
+
+
+@click.group()
+@click.version_option(reactpy.__version__, prog_name=reactpy.__name__)
+def app() -> None:
+ pass
+
+
+app.add_command(rewrite_keys)
+app.add_command(rewrite_camel_case_props)
+
+
+if __name__ == "__main__":
+ app()
diff --git a/src/idom/_console/__init__.py b/src/reactpy/_console/__init__.py
similarity index 100%
rename from src/idom/_console/__init__.py
rename to src/reactpy/_console/__init__.py
diff --git a/src/idom/_console/ast_utils.py b/src/reactpy/_console/ast_utils.py
similarity index 99%
rename from src/idom/_console/ast_utils.py
rename to src/reactpy/_console/ast_utils.py
index c70833175..aeaf8f512 100644
--- a/src/idom/_console/ast_utils.py
+++ b/src/reactpy/_console/ast_utils.py
@@ -11,7 +11,7 @@
import click
-from idom import html
+from reactpy import html
def rewrite_changed_nodes(
diff --git a/src/idom/_console/rewrite_camel_case_props.py b/src/reactpy/_console/rewrite_camel_case_props.py
similarity index 98%
rename from src/idom/_console/rewrite_camel_case_props.py
rename to src/reactpy/_console/rewrite_camel_case_props.py
index 43b0cc75a..b67c210ab 100644
--- a/src/idom/_console/rewrite_camel_case_props.py
+++ b/src/reactpy/_console/rewrite_camel_case_props.py
@@ -10,7 +10,7 @@
import click
-from idom._console.ast_utils import (
+from reactpy._console.ast_utils import (
ChangedNode,
find_element_constructor_usages,
rewrite_changed_nodes,
diff --git a/src/idom/_console/rewrite_keys.py b/src/reactpy/_console/rewrite_keys.py
similarity index 98%
rename from src/idom/_console/rewrite_keys.py
rename to src/reactpy/_console/rewrite_keys.py
index f5821b4db..7ff672e1e 100644
--- a/src/idom/_console/rewrite_keys.py
+++ b/src/reactpy/_console/rewrite_keys.py
@@ -6,8 +6,8 @@
import click
-from idom import html
-from idom._console.ast_utils import (
+from reactpy import html
+from reactpy._console.ast_utils import (
ChangedNode,
find_element_constructor_usages,
rewrite_changed_nodes,
diff --git a/src/idom/_option.py b/src/reactpy/_option.py
similarity index 99%
rename from src/idom/_option.py
rename to src/reactpy/_option.py
index 50df79b11..b86b7c0cc 100644
--- a/src/idom/_option.py
+++ b/src/reactpy/_option.py
@@ -4,7 +4,7 @@
from logging import getLogger
from typing import Any, Callable, Generic, TypeVar, cast
-from idom._warnings import warn
+from reactpy._warnings import warn
_O = TypeVar("_O")
diff --git a/src/idom/_warnings.py b/src/reactpy/_warnings.py
similarity index 87%
rename from src/idom/_warnings.py
rename to src/reactpy/_warnings.py
index 3b49528e0..573a5ab70 100644
--- a/src/idom/_warnings.py
+++ b/src/reactpy/_warnings.py
@@ -7,7 +7,7 @@
@wraps(_warn)
def warn(*args: Any, **kwargs: Any) -> Any:
- # warn at call site outside of IDOM
+ # warn at call site outside of ReactPy
_warn(*args, stacklevel=_frame_depth_in_module() + 1, **kwargs) # type: ignore
@@ -19,7 +19,7 @@ def _frame_depth_in_module() -> int:
depth = 0
for frame in _iter_frames(2):
module_name = frame.f_globals.get("__name__")
- if not module_name or not module_name.startswith("idom."):
+ if not module_name or not module_name.startswith("reactpy."):
break
depth += 1
return depth
diff --git a/src/idom/backend/__init__.py b/src/reactpy/backend/__init__.py
similarity index 100%
rename from src/idom/backend/__init__.py
rename to src/reactpy/backend/__init__.py
diff --git a/src/idom/backend/_common.py b/src/reactpy/backend/_common.py
similarity index 81%
rename from src/idom/backend/_common.py
rename to src/reactpy/backend/_common.py
index dd7916353..555e2c7f6 100644
--- a/src/idom/backend/_common.py
+++ b/src/reactpy/backend/_common.py
@@ -10,19 +10,19 @@
from uvicorn.config import Config as UvicornConfig
from uvicorn.server import Server as UvicornServer
-from idom import __file__ as _idom_file_path
-from idom import html
-from idom.config import IDOM_WEB_MODULES_DIR
-from idom.core.types import VdomDict
-from idom.utils import vdom_to_html
+from reactpy import __file__ as _reactpy_file_path
+from reactpy import html
+from reactpy.config import REACTPY_WEB_MODULES_DIR
+from reactpy.core.types import VdomDict
+from reactpy.utils import vdom_to_html
-PATH_PREFIX = PurePosixPath("/_idom")
+PATH_PREFIX = PurePosixPath("/_reactpy")
MODULES_PATH = PATH_PREFIX / "modules"
ASSETS_PATH = PATH_PREFIX / "assets"
STREAM_PATH = PATH_PREFIX / "stream"
-CLIENT_BUILD_DIR = Path(_idom_file_path).parent / "_client"
+CLIENT_BUILD_DIR = Path(_reactpy_file_path).parent / "_client"
async def serve_development_asgi(
@@ -68,8 +68,8 @@ def safe_client_build_dir_path(path: str) -> Path:
def safe_web_modules_dir_path(path: str) -> Path:
- """Prevent path traversal out of :data:`idom.config.IDOM_WEB_MODULES_DIR`"""
- return traversal_safe_path(IDOM_WEB_MODULES_DIR.current, *path.split("/"))
+ """Prevent path traversal out of :data:`reactpy.config.REACTPY_WEB_MODULES_DIR`"""
+ return traversal_safe_path(REACTPY_WEB_MODULES_DIR.current, *path.split("/"))
def traversal_safe_path(root: str | Path, *unsafe: str | Path) -> Path:
@@ -108,15 +108,15 @@ def vdom_head_elements_to_html(head: Sequence[VdomDict] | VdomDict | str) -> str
@dataclass
class CommonOptions:
- """Options for IDOM's built-in backed server implementations"""
+ """Options for ReactPy's built-in backed server implementations"""
head: Sequence[VdomDict] | VdomDict | str = (
- html.title("IDOM"),
+ html.title("ReactPy"),
html.link(
{
"rel": "icon",
- "href": "_idom/assets/idom-logo-square-small.svg",
- "type": "image/svg+xml",
+ "href": "/_reactpy/assets/reactpy-logo.ico",
+ "type": "image/x-icon",
}
),
)
@@ -127,7 +127,7 @@ class CommonOptions:
"""
url_prefix: str = ""
- """The URL prefix where IDOM resources will be served from"""
+ """The URL prefix where ReactPy resources will be served from"""
def __post_init__(self) -> None:
if self.url_prefix and not self.url_prefix.startswith("/"):
diff --git a/src/idom/backend/default.py b/src/reactpy/backend/default.py
similarity index 97%
rename from src/idom/backend/default.py
rename to src/reactpy/backend/default.py
index dda5b6bee..b24bfc314 100644
--- a/src/idom/backend/default.py
+++ b/src/reactpy/backend/default.py
@@ -5,7 +5,7 @@
from sys import exc_info
from typing import Any, NoReturn
-from idom.types import RootComponentConstructor
+from reactpy.types import RootComponentConstructor
from .types import BackendImplementation
from .utils import all_implementations
diff --git a/src/idom/backend/fastapi.py b/src/reactpy/backend/fastapi.py
similarity index 57%
rename from src/idom/backend/fastapi.py
rename to src/reactpy/backend/fastapi.py
index 2e68d705a..c3cd038d8 100644
--- a/src/idom/backend/fastapi.py
+++ b/src/reactpy/backend/fastapi.py
@@ -6,19 +6,19 @@
serve_development_app = starlette.serve_development_app
-"""Alias for :func:`idom.backend.starlette.serve_development_app`"""
+"""Alias for :func:`reactpy.backend.starlette.serve_development_app`"""
use_connection = starlette.use_connection
-"""Alias for :func:`idom.backend.starlette.use_location`"""
+"""Alias for :func:`reactpy.backend.starlette.use_location`"""
use_websocket = starlette.use_websocket
-"""Alias for :func:`idom.backend.starlette.use_websocket`"""
+"""Alias for :func:`reactpy.backend.starlette.use_websocket`"""
Options = starlette.Options
-"""Alias for :class:`idom.backend.starlette.Options`"""
+"""Alias for :class:`reactpy.backend.starlette.Options`"""
configure = starlette.configure
-"""Alias for :class:`idom.backend.starlette.configure`"""
+"""Alias for :class:`reactpy.backend.starlette.configure`"""
def create_development_app() -> FastAPI:
diff --git a/src/idom/backend/flask.py b/src/reactpy/backend/flask.py
similarity index 90%
rename from src/idom/backend/flask.py
rename to src/reactpy/backend/flask.py
index 8cb2b4980..1e07159c9 100644
--- a/src/idom/backend/flask.py
+++ b/src/reactpy/backend/flask.py
@@ -24,8 +24,8 @@
from simple_websocket import Server as WebSocket
from werkzeug.serving import BaseWSGIServer, make_server
-import idom
-from idom.backend._common import (
+import reactpy
+from reactpy.backend._common import (
ASSETS_PATH,
MODULES_PATH,
PATH_PREFIX,
@@ -35,12 +35,12 @@
safe_client_build_dir_path,
safe_web_modules_dir_path,
)
-from idom.backend.hooks import ConnectionContext
-from idom.backend.hooks import use_connection as _use_connection
-from idom.backend.types import Connection, Location
-from idom.core.serve import serve_layout
-from idom.core.types import ComponentType, RootComponentConstructor
-from idom.utils import Ref
+from reactpy.backend.hooks import ConnectionContext
+from reactpy.backend.hooks import use_connection as _use_connection
+from reactpy.backend.types import Connection, Location
+from reactpy.core.serve import serve_layout
+from reactpy.core.types import ComponentType, RootComponentConstructor
+from reactpy.utils import Ref
logger = logging.getLogger(__name__)
@@ -49,7 +49,7 @@
def configure(
app: Flask, component: RootComponentConstructor, options: Options | None = None
) -> None:
- """Configure the necessary IDOM routes on the given app.
+ """Configure the necessary ReactPy routes on the given app.
Parameters:
app: An application instance
@@ -58,8 +58,10 @@ def configure(
"""
options = options or Options()
- api_bp = Blueprint(f"idom_api_{id(app)}", __name__, url_prefix=str(PATH_PREFIX))
- spa_bp = Blueprint(f"idom_spa_{id(app)}", __name__, url_prefix=options.url_prefix)
+ api_bp = Blueprint(f"reactpy_api_{id(app)}", __name__, url_prefix=str(PATH_PREFIX))
+ spa_bp = Blueprint(
+ f"reactpy_spa_{id(app)}", __name__, url_prefix=options.url_prefix
+ )
_setup_single_view_dispatcher_route(api_bp, options, component)
_setup_common_routes(api_bp, spa_bp, options)
@@ -137,7 +139,7 @@ def use_connection() -> Connection[_FlaskCarrier]:
@dataclass
class Options(CommonOptions):
- """Render server config for :func:`idom.backend.flask.configure`"""
+ """Render server config for :func:`reactpy.backend.flask.configure`"""
cors: bool | dict[str, Any] = False
"""Enable or configure Cross Origin Resource Sharing (CORS)
@@ -205,7 +207,9 @@ def _dispatch_in_thread(
recv: Callable[[], Optional[Any]],
) -> NoReturn:
dispatch_thread_info_created = ThreadEvent()
- dispatch_thread_info_ref: idom.Ref[Optional[_DispatcherThreadInfo]] = idom.Ref(None)
+ dispatch_thread_info_ref: reactpy.Ref[
+ Optional[_DispatcherThreadInfo]
+ ] = reactpy.Ref(None)
@copy_current_request_context
def run_dispatcher() -> None:
@@ -221,7 +225,7 @@ async def send_coro(value: Any) -> None:
async def main() -> None:
search = request.query_string.decode()
await serve_layout(
- idom.Layout(
+ reactpy.Layout(
ConnectionContext(
component,
value=Connection(
diff --git a/src/idom/backend/hooks.py b/src/reactpy/backend/hooks.py
similarity index 90%
rename from src/idom/backend/hooks.py
rename to src/reactpy/backend/hooks.py
index c5b5d7c9a..f2dce5501 100644
--- a/src/idom/backend/hooks.py
+++ b/src/reactpy/backend/hooks.py
@@ -2,7 +2,7 @@
from typing import Any, MutableMapping
-from idom.core.hooks import Context, create_context, use_context
+from reactpy.core.hooks import Context, create_context, use_context
from .types import Connection, Location
diff --git a/src/idom/backend/sanic.py b/src/reactpy/backend/sanic.py
similarity index 92%
rename from src/idom/backend/sanic.py
rename to src/reactpy/backend/sanic.py
index e4b9e07b0..41c59f7db 100644
--- a/src/idom/backend/sanic.py
+++ b/src/reactpy/backend/sanic.py
@@ -13,10 +13,10 @@
from sanic.server.websockets.connection import WebSocketConnection
from sanic_cors import CORS
-from idom.backend.types import Connection, Location
-from idom.core.layout import Layout
-from idom.core.serve import RecvCoroutine, SendCoroutine, Stop, serve_layout
-from idom.core.types import RootComponentConstructor
+from reactpy.backend.types import Connection, Location
+from reactpy.core.layout import Layout
+from reactpy.core.serve import RecvCoroutine, SendCoroutine, Stop, serve_layout
+from reactpy.core.types import RootComponentConstructor
from ._common import (
ASSETS_PATH,
@@ -42,8 +42,8 @@ def configure(
"""Configure an application instance to display the given component"""
options = options or Options()
- spa_bp = Blueprint(f"idom_spa_{id(app)}", url_prefix=options.url_prefix)
- api_bp = Blueprint(f"idom_api_{id(app)}", url_prefix=str(PATH_PREFIX))
+ spa_bp = Blueprint(f"reactpy_spa_{id(app)}", url_prefix=options.url_prefix)
+ api_bp = Blueprint(f"reactpy_api_{id(app)}", url_prefix=str(PATH_PREFIX))
_setup_common_routes(api_bp, spa_bp, options)
_setup_single_view_dispatcher_route(api_bp, component, options)
@@ -55,7 +55,7 @@ def create_development_app() -> Sanic:
"""Return a :class:`Sanic` app instance in test mode"""
Sanic.test_mode = True
logger.warning("Sanic.test_mode is now active")
- app = Sanic(f"idom_development_app_{uuid4().hex}", Config())
+ app = Sanic(f"reactpy_development_app_{uuid4().hex}", Config())
return app
@@ -92,7 +92,7 @@ def use_connection() -> Connection[_SanicCarrier]:
@dataclass
class Options(CommonOptions):
- """Render server config for :func:`idom.backend.sanic.configure`"""
+ """Render server config for :func:`reactpy.backend.sanic.configure`"""
cors: bool | dict[str, Any] = False
"""Enable or configure Cross Origin Resource Sharing (CORS)
diff --git a/src/idom/backend/starlette.py b/src/reactpy/backend/starlette.py
similarity index 89%
rename from src/idom/backend/starlette.py
rename to src/reactpy/backend/starlette.py
index 1e82d7c85..234737cf1 100644
--- a/src/idom/backend/starlette.py
+++ b/src/reactpy/backend/starlette.py
@@ -13,12 +13,12 @@
from starlette.staticfiles import StaticFiles
from starlette.websockets import WebSocket, WebSocketDisconnect
-from idom.backend.hooks import ConnectionContext
-from idom.backend.types import Connection, Location
-from idom.config import IDOM_WEB_MODULES_DIR
-from idom.core.layout import Layout
-from idom.core.serve import RecvCoroutine, SendCoroutine, serve_layout
-from idom.core.types import RootComponentConstructor
+from reactpy.backend.hooks import ConnectionContext
+from reactpy.backend.types import Connection, Location
+from reactpy.config import REACTPY_WEB_MODULES_DIR
+from reactpy.core.layout import Layout
+from reactpy.core.serve import RecvCoroutine, SendCoroutine, serve_layout
+from reactpy.core.types import RootComponentConstructor
from ._common import (
ASSETS_PATH,
@@ -41,7 +41,7 @@ def configure(
constructor: RootComponentConstructor,
options: Options | None = None,
) -> None:
- """Configure the necessary IDOM routes on the given app.
+ """Configure the necessary ReactPy routes on the given app.
Parameters:
app: An application instance
@@ -88,7 +88,7 @@ def use_connection() -> Connection[WebSocket]:
@dataclass
class Options(CommonOptions):
- """Render server config for :func:`idom.backend.starlette.configure`"""
+ """Render server config for :func:`reactpy.backend.starlette.configure`"""
cors: bool | dict[str, Any] = False
"""Enable or configure Cross Origin Resource Sharing (CORS)
@@ -111,7 +111,7 @@ def _setup_common_routes(options: Options, app: Starlette) -> None:
app.mount(
str(MODULES_PATH),
- StaticFiles(directory=IDOM_WEB_MODULES_DIR.current, check_dir=False),
+ StaticFiles(directory=REACTPY_WEB_MODULES_DIR.current, check_dir=False),
)
app.mount(
str(ASSETS_PATH),
diff --git a/src/idom/backend/tornado.py b/src/reactpy/backend/tornado.py
similarity index 93%
rename from src/idom/backend/tornado.py
rename to src/reactpy/backend/tornado.py
index dfa54eb5c..30fd174f7 100644
--- a/src/idom/backend/tornado.py
+++ b/src/reactpy/backend/tornado.py
@@ -16,11 +16,11 @@
from tornado.wsgi import WSGIContainer
from typing_extensions import TypeAlias
-from idom.backend.types import Connection, Location
-from idom.config import IDOM_WEB_MODULES_DIR
-from idom.core.layout import Layout
-from idom.core.serve import serve_layout
-from idom.core.types import ComponentConstructor
+from reactpy.backend.types import Connection, Location
+from reactpy.config import REACTPY_WEB_MODULES_DIR
+from reactpy.core.layout import Layout
+from reactpy.core.serve import serve_layout
+from reactpy.core.types import ComponentConstructor
from ._common import (
ASSETS_PATH,
@@ -35,7 +35,7 @@
Options = CommonOptions
-"""Render server config for :func:`idom.backend.tornado.configure`"""
+"""Render server config for :func:`reactpy.backend.tornado.configure`"""
def configure(
@@ -43,7 +43,7 @@ def configure(
component: ComponentConstructor,
options: CommonOptions | None = None,
) -> None:
- """Configure the necessary IDOM routes on the given app.
+ """Configure the necessary ReactPy routes on the given app.
Parameters:
app: An application instance
@@ -116,7 +116,7 @@ def _setup_common_routes(options: Options) -> _RouteHandlerSpecs:
(
rf"{MODULES_PATH}/(.*)",
StaticFileHandler,
- {"path": str(IDOM_WEB_MODULES_DIR.current)},
+ {"path": str(REACTPY_WEB_MODULES_DIR.current)},
),
(
rf"{ASSETS_PATH}/(.*)",
diff --git a/src/idom/backend/types.py b/src/reactpy/backend/types.py
similarity index 97%
rename from src/idom/backend/types.py
rename to src/reactpy/backend/types.py
index 2e7826fae..fb19aa5d0 100644
--- a/src/idom/backend/types.py
+++ b/src/reactpy/backend/types.py
@@ -6,7 +6,7 @@
from typing_extensions import Protocol, runtime_checkable
-from idom.core.types import RootComponentConstructor
+from reactpy.core.types import RootComponentConstructor
_App = TypeVar("_App")
diff --git a/src/idom/backend/utils.py b/src/reactpy/backend/utils.py
similarity index 93%
rename from src/idom/backend/utils.py
rename to src/reactpy/backend/utils.py
index 6398d6b0d..5105cf9c0 100644
--- a/src/idom/backend/utils.py
+++ b/src/reactpy/backend/utils.py
@@ -7,7 +7,7 @@
from importlib import import_module
from typing import Any, Iterator
-from idom.types import RootComponentConstructor
+from reactpy.types import RootComponentConstructor
from .types import BackendImplementation
@@ -32,7 +32,7 @@ def run(
"""Run a component with a development server"""
logger.warning(_DEVELOPMENT_RUN_FUNC_WARNING)
- implementation = implementation or import_module("idom.backend.default")
+ implementation = implementation or import_module("reactpy.backend.default")
app = implementation.create_development_app()
implementation.configure(app, component)
@@ -96,6 +96,6 @@ def all_implementations() -> Iterator[BackendImplementation[Any]]:
_DEVELOPMENT_RUN_FUNC_WARNING = f"""\
The `run()` function is only intended for testing during development! To run in \
production, consider selecting a supported backend and importing its associated \
-`configure()` function from `idom.backend.` where `` is one of \
+`configure()` function from `reactpy.backend.` where `` is one of \
{list(SUPPORTED_PACKAGES)}. For details refer to the docs on how to run each package.\
"""
diff --git a/src/idom/config.py b/src/reactpy/config.py
similarity index 63%
rename from src/idom/config.py
rename to src/reactpy/config.py
index fa7617638..8f26271c4 100644
--- a/src/idom/config.py
+++ b/src/reactpy/config.py
@@ -1,5 +1,5 @@
"""
-IDOM provides a series of configuration options that can be set using environment
+ReactPy provides a series of configuration options that can be set using environment
variables or, for those which allow it, a programatic interface.
"""
@@ -9,8 +9,8 @@
from ._option import Option as _Option
-IDOM_DEBUG_MODE = _Option(
- "IDOM_DEBUG_MODE",
+REACTPY_DEBUG_MODE = _Option(
+ "REACTPY_DEBUG_MODE",
default=False,
validator=lambda x: bool(int(x)),
)
@@ -20,20 +20,20 @@
When debug is on, extra validation measures are applied that negatively impact
performance but can be used to catch bugs during development. Additionally, the default
-log level for IDOM is set to ``DEBUG``.
+log level for ReactPy is set to ``DEBUG``.
"""
-IDOM_CHECK_VDOM_SPEC = _Option(
- "IDOM_CHECK_VDOM_SPEC",
- default=IDOM_DEBUG_MODE,
+REACTPY_CHECK_VDOM_SPEC = _Option(
+ "REACTPY_CHECK_VDOM_SPEC",
+ default=REACTPY_DEBUG_MODE,
validator=lambda x: bool(int(x)),
)
"""This immutable option turns on/off checks which ensure VDOM is rendered to spec
The string values ``1`` and ``0`` are mapped to ``True`` and ``False`` respectively.
-By default this check is off. When ``IDOM_DEBUG_MODE=1`` this will be turned on but can
-be manually disablled by setting ``IDOM_CHECK_VDOM_SPEC=0`` in addition.
+By default this check is off. When ``REACTPY_DEBUG_MODE=1`` this will be turned on but can
+be manually disablled by setting ``REACTPY_CHECK_VDOM_SPEC=0`` in addition.
For more info on the VDOM spec, see here: :ref:`VDOM JSON Schema`
"""
@@ -41,22 +41,22 @@
# Because these web modules will be linked dynamically at runtime this can be temporary
_DEFAULT_WEB_MODULES_DIR = TemporaryDirectory()
-IDOM_WEB_MODULES_DIR = _Option(
- "IDOM_WEB_MODULES_DIR",
+REACTPY_WEB_MODULES_DIR = _Option(
+ "REACTPY_WEB_MODULES_DIR",
default=Path(_DEFAULT_WEB_MODULES_DIR.name),
validator=Path,
)
-"""The location IDOM will use to store its client application
+"""The location ReactPy will use to store its client application
This directory **MUST** be treated as a black box. Downstream applications **MUST NOT**
-assume anything about the structure of this directory see :mod:`idom.web.module` for a
+assume anything about the structure of this directory see :mod:`reactpy.web.module` for a
set of publically available APIs for working with the client.
"""
-IDOM_TESTING_DEFAULT_TIMEOUT = _Option(
- "IDOM_TESTING_DEFAULT_TIMEOUT",
+REACTPY_TESTING_DEFAULT_TIMEOUT = _Option(
+ "REACTPY_TESTING_DEFAULT_TIMEOUT",
5.0,
mutable=False,
validator=float,
)
-"""A default timeout for testing utilities in IDOM"""
+"""A default timeout for testing utilities in ReactPy"""
diff --git a/src/idom/core/__init__.py b/src/reactpy/core/__init__.py
similarity index 100%
rename from src/idom/core/__init__.py
rename to src/reactpy/core/__init__.py
diff --git a/src/idom/core/_f_back.py b/src/reactpy/core/_f_back.py
similarity index 100%
rename from src/idom/core/_f_back.py
rename to src/reactpy/core/_f_back.py
diff --git a/src/idom/core/_thread_local.py b/src/reactpy/core/_thread_local.py
similarity index 100%
rename from src/idom/core/_thread_local.py
rename to src/reactpy/core/_thread_local.py
diff --git a/src/idom/core/component.py b/src/reactpy/core/component.py
similarity index 95%
rename from src/idom/core/component.py
rename to src/reactpy/core/component.py
index ff4e4c655..79731ad4e 100644
--- a/src/idom/core/component.py
+++ b/src/reactpy/core/component.py
@@ -13,7 +13,7 @@ def component(
"""A decorator for defining a new component.
Parameters:
- function: The component's :meth:`idom.core.proto.ComponentType.render` function.
+ function: The component's :meth:`reactpy.core.proto.ComponentType.render` function.
"""
sig = inspect.signature(function)
diff --git a/src/idom/core/events.py b/src/reactpy/core/events.py
similarity index 93%
rename from src/idom/core/events.py
rename to src/reactpy/core/events.py
index 990e3185d..4cad9fd7f 100644
--- a/src/idom/core/events.py
+++ b/src/reactpy/core/events.py
@@ -6,7 +6,7 @@
from anyio import create_task_group
from typing_extensions import Literal
-from idom.core.types import EventHandlerFunc, EventHandlerType
+from reactpy.core.types import EventHandlerFunc, EventHandlerType
@overload
@@ -41,7 +41,7 @@ def event(
.. code-block:: python
- element = idom.html.button({"onClick": my_callback})
+ element = reactpy.html.button({"onClick": my_callback})
You may want the ability to prevent the default action associated with the event
from taking place, or stoping the event from propagating up the DOM. This decorator
@@ -53,7 +53,7 @@ def event(
def my_callback(*data):
...
- element = idom.html.button({"onClick": my_callback})
+ element = reactpy.html.button({"onClick": my_callback})
Parameters:
function:
@@ -134,7 +134,7 @@ def to_event_handler_function(
function: Callable[..., Any],
positional_args: bool = True,
) -> EventHandlerFunc:
- """Make a :data:`~idom.core.proto.EventHandlerFunc` from a function or coroutine
+ """Make a :data:`~reactpy.core.proto.EventHandlerFunc` from a function or coroutine
Parameters:
function:
@@ -170,8 +170,8 @@ def merge_event_handlers(
"""Merge multiple event handlers into one
Raises a ValueError if any handlers have conflicting
- :attr:`~idom.core.proto.EventHandlerType.stop_propagation` or
- :attr:`~idom.core.proto.EventHandlerType.prevent_default` attributes.
+ :attr:`~reactpy.core.proto.EventHandlerType.stop_propagation` or
+ :attr:`~reactpy.core.proto.EventHandlerType.prevent_default` attributes.
"""
if not event_handlers:
raise ValueError("No event handlers to merge")
diff --git a/src/idom/core/hooks.py b/src/reactpy/core/hooks.py
similarity index 98%
rename from src/idom/core/hooks.py
rename to src/reactpy/core/hooks.py
index 251374f02..c40a6869f 100644
--- a/src/idom/core/hooks.py
+++ b/src/reactpy/core/hooks.py
@@ -18,8 +18,8 @@
from typing_extensions import Protocol, TypeAlias
-from idom.config import IDOM_DEBUG_MODE
-from idom.utils import Ref
+from reactpy.config import REACTPY_DEBUG_MODE
+from reactpy.utils import Ref
from ._thread_local import ThreadLocal
from .types import ComponentType, Key, State, VdomDict
@@ -185,7 +185,7 @@ def use_debug_value(
"""Log debug information when the given message changes.
.. note::
- This hook only logs if :data:`~idom.config.IDOM_DEBUG_MODE` is active.
+ This hook only logs if :data:`~reactpy.config.REACTPY_DEBUG_MODE` is active.
Unlike other hooks, a message is considered to have changed if the old and new
values are ``!=``. Because this comparison is performed on every render of the
@@ -204,7 +204,7 @@ def use_debug_value(
memo_func = message if callable(message) else lambda: message
new = use_memo(memo_func, dependencies)
- if IDOM_DEBUG_MODE.current and old.current != new:
+ if REACTPY_DEBUG_MODE.current and old.current != new:
old.current = new
logger.debug(f"{current_hook().component} {new}")
@@ -528,7 +528,7 @@ class LifeCycleHook:
"""Defines the life cycle of a layout component.
Components can request access to their own life cycle events and state through hooks
- while :class:`~idom.core.proto.LayoutType` objects drive drive the life cycle
+ while :class:`~reactpy.core.proto.LayoutType` objects drive drive the life cycle
forward by triggering events and rendering view changes.
Example:
@@ -538,7 +538,7 @@ class LifeCycleHook:
.. testcode::
- from idom.core.hooks import (
+ from reactpy.core.hooks import (
current_hook,
LifeCycleHook,
COMPONENT_DID_RENDER_EFFECT,
diff --git a/src/idom/core/layout.py b/src/reactpy/core/layout.py
similarity index 98%
rename from src/idom/core/layout.py
rename to src/reactpy/core/layout.py
index 1e111f108..2b785815e 100644
--- a/src/idom/core/layout.py
+++ b/src/reactpy/core/layout.py
@@ -19,8 +19,8 @@
from uuid import uuid4
from weakref import ref as weakref
-from idom.config import IDOM_CHECK_VDOM_SPEC, IDOM_DEBUG_MODE
-from idom.utils import Ref
+from reactpy.config import REACTPY_CHECK_VDOM_SPEC, REACTPY_DEBUG_MODE
+from reactpy.utils import Ref
from .hooks import LifeCycleHook
from .types import (
@@ -116,7 +116,7 @@ async def render(self) -> LayoutUpdateMessage:
)
else:
update = self._create_layout_update(model_state)
- if IDOM_CHECK_VDOM_SPEC.current:
+ if REACTPY_CHECK_VDOM_SPEC.current:
root_id = self._root_life_cycle_state_id
root_model = self._model_states_by_life_cycle_state_id[root_id]
validate_vdom_json(root_model.model.current)
@@ -165,7 +165,7 @@ def _render_component(
"tagName": "",
"error": (
f"{type(error).__name__}: {error}"
- if IDOM_DEBUG_MODE.current
+ if REACTPY_DEBUG_MODE.current
else ""
),
}
@@ -641,7 +641,7 @@ class _LifeCycleState(NamedTuple):
"""Component state for :class:`_ModelState`"""
id: _LifeCycleStateId
- """A unique identifier used in the :class:`~idom.core.hooks.LifeCycleHook` callback"""
+ """A unique identifier used in the :class:`~reactpy.core.hooks.LifeCycleHook` callback"""
hook: LifeCycleHook
"""The life cycle hook"""
diff --git a/src/idom/core/serve.py b/src/reactpy/core/serve.py
similarity index 86%
rename from src/idom/core/serve.py
rename to src/reactpy/core/serve.py
index 470c37ecc..2802df9e2 100644
--- a/src/idom/core/serve.py
+++ b/src/reactpy/core/serve.py
@@ -6,7 +6,7 @@
from anyio import create_task_group
-from idom.core.types import LayoutEventMessage, LayoutType, LayoutUpdateMessage
+from reactpy.core.types import LayoutEventMessage, LayoutType, LayoutUpdateMessage
logger = getLogger(__name__)
@@ -16,9 +16,9 @@
"""Send model patches given by a dispatcher"""
RecvCoroutine = Callable[[], Awaitable[LayoutEventMessage]]
-"""Called by a dispatcher to return a :class:`idom.core.layout.LayoutEventMessage`
+"""Called by a dispatcher to return a :class:`reactpy.core.layout.LayoutEventMessage`
-The event will then trigger an :class:`idom.core.proto.EventHandlerType` in a layout.
+The event will then trigger an :class:`reactpy.core.proto.EventHandlerType` in a layout.
"""
diff --git a/src/idom/core/types.py b/src/reactpy/core/types.py
similarity index 100%
rename from src/idom/core/types.py
rename to src/reactpy/core/types.py
diff --git a/src/idom/core/vdom.py b/src/reactpy/core/vdom.py
similarity index 98%
rename from src/idom/core/vdom.py
rename to src/reactpy/core/vdom.py
index edbe92122..9579560b9 100644
--- a/src/idom/core/vdom.py
+++ b/src/reactpy/core/vdom.py
@@ -7,10 +7,10 @@
from fastjsonschema import compile as compile_json_schema
from typing_extensions import Protocol
-from idom._warnings import warn
-from idom.config import IDOM_DEBUG_MODE
-from idom.core.events import EventHandler, to_event_handler_function
-from idom.core.types import (
+from reactpy._warnings import warn
+from reactpy.config import REACTPY_DEBUG_MODE
+from reactpy.core.events import EventHandler, to_event_handler_function
+from reactpy.core.types import (
ComponentType,
EventHandlerDict,
EventHandlerType,
@@ -318,7 +318,7 @@ def _is_attributes(value: Any) -> bool:
def _is_single_child(value: Any) -> bool:
if isinstance(value, (str, Mapping)) or not hasattr(value, "__iter__"):
return True
- if IDOM_DEBUG_MODE.current:
+ if REACTPY_DEBUG_MODE.current:
_validate_child_key_integrity(value)
return False
diff --git a/src/idom/html.py b/src/reactpy/html.py
similarity index 98%
rename from src/idom/html.py
rename to src/reactpy/html.py
index 622ebf0ff..fa4953cda 100644
--- a/src/idom/html.py
+++ b/src/reactpy/html.py
@@ -159,8 +159,14 @@
from typing import Sequence
-from idom.core.types import EventHandlerDict, Key, VdomAttributes, VdomChild, VdomDict
-from idom.core.vdom import custom_vdom_constructor, make_vdom_constructor
+from reactpy.core.types import (
+ EventHandlerDict,
+ Key,
+ VdomAttributes,
+ VdomChild,
+ VdomDict,
+)
+from reactpy.core.vdom import custom_vdom_constructor, make_vdom_constructor
__all__ = (
diff --git a/src/idom/logging.py b/src/reactpy/logging.py
similarity index 76%
rename from src/idom/logging.py
rename to src/reactpy/logging.py
index d90887497..1a07984a1 100644
--- a/src/idom/logging.py
+++ b/src/reactpy/logging.py
@@ -2,7 +2,7 @@
import sys
from logging.config import dictConfig
-from .config import IDOM_DEBUG_MODE
+from .config import REACTPY_DEBUG_MODE
dictConfig(
@@ -10,7 +10,7 @@
"version": 1,
"disable_existing_loggers": False,
"loggers": {
- "idom": {"handlers": ["console"]},
+ "reactpy": {"handlers": ["console"]},
},
"handlers": {
"console": {
@@ -30,14 +30,14 @@
)
-ROOT_LOGGER = logging.getLogger("idom")
-"""IDOM's root logger instance"""
+ROOT_LOGGER = logging.getLogger("reactpy")
+"""ReactPy's root logger instance"""
-@IDOM_DEBUG_MODE.subscribe
+@REACTPY_DEBUG_MODE.subscribe
def _set_debug_level(debug: bool) -> None:
if debug:
ROOT_LOGGER.setLevel("DEBUG")
- ROOT_LOGGER.debug("IDOM is in debug mode")
+ ROOT_LOGGER.debug("ReactPy is in debug mode")
else:
ROOT_LOGGER.setLevel("INFO")
diff --git a/src/idom/py.typed b/src/reactpy/py.typed
similarity index 100%
rename from src/idom/py.typed
rename to src/reactpy/py.typed
diff --git a/src/idom/sample.py b/src/reactpy/sample.py
similarity index 72%
rename from src/idom/sample.py
rename to src/reactpy/sample.py
index 908de34b7..7905c1586 100644
--- a/src/idom/sample.py
+++ b/src/reactpy/sample.py
@@ -11,9 +11,9 @@ def SampleApp() -> VdomDict:
{"id": "sample", "style": {"padding": "15px"}},
html.h1("Sample Application"),
html.p(
- "This is a basic application made with IDOM. Click ",
+ "This is a basic application made with ReactPy. Click ",
html.a(
- {"href": "https://pypi.org/project/idom/", "target": "_blank"},
+ {"href": "https://pypi.org/project/reactpy/", "target": "_blank"},
"here",
),
" to learn more.",
diff --git a/src/idom/svg.py b/src/reactpy/svg.py
similarity index 99%
rename from src/idom/svg.py
rename to src/reactpy/svg.py
index 655c0feab..ef9995468 100644
--- a/src/idom/svg.py
+++ b/src/reactpy/svg.py
@@ -1,4 +1,4 @@
-from idom.core.vdom import make_vdom_constructor
+from reactpy.core.vdom import make_vdom_constructor
__all__ = (
diff --git a/src/reactpy/testing/__init__.py b/src/reactpy/testing/__init__.py
new file mode 100644
index 000000000..1c9fcda1c
--- /dev/null
+++ b/src/reactpy/testing/__init__.py
@@ -0,0 +1,23 @@
+from .backend import BackendFixture
+from .common import HookCatcher, StaticEventHandler, clear_reactpy_web_modules_dir, poll
+from .display import DisplayFixture
+from .logs import (
+ LogAssertionError,
+ assert_reactpy_did_log,
+ assert_reactpy_did_not_log,
+ capture_reactpy_logs,
+)
+
+
+__all__ = [
+ "assert_reactpy_did_not_log",
+ "assert_reactpy_did_log",
+ "capture_reactpy_logs",
+ "clear_reactpy_web_modules_dir",
+ "DisplayFixture",
+ "HookCatcher",
+ "LogAssertionError",
+ "poll",
+ "BackendFixture",
+ "StaticEventHandler",
+]
diff --git a/src/idom/testing/backend.py b/src/reactpy/testing/backend.py
similarity index 89%
rename from src/idom/testing/backend.py
rename to src/reactpy/testing/backend.py
index 3d6634ca8..5749e1fef 100644
--- a/src/idom/testing/backend.py
+++ b/src/reactpy/testing/backend.py
@@ -7,16 +7,16 @@
from typing import Any, Callable, Optional, Tuple, Type, Union
from urllib.parse import urlencode, urlunparse
-from idom.backend import default as default_server
-from idom.backend.types import BackendImplementation
-from idom.backend.utils import find_available_port
-from idom.config import IDOM_TESTING_DEFAULT_TIMEOUT
-from idom.core.component import component
-from idom.core.hooks import use_callback, use_effect, use_state
-from idom.core.types import ComponentConstructor
-from idom.utils import Ref
+from reactpy.backend import default as default_server
+from reactpy.backend.types import BackendImplementation
+from reactpy.backend.utils import find_available_port
+from reactpy.config import REACTPY_TESTING_DEFAULT_TIMEOUT
+from reactpy.core.component import component
+from reactpy.core.hooks import use_callback, use_effect, use_state
+from reactpy.core.types import ComponentConstructor
+from reactpy.utils import Ref
-from .logs import LogAssertionError, capture_idom_logs, list_logged_exceptions
+from .logs import LogAssertionError, capture_reactpy_logs, list_logged_exceptions
class BackendFixture:
@@ -48,7 +48,7 @@ def __init__(
self.port = port or find_available_port(host, allow_reuse_waiting_ports=False)
self.mount, self._root_component = _hotswap()
self.timeout = (
- IDOM_TESTING_DEFAULT_TIMEOUT.current if timeout is None else timeout
+ REACTPY_TESTING_DEFAULT_TIMEOUT.current if timeout is None else timeout
)
if app is not None:
@@ -109,7 +109,7 @@ def list_logged_exceptions(
async def __aenter__(self) -> BackendFixture:
self._exit_stack = AsyncExitStack()
- self._records = self._exit_stack.enter_context(capture_idom_logs())
+ self._records = self._exit_stack.enter_context(capture_reactpy_logs())
app = self._app or self.implementation.create_development_app()
self.implementation.configure(app, self._root_component, self._options)
@@ -172,12 +172,12 @@ def _hotswap(update_on_change: bool = False) -> Tuple[_MountFunc, ComponentConst
Example:
.. code-block:: python
- import idom
+ import reactpy
- show, root = idom.hotswap()
+ show, root = reactpy.hotswap()
PerClientStateServer(root).run_in_thread("localhost", 8765)
- @idom.component
+ @reactpy.component
def DivOne(self):
return {"tagName": "div", "children": [1]}
@@ -185,7 +185,7 @@ def DivOne(self):
# displaying the output now will show DivOne
- @idom.component
+ @reactpy.component
def DivTwo(self):
return {"tagName": "div", "children": [2]}
diff --git a/src/idom/testing/common.py b/src/reactpy/testing/common.py
similarity index 84%
rename from src/idom/testing/common.py
rename to src/reactpy/testing/common.py
index 5052903b9..61b4a9a0e 100644
--- a/src/idom/testing/common.py
+++ b/src/reactpy/testing/common.py
@@ -11,14 +11,14 @@
from typing_extensions import ParamSpec
-from idom.config import IDOM_TESTING_DEFAULT_TIMEOUT, IDOM_WEB_MODULES_DIR
-from idom.core.events import EventHandler, to_event_handler_function
-from idom.core.hooks import LifeCycleHook, current_hook
+from reactpy.config import REACTPY_TESTING_DEFAULT_TIMEOUT, REACTPY_WEB_MODULES_DIR
+from reactpy.core.events import EventHandler, to_event_handler_function
+from reactpy.core.hooks import LifeCycleHook, current_hook
-def clear_idom_web_modules_dir() -> None:
- """Clear the directory where IDOM stores registered web modules"""
- for path in IDOM_WEB_MODULES_DIR.current.iterdir():
+def clear_reactpy_web_modules_dir() -> None:
+ """Clear the directory where ReactPy stores registered web modules"""
+ for path in REACTPY_WEB_MODULES_DIR.current.iterdir():
shutil.rmtree(path) if path.is_dir() else path.unlink()
@@ -54,7 +54,7 @@ async def coro(*args: _P.args, **kwargs: _P.kwargs) -> _R:
async def until(
self,
condition: Callable[[_R], bool],
- timeout: float = IDOM_TESTING_DEFAULT_TIMEOUT.current,
+ timeout: float = REACTPY_TESTING_DEFAULT_TIMEOUT.current,
delay: float = _DEFAULT_POLL_DELAY,
description: str = "condition to be true",
) -> None:
@@ -74,7 +74,7 @@ async def until(
async def until_is(
self,
right: _R,
- timeout: float = IDOM_TESTING_DEFAULT_TIMEOUT.current,
+ timeout: float = REACTPY_TESTING_DEFAULT_TIMEOUT.current,
delay: float = _DEFAULT_POLL_DELAY,
) -> None:
"""Wait until the result is identical to the given value"""
@@ -88,7 +88,7 @@ async def until_is(
async def until_equals(
self,
right: _R,
- timeout: float = IDOM_TESTING_DEFAULT_TIMEOUT.current,
+ timeout: float = REACTPY_TESTING_DEFAULT_TIMEOUT.current,
delay: float = _DEFAULT_POLL_DELAY,
) -> None:
"""Wait until the result is equal to the given value"""
@@ -108,7 +108,7 @@ class HookCatcher:
hooks = HookCatcher(index_by_kwarg="thing")
- @idom.component
+ @reactpy.component
@hooks.capture
def MyComponent(thing):
...
@@ -161,11 +161,11 @@ class StaticEventHandler:
static_handler = StaticEventHandler()
- @idom.component
+ @reactpy.component
def MyComponent():
- state, set_state = idom.hooks.use_state(0)
+ state, set_state = reactpy.hooks.use_state(0)
handler = static_handler.use(lambda event: set_state(state + 1))
- return idom.html.button({"onClick": handler}, "Click me!")
+ return reactpy.html.button({"onClick": handler}, "Click me!")
# gives the target ID for onClick where from the last render of MyComponent
static_handlers.target
@@ -180,15 +180,15 @@ def MyComponent():
"second": StaticEventHandler(),
}
- @idom.component
+ @reactpy.component
def Parent():
- return idom.html.div(Child(key="first"), Child(key="second"))
+ return reactpy.html.div(Child(key="first"), Child(key="second"))
- @idom.component
+ @reactpy.component
def Child(key):
- state, set_state = idom.hooks.use_state(0)
+ state, set_state = reactpy.hooks.use_state(0)
handler = static_handlers_by_key[key].use(lambda event: set_state(state + 1))
- return idom.html.button({"onClick": handler}, "Click me!")
+ return reactpy.html.button({"onClick": handler}, "Click me!")
# grab the individual targets for each instance above
first_target = static_handlers_by_key["first"].target
diff --git a/src/idom/testing/display.py b/src/reactpy/testing/display.py
similarity index 92%
rename from src/idom/testing/display.py
rename to src/reactpy/testing/display.py
index fa96c93c2..e97fb5927 100644
--- a/src/idom/testing/display.py
+++ b/src/reactpy/testing/display.py
@@ -12,8 +12,8 @@
async_playwright,
)
-from idom.config import IDOM_TESTING_DEFAULT_TIMEOUT
-from idom.types import RootComponentConstructor
+from reactpy.config import REACTPY_TESTING_DEFAULT_TIMEOUT
+from reactpy.types import RootComponentConstructor
from .backend import BackendFixture
@@ -73,7 +73,7 @@ async def __aenter__(self) -> DisplayFixture:
browser = self._browser
self.page = await browser.new_page()
- self.page.set_default_timeout(IDOM_TESTING_DEFAULT_TIMEOUT.current * 1000)
+ self.page.set_default_timeout(REACTPY_TESTING_DEFAULT_TIMEOUT.current * 1000)
if not hasattr(self, "backend"):
self.backend = BackendFixture()
diff --git a/src/idom/testing/logs.py b/src/reactpy/testing/logs.py
similarity index 91%
rename from src/idom/testing/logs.py
rename to src/reactpy/testing/logs.py
index 10e99a67b..0a0bebf7a 100644
--- a/src/idom/testing/logs.py
+++ b/src/reactpy/testing/logs.py
@@ -6,7 +6,7 @@
from traceback import format_exception
from typing import Any, Iterator, NoReturn
-from idom.logging import ROOT_LOGGER
+from reactpy.logging import ROOT_LOGGER
class LogAssertionError(AssertionError):
@@ -14,12 +14,12 @@ class LogAssertionError(AssertionError):
@contextmanager
-def assert_idom_did_log(
+def assert_reactpy_did_log(
match_message: str = "",
error_type: type[Exception] | None = None,
match_error: str = "",
) -> Iterator[None]:
- """Assert that IDOM produced a log matching the described message or error.
+ """Assert that ReactPy produced a log matching the described message or error.
Args:
match_message: Must match a logged message.
@@ -29,7 +29,7 @@ def assert_idom_did_log(
message_pattern = re.compile(match_message)
error_pattern = re.compile(match_error)
- with capture_idom_logs() as log_records:
+ with capture_reactpy_logs() as log_records:
try:
yield None
except Exception:
@@ -70,14 +70,14 @@ def assert_idom_did_log(
@contextmanager
-def assert_idom_did_not_log(
+def assert_reactpy_did_not_log(
match_message: str = "",
error_type: type[Exception] | None = None,
match_error: str = "",
) -> Iterator[None]:
- """Assert the inverse of :func:`assert_idom_logged`"""
+ """Assert the inverse of :func:`assert_reactpy_logged`"""
try:
- with assert_idom_did_log(match_message, error_type, match_error):
+ with assert_reactpy_did_log(match_message, error_type, match_error):
yield None
except LogAssertionError:
pass
@@ -121,8 +121,8 @@ def list_logged_exceptions(
@contextmanager
-def capture_idom_logs() -> Iterator[list[logging.LogRecord]]:
- """Capture logs from IDOM
+def capture_reactpy_logs() -> Iterator[list[logging.LogRecord]]:
+ """Capture logs from ReactPy
Any logs produced in this context are cleared afterwards
"""
diff --git a/src/idom/types.py b/src/reactpy/types.py
similarity index 94%
rename from src/idom/types.py
rename to src/reactpy/types.py
index 2931e8636..b8ed1ca2a 100644
--- a/src/idom/types.py
+++ b/src/reactpy/types.py
@@ -1,7 +1,7 @@
"""Exports common types from:
-- :mod:`idom.core.types`
-- :mod:`idom.backend.types`
+- :mod:`reactpy.core.types`
+- :mod:`reactpy.backend.types`
"""
from .backend.types import BackendImplementation, Connection, Location
diff --git a/src/idom/utils.py b/src/reactpy/utils.py
similarity index 99%
rename from src/idom/utils.py
rename to src/reactpy/utils.py
index 16aef68fb..e42097aa0 100644
--- a/src/idom/utils.py
+++ b/src/reactpy/utils.py
@@ -7,8 +7,8 @@
from lxml import etree
from lxml.html import fromstring, tostring
-from idom.core.types import VdomDict
-from idom.core.vdom import vdom
+from reactpy.core.types import VdomDict
+from reactpy.core.vdom import vdom
_RefValue = TypeVar("_RefValue")
diff --git a/src/idom/web/__init__.py b/src/reactpy/web/__init__.py
similarity index 100%
rename from src/idom/web/__init__.py
rename to src/reactpy/web/__init__.py
diff --git a/src/idom/web/module.py b/src/reactpy/web/module.py
similarity index 96%
rename from src/idom/web/module.py
rename to src/reactpy/web/module.py
index 162f02611..efdd2395f 100644
--- a/src/idom/web/module.py
+++ b/src/reactpy/web/module.py
@@ -9,10 +9,10 @@
from typing import Any, NewType, overload
from urllib.parse import urlparse
-from idom._warnings import warn
-from idom.config import IDOM_DEBUG_MODE, IDOM_WEB_MODULES_DIR
-from idom.core.types import ImportSourceDict, VdomDictConstructor
-from idom.core.vdom import make_vdom_constructor
+from reactpy._warnings import warn
+from reactpy.config import REACTPY_DEBUG_MODE, REACTPY_WEB_MODULES_DIR
+from reactpy.core.types import ImportSourceDict, VdomDictConstructor
+from reactpy.core.vdom import make_vdom_constructor
from .utils import (
module_name_suffix,
@@ -67,7 +67,7 @@ def module_from_url(
if (
resolve_exports
if resolve_exports is not None
- else IDOM_DEBUG_MODE.current
+ else REACTPY_DEBUG_MODE.current
)
else None
),
@@ -90,7 +90,7 @@ def module_from_template(
"""Create a :class:`WebModule` from a framework template
This is useful for experimenting with component libraries that do not already
- support IDOM's :ref:`Custom Javascript Component` interface.
+ support ReactPy's :ref:`Custom Javascript Component` interface.
.. warning::
@@ -215,7 +215,7 @@ def module_from_file(
if (
resolve_exports
if resolve_exports is not None
- else IDOM_DEBUG_MODE.current
+ else REACTPY_DEBUG_MODE.current
)
else None
),
@@ -290,7 +290,7 @@ def module_from_string(
if (
resolve_exports
if resolve_exports is not None
- else IDOM_DEBUG_MODE.current
+ else REACTPY_DEBUG_MODE.current
)
else None
),
@@ -385,6 +385,6 @@ def _make_export(
def _web_module_path(name: str) -> Path:
- directory = IDOM_WEB_MODULES_DIR.current
+ directory = REACTPY_WEB_MODULES_DIR.current
path = directory.joinpath(*name.split("/"))
return path.with_suffix(path.suffix)
diff --git a/src/idom/web/templates/react.js b/src/reactpy/web/templates/react.js
similarity index 100%
rename from src/idom/web/templates/react.js
rename to src/reactpy/web/templates/react.js
diff --git a/src/idom/web/utils.py b/src/reactpy/web/utils.py
similarity index 100%
rename from src/idom/web/utils.py
rename to src/reactpy/web/utils.py
diff --git a/src/idom/widgets.py b/src/reactpy/widgets.py
similarity index 97%
rename from src/idom/widgets.py
rename to src/reactpy/widgets.py
index 2cf84a3b6..584c3b562 100644
--- a/src/idom/widgets.py
+++ b/src/reactpy/widgets.py
@@ -5,7 +5,7 @@
from typing_extensions import Protocol
-import idom
+import reactpy
from . import html
from ._warnings import warn
@@ -64,7 +64,7 @@ def use_linked_inputs(
ignore_empty:
Do not trigger ``on_change`` if the 'value' is an empty string.
"""
- value, set_value = idom.hooks.use_state(initial_value)
+ value, set_value = reactpy.hooks.use_state(initial_value)
def sync_inputs(event: dict[str, Any]) -> None:
new_value = event["target"]["value"]
diff --git a/tests/conftest.py b/tests/conftest.py
index 2e328adb2..ceadbbb78 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -8,12 +8,12 @@
from _pytest.config.argparsing import Parser
from playwright.async_api import async_playwright
-from idom.config import IDOM_TESTING_DEFAULT_TIMEOUT
-from idom.testing import (
+from reactpy.config import REACTPY_TESTING_DEFAULT_TIMEOUT
+from reactpy.testing import (
BackendFixture,
DisplayFixture,
- capture_idom_logs,
- clear_idom_web_modules_dir,
+ capture_reactpy_logs,
+ clear_reactpy_web_modules_dir,
)
from tests.tooling.loop import open_event_loop
@@ -42,7 +42,7 @@ async def server():
@pytest.fixture(scope="session")
async def page(browser):
pg = await browser.new_page()
- pg.set_default_timeout(IDOM_TESTING_DEFAULT_TIMEOUT.current * 1000)
+ pg.set_default_timeout(REACTPY_TESTING_DEFAULT_TIMEOUT.current * 1000)
try:
yield pg
finally:
@@ -65,12 +65,12 @@ def event_loop():
@pytest.fixture(autouse=True)
def clear_web_modules_dir_after_test():
- clear_idom_web_modules_dir()
+ clear_reactpy_web_modules_dir()
@pytest.fixture(autouse=True)
def assert_no_logged_exceptions():
- with capture_idom_logs() as records:
+ with capture_reactpy_logs() as records:
yield
try:
for r in records:
diff --git a/tests/test__console/test_rewrite_camel_case_props.py b/tests/test__console/test_rewrite_camel_case_props.py
index 28532848e..d8746f8c7 100644
--- a/tests/test__console/test_rewrite_camel_case_props.py
+++ b/tests/test__console/test_rewrite_camel_case_props.py
@@ -5,7 +5,7 @@
import pytest
from click.testing import CliRunner
-from idom._console.rewrite_camel_case_props import (
+from reactpy._console.rewrite_camel_case_props import (
generate_rewrite,
rewrite_camel_case_props,
)
@@ -50,8 +50,8 @@ def test_rewrite_camel_case_props_declarations_no_files():
"html.div(dict(camel_case='test'))",
),
(
- "idom.html.button({'onClick': block_forever})",
- "idom.html.button({'on_click': block_forever})",
+ "reactpy.html.button({'onClick': block_forever})",
+ "reactpy.html.button({'on_click': block_forever})",
),
(
"html.div(dict(style={'testThing': test}))",
diff --git a/tests/test__console/test_rewrite_keys.py b/tests/test__console/test_rewrite_keys.py
index ac0edf4e0..6fad036e7 100644
--- a/tests/test__console/test_rewrite_keys.py
+++ b/tests/test__console/test_rewrite_keys.py
@@ -5,7 +5,7 @@
import pytest
from click.testing import CliRunner
-from idom._console.rewrite_keys import generate_rewrite, rewrite_keys
+from reactpy._console.rewrite_keys import generate_rewrite, rewrite_keys
if sys.version_info < (3, 9):
diff --git a/tests/test__option.py b/tests/test__option.py
index 52fe6d258..1fbd6459e 100644
--- a/tests/test__option.py
+++ b/tests/test__option.py
@@ -3,7 +3,7 @@
import pytest
-from idom._option import DeprecatedOption, Option
+from reactpy._option import DeprecatedOption, Option
def test_option_repr():
diff --git a/tests/test_backend/test__common.py b/tests/test_backend/test__common.py
index 3a3b648d5..248bf9451 100644
--- a/tests/test_backend/test__common.py
+++ b/tests/test_backend/test__common.py
@@ -1,7 +1,7 @@
import pytest
-from idom import html
-from idom.backend._common import (
+from reactpy import html
+from reactpy.backend._common import (
CommonOptions,
traversal_safe_path,
vdom_head_elements_to_html,
diff --git a/tests/test_backend/test_all.py b/tests/test_backend/test_all.py
index 8be33f212..fcf6b7286 100644
--- a/tests/test_backend/test_all.py
+++ b/tests/test_backend/test_all.py
@@ -2,13 +2,13 @@
import pytest
-import idom
-from idom import html
-from idom.backend import default as default_implementation
-from idom.backend._common import PATH_PREFIX
-from idom.backend.types import BackendImplementation, Connection, Location
-from idom.backend.utils import all_implementations
-from idom.testing import BackendFixture, DisplayFixture, poll
+import reactpy
+from reactpy import html
+from reactpy.backend import default as default_implementation
+from reactpy.backend._common import PATH_PREFIX
+from reactpy.backend.types import BackendImplementation, Connection, Location
+from reactpy.backend.utils import all_implementations
+from reactpy.testing import BackendFixture, DisplayFixture, poll
@pytest.fixture(
@@ -37,9 +37,9 @@ async def display(page, request):
async def test_display_simple_hello_world(display: DisplayFixture):
- @idom.component
+ @reactpy.component
def Hello():
- return idom.html.p({"id": "hello"}, ["Hello World"])
+ return reactpy.html.p({"id": "hello"}, ["Hello World"])
await display.show(Hello)
@@ -52,10 +52,10 @@ def Hello():
async def test_display_simple_click_counter(display: DisplayFixture):
- @idom.component
+ @reactpy.component
def Counter():
- count, set_count = idom.hooks.use_state(0)
- return idom.html.button(
+ count, set_count = reactpy.hooks.use_state(0)
+ return reactpy.html.button(
{
"id": "counter",
"on_click": lambda event: set_count(lambda old_count: old_count + 1),
@@ -73,18 +73,18 @@ def Counter():
async def test_module_from_template(display: DisplayFixture):
- victory = idom.web.module_from_template("react", "victory-bar@35.4.0")
- VictoryBar = idom.web.export(victory, "VictoryBar")
+ victory = reactpy.web.module_from_template("react", "victory-bar@35.4.0")
+ VictoryBar = reactpy.web.export(victory, "VictoryBar")
await display.show(VictoryBar)
await display.page.wait_for_selector(".VictoryContainer")
async def test_use_connection(display: DisplayFixture):
- conn = idom.Ref()
+ conn = reactpy.Ref()
- @idom.component
+ @reactpy.component
def ShowScope():
- conn.current = idom.use_connection()
+ conn.current = reactpy.use_connection()
return html.pre({"id": "scope"}, str(conn.current))
await display.show(ShowScope)
@@ -94,11 +94,11 @@ def ShowScope():
async def test_use_scope(display: DisplayFixture):
- scope = idom.Ref()
+ scope = reactpy.Ref()
- @idom.component
+ @reactpy.component
def ShowScope():
- scope.current = idom.use_scope()
+ scope.current = reactpy.use_scope()
return html.pre({"id": "scope"}, str(scope.current))
await display.show(ShowScope)
@@ -108,16 +108,16 @@ def ShowScope():
async def test_use_location(display: DisplayFixture):
- location = idom.Ref()
+ location = reactpy.Ref()
@poll
async def poll_location():
"""This needs to be async to allow the server to respond"""
return location.current
- @idom.component
+ @reactpy.component
def ShowRoute():
- location.current = idom.use_location()
+ location.current = reactpy.use_location()
return html.pre(str(location.current))
await display.show(ShowRoute)
@@ -142,9 +142,9 @@ async def test_use_request(display: DisplayFixture, hook_name):
if hook is None:
pytest.skip(f"{display.backend.implementation} has no '{hook_name}' hook")
- hook_val = idom.Ref()
+ hook_val = reactpy.Ref()
- @idom.component
+ @reactpy.component
def ShowRoute():
hook_val.current = hook()
return html.pre({"id": "hook"}, str(hook_val.current))
@@ -161,7 +161,7 @@ def ShowRoute():
async def test_customized_head(imp: BackendImplementation, page):
custom_title = f"Custom Title for {imp.__name__}"
- @idom.component
+ @reactpy.component
def sample():
return html.h1(f"^ Page title is customized to: '{custom_title}'")
diff --git a/tests/test_backend/test_utils.py b/tests/test_backend/test_utils.py
index c3cb13613..34f7e4024 100644
--- a/tests/test_backend/test_utils.py
+++ b/tests/test_backend/test_utils.py
@@ -5,10 +5,10 @@
import pytest
from playwright.async_api import Page
-from idom.backend import flask as flask_implementation
-from idom.backend.utils import find_available_port
-from idom.backend.utils import run as sync_run
-from idom.sample import SampleApp as SampleApp
+from reactpy.backend import flask as flask_implementation
+from reactpy.backend.utils import find_available_port
+from reactpy.backend.utils import run as sync_run
+from reactpy.sample import SampleApp as SampleApp
@pytest.fixture
diff --git a/tests/test_client.py b/tests/test_client.py
index da32aaf95..ea6a3a672 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -4,9 +4,9 @@
from playwright.async_api import Browser
-import idom
-from idom.backend.utils import find_available_port
-from idom.testing import BackendFixture, DisplayFixture, poll
+import reactpy
+from reactpy.backend.utils import find_available_port
+from reactpy.testing import BackendFixture, DisplayFixture, poll
from tests.tooling.common import DEFAULT_TYPE_DELAY
from tests.tooling.hooks import use_counter
@@ -21,12 +21,14 @@ async def test_automatic_reconnect(browser: Browser):
# we need to wait longer here because the automatic reconnect is not instant
page.set_default_timeout(10000)
- @idom.component
+ @reactpy.component
def SomeComponent():
count, incr_count = use_counter(0)
- return idom.html._(
- idom.html.p({"data_count": count, "id": "count"}, "count", count),
- idom.html.button(dict(on_click=lambda e: incr_count(), id="incr"), "incr"),
+ return reactpy.html._(
+ reactpy.html.p({"data_count": count, "id": "count"}, "count", count),
+ reactpy.html.button(
+ dict(on_click=lambda e: incr_count(), id="incr"), "incr"
+ ),
)
async with AsyncExitStack() as exit_stack:
@@ -77,14 +79,14 @@ async def test_style_can_be_changed(display: DisplayFixture):
A bug was introduced where the client-side model was mutated and React was relying
on the model to have been copied in order to determine if something had changed.
- See for more info: https://github.com/idom-team/idom/issues/480
+ See for more info: https://github.com/reactive-python/reactpy/issues/480
"""
- @idom.component
+ @reactpy.component
def ButtonWithChangingColor():
- color_toggle, set_color_toggle = idom.hooks.use_state(True)
+ color_toggle, set_color_toggle = reactpy.hooks.use_state(True)
color = "red" if color_toggle else "blue"
- return idom.html.button(
+ return reactpy.html.button(
{
"id": "my-button",
"on_click": lambda event: set_color_toggle(not color_toggle),
@@ -113,20 +115,20 @@ async def _get_style(element):
async def test_slow_server_response_on_input_change(display: DisplayFixture):
"""A delay server-side could cause input values to be overwritten.
- For more info see: https://github.com/idom-team/idom/issues/684
+ For more info see: https://github.com/reactive-python/reactpy/issues/684
"""
delay = 0.2
- @idom.component
+ @reactpy.component
def SomeComponent():
- value, set_value = idom.hooks.use_state("")
+ value, set_value = reactpy.hooks.use_state("")
async def handle_change(event):
await asyncio.sleep(delay)
set_value(event["target"]["value"])
- return idom.html.input({"on_change": handle_change, "id": "test-input"})
+ return reactpy.html.input({"on_change": handle_change, "id": "test-input"})
await display.show(SomeComponent)
@@ -137,9 +139,9 @@ async def handle_change(event):
async def test_snake_case_attributes(display: DisplayFixture):
- @idom.component
+ @reactpy.component
def SomeComponent():
- return idom.html.h1(
+ return reactpy.html.h1(
{
"id": "my-title",
"style": {"background_color": "blue"},
diff --git a/tests/test_config.py b/tests/test_config.py
index 20f21fe4d..ecbbb998c 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -1,7 +1,7 @@
import pytest
-from idom import config
-from idom._option import Option
+from reactpy import config
+from reactpy._option import Option
@pytest.fixture(autouse=True)
@@ -23,7 +23,7 @@ def reset_options():
opt.current = val
-def test_idom_debug_mode_toggle():
+def test_reactpy_debug_mode_toggle():
# just check that nothing breaks
- config.IDOM_DEBUG_MODE.current = True
- config.IDOM_DEBUG_MODE.current = False
+ config.REACTPY_DEBUG_MODE.current = True
+ config.REACTPY_DEBUG_MODE.current = False
diff --git a/tests/test_core/test_component.py b/tests/test_core/test_component.py
index 0443ba013..6f40c960c 100644
--- a/tests/test_core/test_component.py
+++ b/tests/test_core/test_component.py
@@ -1,9 +1,9 @@
-import idom
-from idom.testing import DisplayFixture
+import reactpy
+from reactpy.testing import DisplayFixture
def test_component_repr():
- @idom.component
+ @reactpy.component
def MyComponent(a, *b, **c):
pass
@@ -17,25 +17,25 @@ def MyComponent(a, *b, **c):
async def test_simple_component():
- @idom.component
+ @reactpy.component
def SimpleDiv():
- return idom.html.div()
+ return reactpy.html.div()
assert SimpleDiv().render() == {"tagName": "div"}
async def test_simple_parameterized_component():
- @idom.component
+ @reactpy.component
def SimpleParamComponent(tag):
- return idom.vdom(tag)
+ return reactpy.vdom(tag)
assert SimpleParamComponent("div").render() == {"tagName": "div"}
async def test_component_with_var_args():
- @idom.component
+ @reactpy.component
def ComponentWithVarArgsAndKwargs(*args, **kwargs):
- return idom.html.div(kwargs, args)
+ return reactpy.html.div(kwargs, args)
assert ComponentWithVarArgsAndKwargs("hello", "world", my_attr=1).render() == {
"tagName": "div",
@@ -45,9 +45,9 @@ def ComponentWithVarArgsAndKwargs(*args, **kwargs):
async def test_display_simple_hello_world(display: DisplayFixture):
- @idom.component
+ @reactpy.component
def Hello():
- return idom.html.p({"id": "hello"}, ["Hello World"])
+ return reactpy.html.p({"id": "hello"}, ["Hello World"])
await display.show(Hello)
@@ -55,11 +55,11 @@ def Hello():
async def test_pre_tags_are_rendered_correctly(display: DisplayFixture):
- @idom.component
+ @reactpy.component
def PreFormated():
- return idom.html.pre(
+ return reactpy.html.pre(
{"id": "pre-form-test"},
- idom.html.span("this", idom.html.span("is"), "some"),
+ reactpy.html.span("this", reactpy.html.span("is"), "some"),
"pre-formated",
" text",
)
diff --git a/tests/test_core/test_events.py b/tests/test_core/test_events.py
index 702518547..f6ab2bdc1 100644
--- a/tests/test_core/test_events.py
+++ b/tests/test_core/test_events.py
@@ -1,13 +1,13 @@
import pytest
-import idom
-from idom.core.events import (
+import reactpy
+from reactpy.core.events import (
EventHandler,
merge_event_handler_funcs,
merge_event_handlers,
to_event_handler_function,
)
-from idom.testing import DisplayFixture, poll
+from reactpy.testing import DisplayFixture, poll
from tests.tooling.common import DEFAULT_TYPE_DELAY
@@ -61,7 +61,7 @@ async def func(data):
async def test_to_event_handler_function():
- call_args = idom.Ref(None)
+ call_args = reactpy.Ref(None)
async def coro(*args):
call_args.current = args
@@ -145,13 +145,13 @@ async def some_other_func(data):
async def test_can_prevent_event_default_operation(display: DisplayFixture):
- @idom.component
+ @reactpy.component
def Input():
- @idom.event(prevent_default=True)
+ @reactpy.event(prevent_default=True)
async def on_key_down(value):
pass
- return idom.html.input({"on_key_down": on_key_down, "id": "input"})
+ return reactpy.html.input({"on_key_down": on_key_down, "id": "input"})
await display.show(Input)
@@ -162,19 +162,19 @@ async def on_key_down(value):
async def test_simple_click_event(display: DisplayFixture):
- @idom.component
+ @reactpy.component
def Button():
- clicked, set_clicked = idom.hooks.use_state(False)
+ clicked, set_clicked = reactpy.hooks.use_state(False)
async def on_click(event):
set_clicked(True)
if not clicked:
- return idom.html.button(
+ return reactpy.html.button(
{"on_click": on_click, "id": "click"}, ["Click Me!"]
)
else:
- return idom.html.p({"id": "complete"}, ["Complete"])
+ return reactpy.html.p({"id": "complete"}, ["Complete"])
await display.show(Button)
@@ -184,24 +184,24 @@ async def on_click(event):
async def test_can_stop_event_propogation(display: DisplayFixture):
- clicked = idom.Ref(False)
+ clicked = reactpy.Ref(False)
- @idom.component
+ @reactpy.component
def DivInDiv():
- @idom.event(stop_propagation=True)
+ @reactpy.event(stop_propagation=True)
def inner_click_no_op(event):
clicked.current = True
def outer_click_is_not_triggered(event):
assert False
- outer = idom.html.div(
+ outer = reactpy.html.div(
{
"style": {"height": "35px", "width": "35px", "background_color": "red"},
"on_click": outer_click_is_not_triggered,
"id": "outer",
},
- idom.html.div(
+ reactpy.html.div(
{
"style": {
"height": "30px",
diff --git a/tests/test_core/test_hooks.py b/tests/test_core/test_hooks.py
index 6fe659aaf..570319677 100644
--- a/tests/test_core/test_hooks.py
+++ b/tests/test_core/test_hooks.py
@@ -2,45 +2,45 @@
import pytest
-import idom
-from idom import html
-from idom.config import IDOM_DEBUG_MODE
-from idom.core.hooks import (
+import reactpy
+from reactpy import html
+from reactpy.config import REACTPY_DEBUG_MODE
+from reactpy.core.hooks import (
COMPONENT_DID_RENDER_EFFECT,
LifeCycleHook,
current_hook,
strictly_equal,
)
-from idom.core.layout import Layout
-from idom.testing import DisplayFixture, HookCatcher, assert_idom_did_log, poll
-from idom.testing.logs import assert_idom_did_not_log
-from idom.utils import Ref
+from reactpy.core.layout import Layout
+from reactpy.testing import DisplayFixture, HookCatcher, assert_reactpy_did_log, poll
+from reactpy.testing.logs import assert_reactpy_did_not_log
+from reactpy.utils import Ref
from tests.tooling.common import DEFAULT_TYPE_DELAY, update_message
async def test_must_be_rendering_in_layout_to_use_hooks():
- @idom.component
+ @reactpy.component
def SimpleComponentWithHook():
- idom.hooks.use_state(None)
- return idom.html.div()
+ reactpy.hooks.use_state(None)
+ return reactpy.html.div()
with pytest.raises(RuntimeError, match="No life cycle hook is active"):
await SimpleComponentWithHook().render()
- async with idom.Layout(SimpleComponentWithHook()) as layout:
+ async with reactpy.Layout(SimpleComponentWithHook()) as layout:
await layout.render()
async def test_simple_stateful_component():
- @idom.component
+ @reactpy.component
def SimpleStatefulComponent():
- index, set_index = idom.hooks.use_state(0)
+ index, set_index = reactpy.hooks.use_state(0)
set_index(index + 1)
- return idom.html.div(index)
+ return reactpy.html.div(index)
sse = SimpleStatefulComponent()
- async with idom.Layout(sse) as layout:
+ async with reactpy.Layout(sse) as layout:
update_1 = await layout.render()
assert update_1 == update_message(
path="",
@@ -72,16 +72,16 @@ def SimpleStatefulComponent():
async def test_set_state_callback_identity_is_preserved():
saved_set_state_hooks = []
- @idom.component
+ @reactpy.component
def SimpleStatefulComponent():
- index, set_index = idom.hooks.use_state(0)
+ index, set_index = reactpy.hooks.use_state(0)
saved_set_state_hooks.append(set_index)
set_index(index + 1)
- return idom.html.div(index)
+ return reactpy.html.div(index)
sse = SimpleStatefulComponent()
- async with idom.Layout(sse) as layout:
+ async with reactpy.Layout(sse) as layout:
await layout.render()
await layout.render()
await layout.render()
@@ -93,28 +93,28 @@ def SimpleStatefulComponent():
async def test_use_state_with_constructor():
- constructor_call_count = idom.Ref(0)
+ constructor_call_count = reactpy.Ref(0)
- set_outer_state = idom.Ref()
- set_inner_key = idom.Ref()
- set_inner_state = idom.Ref()
+ set_outer_state = reactpy.Ref()
+ set_inner_key = reactpy.Ref()
+ set_inner_state = reactpy.Ref()
def make_default():
constructor_call_count.current += 1
return 0
- @idom.component
+ @reactpy.component
def Outer():
- state, set_outer_state.current = idom.use_state(0)
- inner_key, set_inner_key.current = idom.use_state("first")
- return idom.html.div(state, Inner(key=inner_key))
+ state, set_outer_state.current = reactpy.use_state(0)
+ inner_key, set_inner_key.current = reactpy.use_state("first")
+ return reactpy.html.div(state, Inner(key=inner_key))
- @idom.component
+ @reactpy.component
def Inner():
- state, set_inner_state.current = idom.use_state(make_default)
- return idom.html.div(state)
+ state, set_inner_state.current = reactpy.use_state(make_default)
+ return reactpy.html.div(state)
- async with idom.Layout(Outer()) as layout:
+ async with reactpy.Layout(Outer()) as layout:
await layout.render()
assert constructor_call_count.current == 1
@@ -136,18 +136,18 @@ def Inner():
async def test_set_state_with_reducer_instead_of_value():
- count = idom.Ref()
- set_count = idom.Ref()
+ count = reactpy.Ref()
+ set_count = reactpy.Ref()
def increment(count):
return count + 1
- @idom.component
+ @reactpy.component
def Counter():
- count.current, set_count.current = idom.hooks.use_state(0)
- return idom.html.div(count.current)
+ count.current, set_count.current = reactpy.hooks.use_state(0)
+ return reactpy.html.div(count.current)
- async with idom.Layout(Counter()) as layout:
+ async with reactpy.Layout(Counter()) as layout:
await layout.render()
for i in range(4):
@@ -157,15 +157,15 @@ def Counter():
async def test_set_state_checks_identity_not_equality(display: DisplayFixture):
- r_1 = idom.Ref("value")
- r_2 = idom.Ref("value")
+ r_1 = reactpy.Ref("value")
+ r_2 = reactpy.Ref("value")
# refs are equal but not identical
assert r_1 == r_2
assert r_1 is not r_2
- render_count = idom.Ref(0)
- event_count = idom.Ref(0)
+ render_count = reactpy.Ref(0)
+ event_count = reactpy.Ref(0)
def event_count_tracker(function):
def tracker(*args, **kwargs):
@@ -174,20 +174,20 @@ def tracker(*args, **kwargs):
return tracker
- @idom.component
+ @reactpy.component
def TestComponent():
- state, set_state = idom.hooks.use_state(r_1)
+ state, set_state = reactpy.hooks.use_state(r_1)
render_count.current += 1
- return idom.html.div(
- idom.html.button(
+ return reactpy.html.div(
+ reactpy.html.button(
{
"id": "r_1",
"on_click": event_count_tracker(lambda event: set_state(r_1)),
},
"r_1",
),
- idom.html.button(
+ reactpy.html.button(
{
"id": "r_2",
"on_click": event_count_tracker(lambda event: set_state(r_2)),
@@ -225,11 +225,11 @@ def TestComponent():
async def test_simple_input_with_use_state(display: DisplayFixture):
- message_ref = idom.Ref(None)
+ message_ref = reactpy.Ref(None)
- @idom.component
+ @reactpy.component
def Input(message=None):
- message, set_message = idom.hooks.use_state(message)
+ message, set_message = reactpy.hooks.use_state(message)
message_ref.current = message
async def on_change(event):
@@ -237,9 +237,9 @@ async def on_change(event):
set_message(event["target"]["value"])
if message is None:
- return idom.html.input({"id": "input", "on_change": on_change})
+ return reactpy.html.input({"id": "input", "on_change": on_change})
else:
- return idom.html.p({"id": "complete"}, ["Complete"])
+ return reactpy.html.p({"id": "complete"}, ["Complete"])
await display.show(Input)
@@ -251,23 +251,23 @@ async def on_change(event):
async def test_double_set_state(display: DisplayFixture):
- @idom.component
+ @reactpy.component
def SomeComponent():
- state_1, set_state_1 = idom.hooks.use_state(0)
- state_2, set_state_2 = idom.hooks.use_state(0)
+ state_1, set_state_1 = reactpy.hooks.use_state(0)
+ state_2, set_state_2 = reactpy.hooks.use_state(0)
def double_set_state(event):
set_state_1(state_1 + 1)
set_state_2(state_2 + 1)
- return idom.html.div(
- idom.html.div(
+ return reactpy.html.div(
+ reactpy.html.div(
{"id": "first", "data-value": state_1}, f"value is: {state_1}"
),
- idom.html.div(
+ reactpy.html.div(
{"id": "second", "data-value": state_2}, f"value is: {state_2}"
),
- idom.html.button(
+ reactpy.html.button(
{"id": "button", "on_click": double_set_state}, "click me"
),
)
@@ -293,30 +293,30 @@ def double_set_state(event):
async def test_use_effect_callback_occurs_after_full_render_is_complete():
- effect_triggered = idom.Ref(False)
- effect_triggers_after_final_render = idom.Ref(None)
+ effect_triggered = reactpy.Ref(False)
+ effect_triggers_after_final_render = reactpy.Ref(None)
- @idom.component
+ @reactpy.component
def OuterComponent():
- return idom.html.div(
+ return reactpy.html.div(
ComponentWithEffect(),
CheckNoEffectYet(),
)
- @idom.component
+ @reactpy.component
def ComponentWithEffect():
- @idom.hooks.use_effect
+ @reactpy.hooks.use_effect
def effect():
effect_triggered.current = True
- return idom.html.div()
+ return reactpy.html.div()
- @idom.component
+ @reactpy.component
def CheckNoEffectYet():
effect_triggers_after_final_render.current = not effect_triggered.current
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(OuterComponent()) as layout:
+ async with reactpy.Layout(OuterComponent()) as layout:
await layout.render()
assert effect_triggered.current
@@ -326,13 +326,13 @@ def CheckNoEffectYet():
async def test_use_effect_cleanup_occurs_before_next_effect():
component_hook = HookCatcher()
- cleanup_triggered = idom.Ref(False)
- cleanup_triggered_before_next_effect = idom.Ref(False)
+ cleanup_triggered = reactpy.Ref(False)
+ cleanup_triggered_before_next_effect = reactpy.Ref(False)
- @idom.component
+ @reactpy.component
@component_hook.capture
def ComponentWithEffect():
- @idom.hooks.use_effect(dependencies=None)
+ @reactpy.hooks.use_effect(dependencies=None)
def effect():
if cleanup_triggered.current:
cleanup_triggered_before_next_effect.current = True
@@ -342,9 +342,9 @@ def cleanup():
return cleanup
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(ComponentWithEffect()) as layout:
+ async with reactpy.Layout(ComponentWithEffect()) as layout:
await layout.render()
assert not cleanup_triggered.current
@@ -357,33 +357,33 @@ def cleanup():
async def test_use_effect_cleanup_occurs_on_will_unmount():
- set_key = idom.Ref()
- component_did_render = idom.Ref(False)
- cleanup_triggered = idom.Ref(False)
- cleanup_triggered_before_next_render = idom.Ref(False)
+ set_key = reactpy.Ref()
+ component_did_render = reactpy.Ref(False)
+ cleanup_triggered = reactpy.Ref(False)
+ cleanup_triggered_before_next_render = reactpy.Ref(False)
- @idom.component
+ @reactpy.component
def OuterComponent():
- key, set_key.current = idom.use_state("first")
+ key, set_key.current = reactpy.use_state("first")
return ComponentWithEffect(key=key)
- @idom.component
+ @reactpy.component
def ComponentWithEffect():
if component_did_render.current and cleanup_triggered.current:
cleanup_triggered_before_next_render.current = True
component_did_render.current = True
- @idom.hooks.use_effect
+ @reactpy.hooks.use_effect
def effect():
def cleanup():
cleanup_triggered.current = True
return cleanup
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(OuterComponent()) as layout:
+ async with reactpy.Layout(OuterComponent()) as layout:
await layout.render()
assert not cleanup_triggered.current
@@ -397,24 +397,24 @@ def cleanup():
async def test_memoized_effect_on_recreated_if_dependencies_change():
component_hook = HookCatcher()
- set_state_callback = idom.Ref(None)
- effect_run_count = idom.Ref(0)
+ set_state_callback = reactpy.Ref(None)
+ effect_run_count = reactpy.Ref(0)
first_value = 1
second_value = 2
- @idom.component
+ @reactpy.component
@component_hook.capture
def ComponentWithMemoizedEffect():
- state, set_state_callback.current = idom.hooks.use_state(first_value)
+ state, set_state_callback.current = reactpy.hooks.use_state(first_value)
- @idom.hooks.use_effect(dependencies=[state])
+ @reactpy.hooks.use_effect(dependencies=[state])
def effect():
effect_run_count.current += 1
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(ComponentWithMemoizedEffect()) as layout:
+ async with reactpy.Layout(ComponentWithMemoizedEffect()) as layout:
await layout.render()
assert effect_run_count.current == 1
@@ -437,27 +437,27 @@ def effect():
async def test_memoized_effect_cleanup_only_triggered_before_new_effect():
component_hook = HookCatcher()
- set_state_callback = idom.Ref(None)
- cleanup_trigger_count = idom.Ref(0)
+ set_state_callback = reactpy.Ref(None)
+ cleanup_trigger_count = reactpy.Ref(0)
first_value = 1
second_value = 2
- @idom.component
+ @reactpy.component
@component_hook.capture
def ComponentWithEffect():
- state, set_state_callback.current = idom.hooks.use_state(first_value)
+ state, set_state_callback.current = reactpy.hooks.use_state(first_value)
- @idom.hooks.use_effect(dependencies=[state])
+ @reactpy.hooks.use_effect(dependencies=[state])
def effect():
def cleanup():
cleanup_trigger_count.current += 1
return cleanup
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(ComponentWithEffect()) as layout:
+ async with reactpy.Layout(ComponentWithEffect()) as layout:
await layout.render()
assert cleanup_trigger_count.current == 0
@@ -476,15 +476,15 @@ def cleanup():
async def test_use_async_effect():
effect_ran = asyncio.Event()
- @idom.component
+ @reactpy.component
def ComponentWithAsyncEffect():
- @idom.hooks.use_effect
+ @reactpy.hooks.use_effect
async def effect():
effect_ran.set()
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(ComponentWithAsyncEffect()) as layout:
+ async with reactpy.Layout(ComponentWithAsyncEffect()) as layout:
await layout.render()
await asyncio.wait_for(effect_ran.wait(), 1)
@@ -494,17 +494,17 @@ async def test_use_async_effect_cleanup():
effect_ran = asyncio.Event()
cleanup_ran = asyncio.Event()
- @idom.component
+ @reactpy.component
@component_hook.capture
def ComponentWithAsyncEffect():
- @idom.hooks.use_effect(dependencies=None) # force this to run every time
+ @reactpy.hooks.use_effect(dependencies=None) # force this to run every time
async def effect():
effect_ran.set()
return cleanup_ran.set
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(ComponentWithAsyncEffect()) as layout:
+ async with reactpy.Layout(ComponentWithAsyncEffect()) as layout:
await layout.render()
component_hook.latest.schedule_render()
@@ -521,10 +521,10 @@ async def test_use_async_effect_cancel(caplog):
event_that_never_occurs = asyncio.Event()
- @idom.component
+ @reactpy.component
@component_hook.capture
def ComponentWithLongWaitingEffect():
- @idom.hooks.use_effect(dependencies=None) # force this to run every time
+ @reactpy.hooks.use_effect(dependencies=None) # force this to run every time
async def effect():
effect_ran.set()
try:
@@ -533,9 +533,9 @@ async def effect():
effect_was_cancelled.set()
raise
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(ComponentWithLongWaitingEffect()) as layout:
+ async with reactpy.Layout(ComponentWithLongWaitingEffect()) as layout:
await layout.render()
await effect_ran.wait()
@@ -553,16 +553,16 @@ async def effect():
async def test_error_in_effect_is_gracefully_handled(caplog):
- @idom.component
+ @reactpy.component
def ComponentWithEffect():
- @idom.hooks.use_effect
+ @reactpy.hooks.use_effect
def bad_effect():
raise ValueError("Something went wong :(")
- return idom.html.div()
+ return reactpy.html.div()
- with assert_idom_did_log(match_message=r"Layout post-render effect .* failed"):
- async with idom.Layout(ComponentWithEffect()) as layout:
+ with assert_reactpy_did_log(match_message=r"Layout post-render effect .* failed"):
+ async with reactpy.Layout(ComponentWithEffect()) as layout:
await layout.render() # no error
@@ -570,57 +570,57 @@ async def test_error_in_effect_cleanup_is_gracefully_handled(caplog):
caplog.clear()
component_hook = HookCatcher()
- @idom.component
+ @reactpy.component
@component_hook.capture
def ComponentWithEffect():
- @idom.hooks.use_effect(dependencies=None) # force this to run every time
+ @reactpy.hooks.use_effect(dependencies=None) # force this to run every time
def ok_effect():
def bad_cleanup():
raise ValueError("Something went wong :(")
return bad_cleanup
- return idom.html.div()
+ return reactpy.html.div()
- with assert_idom_did_log(match_error=r"Layout post-render effect .* failed"):
- async with idom.Layout(ComponentWithEffect()) as layout:
+ with assert_reactpy_did_log(match_error=r"Layout post-render effect .* failed"):
+ async with reactpy.Layout(ComponentWithEffect()) as layout:
await layout.render()
component_hook.latest.schedule_render()
await layout.render() # no error
async def test_error_in_effect_pre_unmount_cleanup_is_gracefully_handled():
- set_key = idom.Ref()
+ set_key = reactpy.Ref()
- @idom.component
+ @reactpy.component
def OuterComponent():
- key, set_key.current = idom.use_state("first")
+ key, set_key.current = reactpy.use_state("first")
return ComponentWithEffect(key=key)
- @idom.component
+ @reactpy.component
def ComponentWithEffect():
- @idom.hooks.use_effect
+ @reactpy.hooks.use_effect
def ok_effect():
def bad_cleanup():
raise ValueError("Something went wong :(")
return bad_cleanup
- return idom.html.div()
+ return reactpy.html.div()
- with assert_idom_did_log(
+ with assert_reactpy_did_log(
match_message=r"Pre-unmount effect .*? failed",
error_type=ValueError,
):
- async with idom.Layout(OuterComponent()) as layout:
+ async with reactpy.Layout(OuterComponent()) as layout:
await layout.render()
set_key.current("second")
await layout.render() # no error
async def test_use_reducer():
- saved_count = idom.Ref(None)
- saved_dispatch = idom.Ref(None)
+ saved_count = reactpy.Ref(None)
+ saved_dispatch = reactpy.Ref(None)
def reducer(count, action):
if action == "increment":
@@ -630,14 +630,14 @@ def reducer(count, action):
else:
raise ValueError(f"Unknown action '{action}'")
- @idom.component
+ @reactpy.component
def Counter(initial_count):
- saved_count.current, saved_dispatch.current = idom.hooks.use_reducer(
+ saved_count.current, saved_dispatch.current = reactpy.hooks.use_reducer(
reducer, initial_count
)
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(Counter(0)) as layout:
+ async with reactpy.Layout(Counter(0)) as layout:
await layout.render()
assert saved_count.current == 0
@@ -662,12 +662,12 @@ def reducer(count, action):
else:
raise ValueError(f"Unknown action '{action}'")
- @idom.component
+ @reactpy.component
def ComponentWithUseReduce():
- saved_dispatchers.append(idom.hooks.use_reducer(reducer, 0)[1])
- return idom.html.div()
+ saved_dispatchers.append(reactpy.hooks.use_reducer(reducer, 0)[1])
+ return reactpy.html.div()
- async with idom.Layout(ComponentWithUseReduce()) as layout:
+ async with reactpy.Layout(ComponentWithUseReduce()) as layout:
for _ in range(3):
await layout.render()
saved_dispatchers[-1]("increment")
@@ -681,13 +681,13 @@ async def test_use_callback_identity():
component_hook = HookCatcher()
used_callbacks = []
- @idom.component
+ @reactpy.component
@component_hook.capture
def ComponentWithRef():
- used_callbacks.append(idom.hooks.use_callback(lambda: None))
- return idom.html.div()
+ used_callbacks.append(reactpy.hooks.use_callback(lambda: None))
+ return reactpy.html.div()
- async with idom.Layout(ComponentWithRef()) as layout:
+ async with reactpy.Layout(ComponentWithRef()) as layout:
await layout.render()
component_hook.latest.schedule_render()
await layout.render()
@@ -698,22 +698,24 @@ def ComponentWithRef():
async def test_use_callback_memoization():
component_hook = HookCatcher()
- set_state_hook = idom.Ref(None)
+ set_state_hook = reactpy.Ref(None)
used_callbacks = []
- @idom.component
+ @reactpy.component
@component_hook.capture
def ComponentWithRef():
- state, set_state_hook.current = idom.hooks.use_state(0)
+ state, set_state_hook.current = reactpy.hooks.use_state(0)
- @idom.hooks.use_callback(dependencies=[state]) # use the deco form for coverage
+ @reactpy.hooks.use_callback(
+ dependencies=[state]
+ ) # use the deco form for coverage
def cb():
return None
used_callbacks.append(cb)
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(ComponentWithRef()) as layout:
+ async with reactpy.Layout(ComponentWithRef()) as layout:
await layout.render()
set_state_hook.current(1)
await layout.render()
@@ -727,21 +729,23 @@ def cb():
async def test_use_memo():
component_hook = HookCatcher()
- set_state_hook = idom.Ref(None)
+ set_state_hook = reactpy.Ref(None)
used_values = []
- @idom.component
+ @reactpy.component
@component_hook.capture
def ComponentWithMemo():
- state, set_state_hook.current = idom.hooks.use_state(0)
- value = idom.hooks.use_memo(
- lambda: idom.Ref(state), # use a Ref here just to ensure it's a unique obj
+ state, set_state_hook.current = reactpy.hooks.use_state(0)
+ value = reactpy.hooks.use_memo(
+ lambda: reactpy.Ref(
+ state
+ ), # use a Ref here just to ensure it's a unique obj
[state],
)
used_values.append(value)
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(ComponentWithMemo()) as layout:
+ async with reactpy.Layout(ComponentWithMemo()) as layout:
await layout.render()
set_state_hook.current(1)
await layout.render()
@@ -759,14 +763,14 @@ async def test_use_memo_always_runs_if_dependencies_are_none():
iter_values = iter([1, 2, 3])
- @idom.component
+ @reactpy.component
@component_hook.capture
def ComponentWithMemo():
- value = idom.hooks.use_memo(lambda: next(iter_values), dependencies=None)
+ value = reactpy.hooks.use_memo(lambda: next(iter_values), dependencies=None)
used_values.append(value)
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(ComponentWithMemo()) as layout:
+ async with reactpy.Layout(ComponentWithMemo()) as layout:
await layout.render()
component_hook.latest.schedule_render()
await layout.render()
@@ -781,19 +785,19 @@ async def test_use_memo_with_stored_deps_is_empty_tuple_after_deps_are_none():
used_values = []
iter_values = iter([1, 2, 3])
- deps_used_in_memo = idom.Ref(())
+ deps_used_in_memo = reactpy.Ref(())
- @idom.component
+ @reactpy.component
@component_hook.capture
def ComponentWithMemo():
- value = idom.hooks.use_memo(
+ value = reactpy.hooks.use_memo(
lambda: next(iter_values),
deps_used_in_memo.current, # noqa: ROH202
)
used_values.append(value)
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(ComponentWithMemo()) as layout:
+ async with reactpy.Layout(ComponentWithMemo()) as layout:
await layout.render()
component_hook.latest.schedule_render()
deps_used_in_memo.current = None
@@ -811,14 +815,14 @@ async def test_use_memo_never_runs_if_deps_is_empty_list():
iter_values = iter([1, 2, 3])
- @idom.component
+ @reactpy.component
@component_hook.capture
def ComponentWithMemo():
- value = idom.hooks.use_memo(lambda: next(iter_values), ())
+ value = reactpy.hooks.use_memo(lambda: next(iter_values), ())
used_values.append(value)
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(ComponentWithMemo()) as layout:
+ async with reactpy.Layout(ComponentWithMemo()) as layout:
await layout.render()
component_hook.latest.schedule_render()
await layout.render()
@@ -832,13 +836,13 @@ async def test_use_ref():
component_hook = HookCatcher()
used_refs = []
- @idom.component
+ @reactpy.component
@component_hook.capture
def ComponentWithRef():
- used_refs.append(idom.hooks.use_ref(1))
- return idom.html.div()
+ used_refs.append(reactpy.hooks.use_ref(1))
+ return reactpy.html.div()
- async with idom.Layout(ComponentWithRef()) as layout:
+ async with reactpy.Layout(ComponentWithRef()) as layout:
await layout.render()
component_hook.latest.schedule_render()
await layout.render()
@@ -851,29 +855,29 @@ def test_bad_schedule_render_callback():
def bad_callback():
raise ValueError("something went wrong")
- with assert_idom_did_log(
+ with assert_reactpy_did_log(
match_message=f"Failed to schedule render via {bad_callback}"
):
LifeCycleHook(bad_callback).schedule_render()
async def test_use_effect_automatically_infers_closure_values():
- set_count = idom.Ref()
+ set_count = reactpy.Ref()
did_effect = asyncio.Event()
- @idom.component
+ @reactpy.component
def CounterWithEffect():
- count, set_count.current = idom.hooks.use_state(0)
+ count, set_count.current = reactpy.hooks.use_state(0)
- @idom.hooks.use_effect
+ @reactpy.hooks.use_effect
def some_effect_that_uses_count():
"""should automatically trigger on count change"""
count # use count in this closure
did_effect.set()
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(CounterWithEffect()) as layout:
+ async with reactpy.Layout(CounterWithEffect()) as layout:
await layout.render()
await did_effect.wait()
did_effect.clear()
@@ -886,22 +890,22 @@ def some_effect_that_uses_count():
async def test_use_memo_automatically_infers_closure_values():
- set_count = idom.Ref()
+ set_count = reactpy.Ref()
did_memo = asyncio.Event()
- @idom.component
+ @reactpy.component
def CounterWithEffect():
- count, set_count.current = idom.hooks.use_state(0)
+ count, set_count.current = reactpy.hooks.use_state(0)
- @idom.hooks.use_memo
+ @reactpy.hooks.use_memo
def some_memo_func_that_uses_count():
"""should automatically trigger on count change"""
count # use count in this closure
did_memo.set()
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(CounterWithEffect()) as layout:
+ async with reactpy.Layout(CounterWithEffect()) as layout:
await layout.render()
await did_memo.wait()
did_memo.clear()
@@ -914,60 +918,60 @@ def some_memo_func_that_uses_count():
async def test_use_context_default_value():
- Context = idom.create_context("something")
- value = idom.Ref()
+ Context = reactpy.create_context("something")
+ value = reactpy.Ref()
- @idom.component
+ @reactpy.component
def ComponentProvidesContext():
return Context(ComponentUsesContext())
- @idom.component
+ @reactpy.component
def ComponentUsesContext():
- value.current = idom.use_context(Context)
+ value.current = reactpy.use_context(Context)
return html.div()
- async with idom.Layout(ComponentProvidesContext()) as layout:
+ async with reactpy.Layout(ComponentProvidesContext()) as layout:
await layout.render()
assert value.current == "something"
- @idom.component
+ @reactpy.component
def ComponentUsesContext():
- value.current = idom.use_context(Context)
+ value.current = reactpy.use_context(Context)
return html.div()
- async with idom.Layout(ComponentUsesContext()) as layout:
+ async with reactpy.Layout(ComponentUsesContext()) as layout:
await layout.render()
assert value.current == "something"
def test_context_repr():
- sample_context = idom.create_context(None)
+ sample_context = reactpy.create_context(None)
assert repr(sample_context()) == f"ContextProvider({sample_context})"
async def test_use_context_updates_components_even_if_memoized():
- Context = idom.create_context(None)
+ Context = reactpy.create_context(None)
- value = idom.Ref(None)
- render_count = idom.Ref(0)
- set_state = idom.Ref()
+ value = reactpy.Ref(None)
+ render_count = reactpy.Ref(0)
+ set_state = reactpy.Ref()
- @idom.component
+ @reactpy.component
def ComponentProvidesContext():
- state, set_state.current = idom.use_state(0)
+ state, set_state.current = reactpy.use_state(0)
return Context(ComponentInContext(), value=state)
- @idom.component
+ @reactpy.component
def ComponentInContext():
- return idom.use_memo(MemoizedComponentUsesContext)
+ return reactpy.use_memo(MemoizedComponentUsesContext)
- @idom.component
+ @reactpy.component
def MemoizedComponentUsesContext():
- value.current = idom.use_context(Context)
+ value.current = reactpy.use_context(Context)
render_count.current += 1
return html.div()
- async with idom.Layout(ComponentProvidesContext()) as layout:
+ async with reactpy.Layout(ComponentProvidesContext()) as layout:
await layout.render()
assert render_count.current == 1
assert value.current == 0
@@ -986,22 +990,22 @@ def MemoizedComponentUsesContext():
async def test_context_values_are_scoped():
- Context = idom.create_context(None)
+ Context = reactpy.create_context(None)
- @idom.component
+ @reactpy.component
def Parent():
return html._(
Context(Context(Child1(), value=1), value="something-else"),
Context(Child2(), value=2),
)
- @idom.component
+ @reactpy.component
def Child1():
- assert idom.use_context(Context) == 1
+ assert reactpy.use_context(Context) == 1
- @idom.component
+ @reactpy.component
def Child2():
- assert idom.use_context(Context) == 2
+ assert reactpy.use_context(Context) == 2
async with Layout(Parent()) as layout:
await layout.render()
@@ -1010,7 +1014,7 @@ def Child2():
async def test_error_in_effect_cleanup_is_gracefully_handled():
component_hook = HookCatcher()
- @idom.component
+ @reactpy.component
@component_hook.capture
def ComponentWithEffect():
hook = current_hook()
@@ -1019,14 +1023,14 @@ def bad_effect():
raise ValueError("The error message")
hook.add_effect(COMPONENT_DID_RENDER_EFFECT, bad_effect)
- return idom.html.div()
+ return reactpy.html.div()
- with assert_idom_did_log(
+ with assert_reactpy_did_log(
match_message="Component post-render effect .*? failed",
error_type=ValueError,
match_error="The error message",
):
- async with idom.Layout(ComponentWithEffect()) as layout:
+ async with reactpy.Layout(ComponentWithEffect()) as layout:
await layout.render()
component_hook.latest.schedule_render()
await layout.render() # no error
@@ -1035,10 +1039,10 @@ def bad_effect():
async def test_set_state_during_render():
render_count = Ref(0)
- @idom.component
+ @reactpy.component
def SetStateDuringRender():
render_count.current += 1
- state, set_state = idom.use_state(0)
+ state, set_state = reactpy.use_state(0)
if not state:
set_state(state + 1)
return html.div(state)
@@ -1054,102 +1058,104 @@ def SetStateDuringRender():
await asyncio.wait_for(layout.render(), timeout=0.1)
-@pytest.mark.skipif(not IDOM_DEBUG_MODE.current, reason="only logs in debug mode")
+@pytest.mark.skipif(not REACTPY_DEBUG_MODE.current, reason="only logs in debug mode")
async def test_use_debug_mode():
- set_message = idom.Ref()
+ set_message = reactpy.Ref()
component_hook = HookCatcher()
- @idom.component
+ @reactpy.component
@component_hook.capture
def SomeComponent():
- message, set_message.current = idom.use_state("hello")
- idom.use_debug_value(f"message is {message!r}")
- return idom.html.div()
+ message, set_message.current = reactpy.use_state("hello")
+ reactpy.use_debug_value(f"message is {message!r}")
+ return reactpy.html.div()
- async with idom.Layout(SomeComponent()) as layout:
- with assert_idom_did_log(r"SomeComponent\(.*?\) message is 'hello'"):
+ async with reactpy.Layout(SomeComponent()) as layout:
+ with assert_reactpy_did_log(r"SomeComponent\(.*?\) message is 'hello'"):
await layout.render()
set_message.current("bye")
- with assert_idom_did_log(r"SomeComponent\(.*?\) message is 'bye'"):
+ with assert_reactpy_did_log(r"SomeComponent\(.*?\) message is 'bye'"):
await layout.render()
component_hook.latest.schedule_render()
- with assert_idom_did_not_log(r"SomeComponent\(.*?\) message is 'bye'"):
+ with assert_reactpy_did_not_log(r"SomeComponent\(.*?\) message is 'bye'"):
await layout.render()
-@pytest.mark.skipif(not IDOM_DEBUG_MODE.current, reason="only logs in debug mode")
+@pytest.mark.skipif(not REACTPY_DEBUG_MODE.current, reason="only logs in debug mode")
async def test_use_debug_mode_with_factory():
- set_message = idom.Ref()
+ set_message = reactpy.Ref()
component_hook = HookCatcher()
- @idom.component
+ @reactpy.component
@component_hook.capture
def SomeComponent():
- message, set_message.current = idom.use_state("hello")
- idom.use_debug_value(lambda: f"message is {message!r}")
- return idom.html.div()
+ message, set_message.current = reactpy.use_state("hello")
+ reactpy.use_debug_value(lambda: f"message is {message!r}")
+ return reactpy.html.div()
- async with idom.Layout(SomeComponent()) as layout:
- with assert_idom_did_log(r"SomeComponent\(.*?\) message is 'hello'"):
+ async with reactpy.Layout(SomeComponent()) as layout:
+ with assert_reactpy_did_log(r"SomeComponent\(.*?\) message is 'hello'"):
await layout.render()
set_message.current("bye")
- with assert_idom_did_log(r"SomeComponent\(.*?\) message is 'bye'"):
+ with assert_reactpy_did_log(r"SomeComponent\(.*?\) message is 'bye'"):
await layout.render()
component_hook.latest.schedule_render()
- with assert_idom_did_not_log(r"SomeComponent\(.*?\) message is 'bye'"):
+ with assert_reactpy_did_not_log(r"SomeComponent\(.*?\) message is 'bye'"):
await layout.render()
-@pytest.mark.skipif(IDOM_DEBUG_MODE.current, reason="logs in debug mode")
+@pytest.mark.skipif(REACTPY_DEBUG_MODE.current, reason="logs in debug mode")
async def test_use_debug_mode_does_not_log_if_not_in_debug_mode():
- set_message = idom.Ref()
+ set_message = reactpy.Ref()
- @idom.component
+ @reactpy.component
def SomeComponent():
- message, set_message.current = idom.use_state("hello")
- idom.use_debug_value(lambda: f"message is {message!r}")
- return idom.html.div()
+ message, set_message.current = reactpy.use_state("hello")
+ reactpy.use_debug_value(lambda: f"message is {message!r}")
+ return reactpy.html.div()
- async with idom.Layout(SomeComponent()) as layout:
- with assert_idom_did_not_log(r"SomeComponent\(.*?\) message is 'hello'"):
+ async with reactpy.Layout(SomeComponent()) as layout:
+ with assert_reactpy_did_not_log(r"SomeComponent\(.*?\) message is 'hello'"):
await layout.render()
set_message.current("bye")
- with assert_idom_did_not_log(r"SomeComponent\(.*?\) message is 'bye'"):
+ with assert_reactpy_did_not_log(r"SomeComponent\(.*?\) message is 'bye'"):
await layout.render()
async def test_conditionally_rendered_components_can_use_context():
- set_state = idom.Ref()
+ set_state = reactpy.Ref()
used_context_values = []
- some_context = idom.create_context(None)
+ some_context = reactpy.create_context(None)
- @idom.component
+ @reactpy.component
def SomeComponent():
- state, set_state.current = idom.use_state(True)
+ state, set_state.current = reactpy.use_state(True)
if state:
return FirstCondition()
else:
return SecondCondition()
- @idom.component
+ @reactpy.component
def FirstCondition():
- used_context_values.append(idom.use_context(some_context) + "-1")
+ used_context_values.append(reactpy.use_context(some_context) + "-1")
- @idom.component
+ @reactpy.component
def SecondCondition():
- used_context_values.append(idom.use_context(some_context) + "-2")
+ used_context_values.append(reactpy.use_context(some_context) + "-2")
- async with idom.Layout(some_context(SomeComponent(), value="the-value")) as layout:
+ async with reactpy.Layout(
+ some_context(SomeComponent(), value="the-value")
+ ) as layout:
await layout.render()
assert used_context_values == ["the-value-1"]
set_state.current(False)
@@ -1193,15 +1199,15 @@ def test_strictly_equal(x, y, result):
@pytest.mark.parametrize("get_value", STRICT_EQUALITY_VALUE_CONSTRUCTORS)
async def test_use_state_compares_with_strict_equality(get_value):
- render_count = idom.Ref(0)
- set_state = idom.Ref()
+ render_count = reactpy.Ref(0)
+ set_state = reactpy.Ref()
- @idom.component
+ @reactpy.component
def SomeComponent():
- _, set_state.current = idom.use_state(get_value())
+ _, set_state.current = reactpy.use_state(get_value())
render_count.current += 1
- async with idom.Layout(SomeComponent()) as layout:
+ async with reactpy.Layout(SomeComponent()) as layout:
await layout.render()
assert render_count.current == 1
set_state.current(get_value())
@@ -1211,18 +1217,18 @@ def SomeComponent():
@pytest.mark.parametrize("get_value", STRICT_EQUALITY_VALUE_CONSTRUCTORS)
async def test_use_effect_compares_with_strict_equality(get_value):
- effect_count = idom.Ref(0)
- value = idom.Ref("string")
+ effect_count = reactpy.Ref(0)
+ value = reactpy.Ref("string")
hook = HookCatcher()
- @idom.component
+ @reactpy.component
@hook.capture
def SomeComponent():
- @idom.use_effect(dependencies=[value.current])
+ @reactpy.use_effect(dependencies=[value.current])
def incr_effect_count():
effect_count.current += 1
- async with idom.Layout(SomeComponent()) as layout:
+ async with reactpy.Layout(SomeComponent()) as layout:
await layout.render()
assert effect_count.current == 1
value.current = "string" # new string instance but same value
@@ -1233,14 +1239,14 @@ def incr_effect_count():
async def test_use_state_named_tuple():
- state = idom.Ref()
+ state = reactpy.Ref()
- @idom.component
+ @reactpy.component
def some_component():
- state.current = idom.use_state(1)
+ state.current = reactpy.use_state(1)
return None
- async with idom.Layout(some_component()) as layout:
+ async with reactpy.Layout(some_component()) as layout:
await layout.render()
assert state.current.value == 1
state.current.set_value(2)
diff --git a/tests/test_core/test_layout.py b/tests/test_core/test_layout.py
index b66352589..d46913314 100644
--- a/tests/test_core/test_layout.py
+++ b/tests/test_core/test_layout.py
@@ -7,26 +7,26 @@
import pytest
-import idom
-from idom import html
-from idom.config import IDOM_DEBUG_MODE
-from idom.core.component import component
-from idom.core.hooks import use_effect, use_state
-from idom.core.layout import Layout
-from idom.testing import (
+import reactpy
+from reactpy import html
+from reactpy.config import REACTPY_DEBUG_MODE
+from reactpy.core.component import component
+from reactpy.core.hooks import use_effect, use_state
+from reactpy.core.layout import Layout
+from reactpy.testing import (
HookCatcher,
StaticEventHandler,
- assert_idom_did_log,
- capture_idom_logs,
+ assert_reactpy_did_log,
+ capture_reactpy_logs,
)
-from idom.utils import Ref
+from reactpy.utils import Ref
from tests.tooling.common import event_message, update_message
from tests.tooling.hooks import use_force_render, use_toggle
@pytest.fixture(autouse=True)
def no_logged_errors():
- with capture_idom_logs() as logs:
+ with capture_reactpy_logs() as logs:
yield
for record in logs:
if record.exc_info:
@@ -34,29 +34,29 @@ def no_logged_errors():
def test_layout_repr():
- @idom.component
+ @reactpy.component
def MyComponent():
...
my_component = MyComponent()
- layout = idom.Layout(my_component)
+ layout = reactpy.Layout(my_component)
assert str(layout) == f"Layout(MyComponent({id(my_component):02x}))"
def test_layout_expects_abstract_component():
with pytest.raises(TypeError, match="Expected a ComponentType"):
- idom.Layout(None)
+ reactpy.Layout(None)
with pytest.raises(TypeError, match="Expected a ComponentType"):
- idom.Layout(idom.html.div())
+ reactpy.Layout(reactpy.html.div())
async def test_layout_cannot_be_used_outside_context_manager(caplog):
- @idom.component
+ @reactpy.component
def Component():
...
component = Component()
- layout = idom.Layout(component)
+ layout = reactpy.Layout(component)
with pytest.raises(Exception):
await layout.deliver(event_message("something"))
@@ -69,14 +69,14 @@ def Component():
async def test_simple_layout():
- set_state_hook = idom.Ref()
+ set_state_hook = reactpy.Ref()
- @idom.component
+ @reactpy.component
def SimpleComponent():
- tag, set_state_hook.current = idom.hooks.use_state("div")
- return idom.vdom(tag)
+ tag, set_state_hook.current = reactpy.hooks.use_state("div")
+ return reactpy.vdom(tag)
- async with idom.Layout(SimpleComponent()) as layout:
+ async with reactpy.Layout(SimpleComponent()) as layout:
update_1 = await layout.render()
assert update_1 == update_message(
path="",
@@ -93,27 +93,27 @@ def SimpleComponent():
async def test_component_can_return_none():
- @idom.component
+ @reactpy.component
def SomeComponent():
return None
- async with idom.Layout(SomeComponent()) as layout:
+ async with reactpy.Layout(SomeComponent()) as layout:
assert (await layout.render())["model"] == {"tagName": ""}
async def test_nested_component_layout():
- parent_set_state = idom.Ref(None)
- child_set_state = idom.Ref(None)
+ parent_set_state = reactpy.Ref(None)
+ child_set_state = reactpy.Ref(None)
- @idom.component
+ @reactpy.component
def Parent():
- state, parent_set_state.current = idom.hooks.use_state(0)
- return idom.html.div(state, Child())
+ state, parent_set_state.current = reactpy.hooks.use_state(0)
+ return reactpy.html.div(state, Child())
- @idom.component
+ @reactpy.component
def Child():
- state, child_set_state.current = idom.hooks.use_state(0)
- return idom.html.div(state)
+ state, child_set_state.current = reactpy.hooks.use_state(0)
+ return reactpy.html.div(state)
def make_parent_model(state, model):
return {
@@ -132,7 +132,7 @@ def make_child_model(state):
"children": [{"tagName": "div", "children": [str(state)]}],
}
- async with idom.Layout(Parent()) as layout:
+ async with reactpy.Layout(Parent()) as layout:
update_1 = await layout.render()
assert update_1 == update_message(
path="",
@@ -157,24 +157,24 @@ def make_child_model(state):
@pytest.mark.skipif(
- not IDOM_DEBUG_MODE.current,
+ not REACTPY_DEBUG_MODE.current,
reason="errors only reported in debug mode",
)
async def test_layout_render_error_has_partial_update_with_error_message():
- @idom.component
+ @reactpy.component
def Main():
- return idom.html.div([OkChild(), BadChild(), OkChild()])
+ return reactpy.html.div([OkChild(), BadChild(), OkChild()])
- @idom.component
+ @reactpy.component
def OkChild():
- return idom.html.div(["hello"])
+ return reactpy.html.div(["hello"])
- @idom.component
+ @reactpy.component
def BadChild():
raise ValueError("error from bad child")
- with assert_idom_did_log(match_error="error from bad child"):
- async with idom.Layout(Main()) as layout:
+ with assert_reactpy_did_log(match_error="error from bad child"):
+ async with reactpy.Layout(Main()) as layout:
assert (await layout.render()) == update_message(
path="",
model={
@@ -207,24 +207,24 @@ def BadChild():
@pytest.mark.skipif(
- IDOM_DEBUG_MODE.current,
+ REACTPY_DEBUG_MODE.current,
reason="errors only reported in debug mode",
)
async def test_layout_render_error_has_partial_update_without_error_message():
- @idom.component
+ @reactpy.component
def Main():
- return idom.html.div([OkChild(), BadChild(), OkChild()])
+ return reactpy.html.div([OkChild(), BadChild(), OkChild()])
- @idom.component
+ @reactpy.component
def OkChild():
- return idom.html.div(["hello"])
+ return reactpy.html.div(["hello"])
- @idom.component
+ @reactpy.component
def BadChild():
raise ValueError("error from bad child")
- with assert_idom_did_log(match_error="error from bad child"):
- async with idom.Layout(Main()) as layout:
+ with assert_reactpy_did_log(match_error="error from bad child"):
+ async with reactpy.Layout(Main()) as layout:
assert (await layout.render()) == update_message(
path="",
model={
@@ -254,15 +254,15 @@ def BadChild():
async def test_render_raw_vdom_dict_with_single_component_object_as_children():
- @idom.component
+ @reactpy.component
def Main():
return {"tagName": "div", "children": Child()}
- @idom.component
+ @reactpy.component
def Child():
return {"tagName": "div", "children": {"tagName": "h1"}}
- async with idom.Layout(Main()) as layout:
+ async with reactpy.Layout(Main()) as layout:
assert (await layout.render()) == update_message(
path="",
model={
@@ -302,17 +302,17 @@ def wrapper(*args, **kwargs):
return wrapper
@add_to_live_components
- @idom.component
+ @reactpy.component
@outer_component_hook.capture
def Outer():
return Inner()
@add_to_live_components
- @idom.component
+ @reactpy.component
def Inner():
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(Outer()) as layout:
+ async with reactpy.Layout(Outer()) as layout:
await layout.render()
assert len(live_components) == 2
@@ -342,7 +342,7 @@ async def test_root_component_life_cycle_hook_is_garbage_collected():
def add_to_live_hooks(constructor):
def wrapper(*args, **kwargs):
result = constructor(*args, **kwargs)
- hook = idom.hooks.current_hook()
+ hook = reactpy.hooks.current_hook()
hook_id = id(hook)
live_hooks.add(hook_id)
finalize(hook, live_hooks.discard, hook_id)
@@ -350,12 +350,12 @@ def wrapper(*args, **kwargs):
return wrapper
- @idom.component
+ @reactpy.component
@add_to_live_hooks
def Root():
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(Root()) as layout:
+ async with reactpy.Layout(Root()) as layout:
await layout.render()
assert len(live_hooks) == 1
@@ -374,7 +374,7 @@ async def test_life_cycle_hooks_are_garbage_collected():
def add_to_live_hooks(constructor):
def wrapper(*args, **kwargs):
result = constructor(*args, **kwargs)
- hook = idom.hooks.current_hook()
+ hook = reactpy.hooks.current_hook()
hook_id = id(hook)
live_hooks.add(hook_id)
finalize(hook, live_hooks.discard, hook_id)
@@ -382,19 +382,21 @@ def wrapper(*args, **kwargs):
return wrapper
- @idom.component
+ @reactpy.component
@add_to_live_hooks
def Outer():
nonlocal set_inner_component
- inner_component, set_inner_component = idom.hooks.use_state(Inner(key="first"))
+ inner_component, set_inner_component = reactpy.hooks.use_state(
+ Inner(key="first")
+ )
return inner_component
- @idom.component
+ @reactpy.component
@add_to_live_hooks
def Inner():
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(Outer()) as layout:
+ async with reactpy.Layout(Outer()) as layout:
await layout.render()
assert len(live_hooks) == 2
@@ -423,15 +425,15 @@ def Inner():
async def test_double_updated_component_is_not_double_rendered():
hook = HookCatcher()
- run_count = idom.Ref(0)
+ run_count = reactpy.Ref(0)
- @idom.component
+ @reactpy.component
@hook.capture
def AnyComponent():
run_count.current += 1
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(AnyComponent()) as layout:
+ async with reactpy.Layout(AnyComponent()) as layout:
await layout.render()
assert run_count.current == 1
@@ -454,16 +456,16 @@ def AnyComponent():
async def test_update_path_to_component_that_is_not_direct_child_is_correct():
hook = HookCatcher()
- @idom.component
+ @reactpy.component
def Parent():
- return idom.html.div(idom.html.div(Child()))
+ return reactpy.html.div(reactpy.html.div(Child()))
- @idom.component
+ @reactpy.component
@hook.capture
def Child():
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(Parent()) as layout:
+ async with reactpy.Layout(Parent()) as layout:
await layout.render()
hook.latest.schedule_render()
@@ -473,11 +475,11 @@ def Child():
async def test_log_on_dispatch_to_missing_event_handler(caplog):
- @idom.component
+ @reactpy.component
def SomeComponent():
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(SomeComponent()) as layout:
+ async with reactpy.Layout(SomeComponent()) as layout:
await layout.deliver(event_message("missing"))
assert re.match(
@@ -487,11 +489,11 @@ def SomeComponent():
async def test_model_key_preserves_callback_identity_for_common_elements(caplog):
- called_good_trigger = idom.Ref(False)
+ called_good_trigger = reactpy.Ref(False)
good_handler = StaticEventHandler()
bad_handler = StaticEventHandler()
- @idom.component
+ @reactpy.component
def MyComponent():
reverse_children, set_reverse_children = use_toggle()
@@ -505,10 +507,10 @@ def bad_trigger():
raise ValueError("Called bad trigger")
children = [
- idom.html.button(
+ reactpy.html.button(
{"on_click": good_trigger, "id": "good", "key": "good"}, "good"
),
- idom.html.button(
+ reactpy.html.button(
{"on_click": bad_trigger, "id": "bad", "key": "bad"}, "bad"
),
]
@@ -516,9 +518,9 @@ def bad_trigger():
if reverse_children:
children.reverse()
- return idom.html.div(children)
+ return reactpy.html.div(children)
- async with idom.Layout(MyComponent()) as layout:
+ async with reactpy.Layout(MyComponent()) as layout:
await layout.render()
for i in range(3):
event = event_message(good_handler.target)
@@ -534,11 +536,11 @@ def bad_trigger():
async def test_model_key_preserves_callback_identity_for_components():
- called_good_trigger = idom.Ref(False)
+ called_good_trigger = reactpy.Ref(False)
good_handler = StaticEventHandler()
bad_handler = StaticEventHandler()
- @idom.component
+ @reactpy.component
def RootComponent():
reverse_children, set_reverse_children = use_toggle()
@@ -550,9 +552,9 @@ def RootComponent():
if reverse_children:
children.reverse()
- return idom.html.div(children)
+ return reactpy.html.div(children)
- @idom.component
+ @reactpy.component
def Trigger(set_reverse_children, name):
if name == "good":
@@ -567,9 +569,9 @@ def callback():
def callback():
raise ValueError("Called bad trigger")
- return idom.html.button({"on_click": callback, "id": "good"}, "good")
+ return reactpy.html.button({"on_click": callback, "id": "good"}, "good")
- async with idom.Layout(RootComponent()) as layout:
+ async with reactpy.Layout(RootComponent()) as layout:
await layout.render()
for _ in range(3):
event = event_message(good_handler.target)
@@ -583,15 +585,15 @@ def callback():
async def test_component_can_return_another_component_directly():
- @idom.component
+ @reactpy.component
def Outer():
return Inner()
- @idom.component
+ @reactpy.component
def Inner():
- return idom.html.div("hello")
+ return reactpy.html.div("hello")
- async with idom.Layout(Outer()) as layout:
+ async with reactpy.Layout(Outer()) as layout:
assert (await layout.render()) == update_message(
path="",
model={
@@ -607,25 +609,25 @@ def Inner():
async def test_hooks_for_keyed_components_get_garbage_collected():
- pop_item = idom.Ref(None)
+ pop_item = reactpy.Ref(None)
garbage_collect_items = []
registered_finalizers = set()
- @idom.component
+ @reactpy.component
def Outer():
- items, set_items = idom.hooks.use_state([1, 2, 3])
+ items, set_items = reactpy.hooks.use_state([1, 2, 3])
pop_item.current = lambda: set_items(items[:-1])
- return idom.html.div(Inner(key=k, finalizer_id=k) for k in items)
+ return reactpy.html.div(Inner(key=k, finalizer_id=k) for k in items)
- @idom.component
+ @reactpy.component
def Inner(finalizer_id):
if finalizer_id not in registered_finalizers:
- hook = idom.hooks.current_hook()
+ hook = reactpy.hooks.current_hook()
finalize(hook, lambda: garbage_collect_items.append(finalizer_id))
registered_finalizers.add(finalizer_id)
- return idom.html.div(finalizer_id)
+ return reactpy.html.div(finalizer_id)
- async with idom.Layout(Outer()) as layout:
+ async with reactpy.Layout(Outer()) as layout:
await layout.render()
pop_item.current()
@@ -642,18 +644,18 @@ def Inner(finalizer_id):
async def test_event_handler_at_component_root_is_garbage_collected():
- event_handler = idom.Ref()
+ event_handler = reactpy.Ref()
- @idom.component
+ @reactpy.component
def HasEventHandlerAtRoot():
- value, set_value = idom.hooks.use_state(False)
+ value, set_value = reactpy.hooks.use_state(False)
set_value(not value) # trigger renders forever
event_handler.current = weakref(set_value)
- button = idom.html.button({"on_click": set_value}, "state is: ", value)
+ button = reactpy.html.button({"on_click": set_value}, "state is: ", value)
event_handler.current = weakref(button["eventHandlers"]["on_click"].function)
return button
- async with idom.Layout(HasEventHandlerAtRoot()) as layout:
+ async with reactpy.Layout(HasEventHandlerAtRoot()) as layout:
await layout.render()
for i in range(3):
@@ -664,18 +666,18 @@ def HasEventHandlerAtRoot():
async def test_event_handler_deep_in_component_layout_is_garbage_collected():
- event_handler = idom.Ref()
+ event_handler = reactpy.Ref()
- @idom.component
+ @reactpy.component
def HasNestedEventHandler():
- value, set_value = idom.hooks.use_state(False)
+ value, set_value = reactpy.hooks.use_state(False)
set_value(not value) # trigger renders forever
event_handler.current = weakref(set_value)
- button = idom.html.button({"on_click": set_value}, "state is: ", value)
+ button = reactpy.html.button({"on_click": set_value}, "state is: ", value)
event_handler.current = weakref(button["eventHandlers"]["on_click"].function)
- return idom.html.div(idom.html.div(button))
+ return reactpy.html.div(reactpy.html.div(button))
- async with idom.Layout(HasNestedEventHandler()) as layout:
+ async with reactpy.Layout(HasNestedEventHandler()) as layout:
await layout.render()
for i in range(3):
@@ -689,19 +691,19 @@ async def test_duplicate_sibling_keys_causes_error(caplog):
hook = HookCatcher()
should_error = True
- @idom.component
+ @reactpy.component
@hook.capture
def ComponentReturnsDuplicateKeys():
if should_error:
- return idom.html.div(
- idom.html.div({"key": "duplicate"}),
- idom.html.div({"key": "duplicate"}),
+ return reactpy.html.div(
+ reactpy.html.div({"key": "duplicate"}),
+ reactpy.html.div({"key": "duplicate"}),
)
else:
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(ComponentReturnsDuplicateKeys()) as layout:
- with assert_idom_did_log(
+ async with reactpy.Layout(ComponentReturnsDuplicateKeys()) as layout:
+ with assert_reactpy_did_log(
error_type=ValueError,
match_error=r"Duplicate keys \['duplicate'\] at '/children/0'",
):
@@ -714,7 +716,7 @@ def ComponentReturnsDuplicateKeys():
should_error = True
hook.latest.schedule_render()
- with assert_idom_did_log(
+ with assert_reactpy_did_log(
error_type=ValueError,
match_error=r"Duplicate keys \['duplicate'\] at '/children/0'",
):
@@ -725,17 +727,17 @@ async def test_keyed_components_preserve_hook_on_parent_update():
outer_hook = HookCatcher()
inner_hook = HookCatcher()
- @idom.component
+ @reactpy.component
@outer_hook.capture
def Outer():
return Inner(key=1)
- @idom.component
+ @reactpy.component
@inner_hook.capture
def Inner():
- return idom.html.div()
+ return reactpy.html.div()
- async with idom.Layout(Outer()) as layout:
+ async with reactpy.Layout(Outer()) as layout:
await layout.render()
old_inner_hook = inner_hook.latest
@@ -747,41 +749,41 @@ def Inner():
async def test_log_error_on_bad_event_handler():
bad_handler = StaticEventHandler()
- @idom.component
+ @reactpy.component
def ComponentWithBadEventHandler():
@bad_handler.use
def raise_error():
raise Exception("bad event handler")
- return idom.html.button({"on_click": raise_error})
+ return reactpy.html.button({"on_click": raise_error})
- with assert_idom_did_log(match_error="bad event handler"):
- async with idom.Layout(ComponentWithBadEventHandler()) as layout:
+ with assert_reactpy_did_log(match_error="bad event handler"):
+ async with reactpy.Layout(ComponentWithBadEventHandler()) as layout:
await layout.render()
event = event_message(bad_handler.target)
await layout.deliver(event)
async def test_schedule_render_from_unmounted_hook():
- parent_set_state = idom.Ref()
+ parent_set_state = reactpy.Ref()
- @idom.component
+ @reactpy.component
def Parent():
- state, parent_set_state.current = idom.hooks.use_state(1)
+ state, parent_set_state.current = reactpy.hooks.use_state(1)
return Child(key=state, state=state)
child_hook = HookCatcher()
- @idom.component
+ @reactpy.component
@child_hook.capture
def Child(state):
- idom.hooks.use_effect(lambda: lambda: print("unmount", state))
- return idom.html.div(state)
+ reactpy.hooks.use_effect(lambda: lambda: print("unmount", state))
+ return reactpy.html.div(state)
- with assert_idom_did_log(
+ with assert_reactpy_did_log(
r"Did not render component with model state ID .*? - component already unmounted",
):
- async with idom.Layout(Parent()) as layout:
+ async with reactpy.Layout(Parent()) as layout:
await layout.render()
old_hook = child_hook.latest
@@ -801,27 +803,27 @@ def Child(state):
async def test_elements_and_components_with_the_same_key_can_be_interchanged():
- set_toggle = idom.Ref()
+ set_toggle = reactpy.Ref()
effects = []
- @idom.component
+ @reactpy.component
def Root():
toggle, set_toggle.current = use_toggle(True)
if toggle:
return SomeComponent("x")
else:
- return idom.html.div(SomeComponent("y"))
+ return reactpy.html.div(SomeComponent("y"))
- @idom.component
+ @reactpy.component
def SomeComponent(name):
@use_effect
def some_effect():
effects.append("mount " + name)
return lambda: effects.append("unmount " + name)
- return idom.html.div(name)
+ return reactpy.html.div(name)
- async with idom.Layout(Root()) as layout:
+ async with reactpy.Layout(Root()) as layout:
await layout.render()
assert effects == ["mount x"]
@@ -839,24 +841,24 @@ def some_effect():
async def test_layout_does_not_copy_element_children_by_key():
# this is a regression test for a subtle bug:
- # https://github.com/idom-team/idom/issues/556
+ # https://github.com/reactive-python/reactpy/issues/556
- set_items = idom.Ref()
+ set_items = reactpy.Ref()
- @idom.component
+ @reactpy.component
def SomeComponent():
- items, set_items.current = idom.use_state([1, 2, 3])
- return idom.html.div(
+ items, set_items.current = reactpy.use_state([1, 2, 3])
+ return reactpy.html.div(
[
- idom.html.div(
+ reactpy.html.div(
{"key": i},
- idom.html.input({"on_change": lambda event: None}),
+ reactpy.html.input({"on_change": lambda event: None}),
)
for i in items
]
)
- async with idom.Layout(SomeComponent()) as layout:
+ async with reactpy.Layout(SomeComponent()) as layout:
await layout.render()
set_items.current([2, 3])
@@ -876,19 +878,19 @@ async def test_changing_key_of_parent_element_unmounts_children():
random.seed(0)
root_hook = HookCatcher()
- state = idom.Ref(None)
+ state = reactpy.Ref(None)
- @idom.component
+ @reactpy.component
@root_hook.capture
def Root():
- return idom.html.div({"key": str(random.random())}, HasState())
+ return reactpy.html.div({"key": str(random.random())}, HasState())
- @idom.component
+ @reactpy.component
def HasState():
- state.current = idom.hooks.use_state(random.random)[0]
- return idom.html.div()
+ state.current = reactpy.hooks.use_state(random.random)[0]
+ return reactpy.html.div()
- async with idom.Layout(Root()) as layout:
+ async with reactpy.Layout(Root()) as layout:
await layout.render()
for i in range(5):
@@ -899,11 +901,11 @@ def HasState():
async def test_switching_node_type_with_event_handlers():
- toggle_type = idom.Ref()
+ toggle_type = reactpy.Ref()
element_static_handler = StaticEventHandler()
component_static_handler = StaticEventHandler()
- @idom.component
+ @reactpy.component
def Root():
toggle, toggle_type.current = use_toggle(True)
handler = element_static_handler.use(lambda: None)
@@ -912,12 +914,12 @@ def Root():
else:
return html.div(SomeComponent())
- @idom.component
+ @reactpy.component
def SomeComponent():
handler = component_static_handler.use(lambda: None)
return html.button({"on_another_event": handler})
- async with idom.Layout(Root()) as layout:
+ async with reactpy.Layout(Root()) as layout:
await layout.render()
assert element_static_handler.target in layout._event_handlers
@@ -937,11 +939,11 @@ def SomeComponent():
async def test_switching_component_definition():
- toggle_component = idom.Ref()
- first_used_state = idom.Ref(None)
- second_used_state = idom.Ref(None)
+ toggle_component = reactpy.Ref()
+ first_used_state = reactpy.Ref(None)
+ second_used_state = reactpy.Ref(None)
- @idom.component
+ @reactpy.component
def Root():
toggle, toggle_component.current = use_toggle(True)
if toggle:
@@ -949,21 +951,21 @@ def Root():
else:
return SecondComponent()
- @idom.component
+ @reactpy.component
def FirstComponent():
first_used_state.current = use_state("first")[0]
# reset state after unmount
use_effect(lambda: lambda: first_used_state.set_current(None))
return html.div()
- @idom.component
+ @reactpy.component
def SecondComponent():
second_used_state.current = use_state("second")[0]
# reset state after unmount
use_effect(lambda: lambda: second_used_state.set_current(None))
return html.div()
- async with idom.Layout(Root()) as layout:
+ async with reactpy.Layout(Root()) as layout:
await layout.render()
assert first_used_state.current == "first"
@@ -1019,7 +1021,7 @@ async def record_if_state_is_reset():
return html.div({"key": child_key}, child_key)
- async with idom.Layout(Parent()) as layout:
+ async with reactpy.Layout(Parent()) as layout:
await layout.render()
await did_call_effect.wait()
assert effect_calls_without_state == {"some-key", "key-0"}
@@ -1118,7 +1120,7 @@ async def test_does_render_children_after_component():
after the component failed to display.
"""
- @idom.component
+ @reactpy.component
def Parent():
return html.div(
html.p("first"),
@@ -1126,11 +1128,11 @@ def Parent():
html.p("third"),
)
- @idom.component
+ @reactpy.component
def Child():
return html.p("second")
- async with idom.Layout(Parent()) as layout:
+ async with reactpy.Layout(Parent()) as layout:
update = await layout.render()
assert update["model"] == {
"tagName": "",
@@ -1151,7 +1153,7 @@ def Child():
async def test_render_removed_context_consumer():
- Context = idom.create_context(None)
+ Context = reactpy.create_context(None)
toggle_remove_child = None
schedule_removed_child_render = None
@@ -1167,7 +1169,7 @@ def Child():
schedule_removed_child_render = use_force_render()
return None
- async with idom.Layout(Parent()) as layout:
+ async with reactpy.Layout(Parent()) as layout:
await layout.render()
# If the context provider does not render its children then internally tracked
diff --git a/tests/test_core/test_serve.py b/tests/test_core/test_serve.py
index 18ea8853e..b875b3649 100644
--- a/tests/test_core/test_serve.py
+++ b/tests/test_core/test_serve.py
@@ -3,11 +3,11 @@
from jsonpointer import set_pointer
-import idom
-from idom.core.layout import Layout
-from idom.core.serve import serve_layout
-from idom.core.types import LayoutUpdateMessage
-from idom.testing import StaticEventHandler
+import reactpy
+from reactpy.core.layout import Layout
+from reactpy.core.serve import serve_layout
+from reactpy.core.types import LayoutUpdateMessage
+from reactpy.testing import StaticEventHandler
from tests.tooling.common import event_message
@@ -29,7 +29,7 @@ async def send(patch):
changes.append(patch)
sem.release()
if not events_to_inject:
- raise idom.Stop()
+ raise reactpy.Stop()
async def recv():
await sem.acquire()
@@ -78,14 +78,14 @@ def assert_changes_produce_expected_model(
assert model_from_changes == expected_model
-@idom.component
+@reactpy.component
def Counter():
- count, change_count = idom.hooks.use_reducer(
+ count, change_count = reactpy.hooks.use_reducer(
(lambda old_count, diff: old_count + diff),
initial_value=0,
)
handler = STATIC_EVENT_HANDLER.use(lambda: change_count(1))
- return idom.html.div({EVENT_NAME: handler, "count": count})
+ return reactpy.html.div({EVENT_NAME: handler, "count": count})
async def test_dispatch():
@@ -103,7 +103,7 @@ async def test_dispatcher_handles_more_than_one_event_at_a_time():
blocked_handler = StaticEventHandler()
non_blocked_handler = StaticEventHandler()
- @idom.component
+ @reactpy.component
def ComponentWithTwoEventHandlers():
@blocked_handler.use
async def block_forever():
@@ -114,9 +114,9 @@ async def block_forever():
async def handle_event():
second_event_did_execute.set()
- return idom.html.div(
- idom.html.button({"on_click": block_forever}),
- idom.html.button({"on_click": handle_event}),
+ return reactpy.html.div(
+ reactpy.html.button({"on_click": block_forever}),
+ reactpy.html.button({"on_click": handle_event}),
)
send_queue = asyncio.Queue()
@@ -124,7 +124,7 @@ async def handle_event():
asyncio.ensure_future(
serve_layout(
- idom.Layout(ComponentWithTwoEventHandlers()),
+ reactpy.Layout(ComponentWithTwoEventHandlers()),
send_queue.put,
recv_queue.get,
)
diff --git a/tests/test_core/test_vdom.py b/tests/test_core/test_vdom.py
index 328bbcd6a..1b86207de 100644
--- a/tests/test_core/test_vdom.py
+++ b/tests/test_core/test_vdom.py
@@ -3,11 +3,11 @@
import pytest
from fastjsonschema import JsonSchemaException
-import idom
-from idom.config import IDOM_DEBUG_MODE
-from idom.core.events import EventHandler
-from idom.core.types import VdomDict
-from idom.core.vdom import is_vdom, make_vdom_constructor, validate_vdom_json
+import reactpy
+from reactpy.config import REACTPY_DEBUG_MODE
+from reactpy.core.events import EventHandler
+from reactpy.core.types import VdomDict
+from reactpy.core.vdom import is_vdom, make_vdom_constructor, validate_vdom_json
FAKE_EVENT_HANDLER = EventHandler(lambda data: None)
@@ -32,27 +32,27 @@ def test_is_vdom(result, value):
"actual, expected",
[
(
- idom.vdom("div", [idom.vdom("div")]),
+ reactpy.vdom("div", [reactpy.vdom("div")]),
{"tagName": "div", "children": [{"tagName": "div"}]},
),
(
- idom.vdom("div", {"style": {"backgroundColor": "red"}}),
+ reactpy.vdom("div", {"style": {"backgroundColor": "red"}}),
{"tagName": "div", "attributes": {"style": {"backgroundColor": "red"}}},
),
(
# multiple iterables of children are merged
- idom.vdom("div", [idom.vdom("div"), 1], (idom.vdom("div"), 2)),
+ reactpy.vdom("div", [reactpy.vdom("div"), 1], (reactpy.vdom("div"), 2)),
{
"tagName": "div",
"children": [{"tagName": "div"}, 1, {"tagName": "div"}, 2],
},
),
(
- idom.vdom("div", {"on_event": FAKE_EVENT_HANDLER}),
+ reactpy.vdom("div", {"on_event": FAKE_EVENT_HANDLER}),
{"tagName": "div", "eventHandlers": FAKE_EVENT_HANDLER_DICT},
),
(
- idom.vdom("div", idom.html.h1("hello"), idom.html.h2("world")),
+ reactpy.vdom("div", reactpy.html.h1("hello"), reactpy.html.h2("world")),
{
"tagName": "div",
"children": [
@@ -62,15 +62,15 @@ def test_is_vdom(result, value):
},
),
(
- idom.vdom("div", {"tagName": "div"}),
+ reactpy.vdom("div", {"tagName": "div"}),
{"tagName": "div", "children": [{"tagName": "div"}]},
),
(
- idom.vdom("div", (i for i in range(3))),
+ reactpy.vdom("div", (i for i in range(3))),
{"tagName": "div", "children": [0, 1, 2]},
),
(
- idom.vdom("div", map(lambda x: x**2, [1, 2, 3])),
+ reactpy.vdom("div", map(lambda x: x**2, [1, 2, 3])),
{"tagName": "div", "children": [1, 4, 9]},
),
],
@@ -82,7 +82,9 @@ def test_simple_node_construction(actual, expected):
async def test_callable_attributes_are_cast_to_event_handlers():
params_from_calls = []
- node = idom.vdom("div", {"on_event": lambda *args: params_from_calls.append(args)})
+ node = reactpy.vdom(
+ "div", {"on_event": lambda *args: params_from_calls.append(args)}
+ )
event_handlers = node.pop("eventHandlers")
assert node == {"tagName": "div"}
@@ -279,9 +281,9 @@ def test_invalid_vdom(value, error_message_pattern):
validate_vdom_json(value)
-@pytest.mark.skipif(not IDOM_DEBUG_MODE.current, reason="Only logs in debug mode")
+@pytest.mark.skipif(not REACTPY_DEBUG_MODE.current, reason="Only logs in debug mode")
def test_debug_log_cannot_verify_keypath_for_genereators(caplog):
- idom.vdom("div", (1 for i in range(10)))
+ reactpy.vdom("div", (1 for i in range(10)))
assert len(caplog.records) == 1
assert caplog.records[0].message.startswith(
"Did not verify key-path integrity of children in generator"
@@ -289,18 +291,18 @@ def test_debug_log_cannot_verify_keypath_for_genereators(caplog):
caplog.records.clear()
-@pytest.mark.skipif(not IDOM_DEBUG_MODE.current, reason="Only logs in debug mode")
+@pytest.mark.skipif(not REACTPY_DEBUG_MODE.current, reason="Only logs in debug mode")
def test_debug_log_dynamic_children_must_have_keys(caplog):
- idom.vdom("div", [idom.vdom("div")])
+ reactpy.vdom("div", [reactpy.vdom("div")])
assert len(caplog.records) == 1
assert caplog.records[0].message.startswith("Key not specified for child")
caplog.records.clear()
- @idom.component
+ @reactpy.component
def MyComponent():
- return idom.vdom("div")
+ return reactpy.vdom("div")
- idom.vdom("div", [MyComponent()])
+ reactpy.vdom("div", [MyComponent()])
assert len(caplog.records) == 1
assert caplog.records[0].message.startswith("Key not specified for child")
diff --git a/tests/test_html.py b/tests/test_html.py
index f7ac6c829..f16d1beed 100644
--- a/tests/test_html.py
+++ b/tests/test_html.py
@@ -1,8 +1,8 @@
import pytest
-from idom import component, config, html
-from idom.testing import DisplayFixture, poll
-from idom.utils import Ref
+from reactpy import component, config, html
+from reactpy.testing import DisplayFixture, poll
+from reactpy.utils import Ref
from tests.tooling.hooks import use_counter, use_toggle
@@ -104,7 +104,7 @@ def HasScript():
html.div({"id": "run-count", "data_value": 0}),
html.script(
{
- "src": f"/_idom/modules/{file_name_template.format(src_id=src_id)}"
+ "src": f"/_reactpy/modules/{file_name_template.format(src_id=src_id)}"
}
),
)
@@ -112,8 +112,8 @@ def HasScript():
await display.show(HasScript)
for i in range(1, 4):
- script_file = config.IDOM_WEB_MODULES_DIR.current / file_name_template.format(
- src_id=i
+ script_file = (
+ config.REACTPY_WEB_MODULES_DIR.current / file_name_template.format(src_id=i)
)
script_file.write_text(
f"""
diff --git a/tests/test_sample.py b/tests/test_sample.py
index cc9f86dd1..e7a281765 100644
--- a/tests/test_sample.py
+++ b/tests/test_sample.py
@@ -1,5 +1,5 @@
-from idom.sample import SampleApp
-from idom.testing import DisplayFixture
+from reactpy.sample import SampleApp
+from reactpy.testing import DisplayFixture
async def test_sample_app(display: DisplayFixture):
diff --git a/tests/test_testing.py b/tests/test_testing.py
index 32532a736..5651f93bc 100644
--- a/tests/test_testing.py
+++ b/tests/test_testing.py
@@ -3,30 +3,30 @@
import pytest
-from idom import Ref, component, html, testing
-from idom.backend import starlette as starlette_implementation
-from idom.logging import ROOT_LOGGER
-from idom.sample import SampleApp as SampleApp
-from idom.testing.backend import _hotswap
-from idom.testing.display import DisplayFixture
+from reactpy import Ref, component, html, testing
+from reactpy.backend import starlette as starlette_implementation
+from reactpy.logging import ROOT_LOGGER
+from reactpy.sample import SampleApp as SampleApp
+from reactpy.testing.backend import _hotswap
+from reactpy.testing.display import DisplayFixture
-def test_assert_idom_logged_does_not_supress_errors():
+def test_assert_reactpy_logged_does_not_supress_errors():
with pytest.raises(RuntimeError, match="expected error"):
- with testing.assert_idom_did_log():
+ with testing.assert_reactpy_did_log():
raise RuntimeError("expected error")
-def test_assert_idom_logged_message():
- with testing.assert_idom_did_log(match_message="my message"):
+def test_assert_reactpy_logged_message():
+ with testing.assert_reactpy_did_log(match_message="my message"):
ROOT_LOGGER.info("my message")
- with testing.assert_idom_did_log(match_message=r".*"):
+ with testing.assert_reactpy_did_log(match_message=r".*"):
ROOT_LOGGER.info("my message")
-def test_assert_idom_logged_error():
- with testing.assert_idom_did_log(
+def test_assert_reactpy_logged_error():
+ with testing.assert_reactpy_did_log(
match_message="log message",
error_type=ValueError,
match_error="my value error",
@@ -40,7 +40,7 @@ def test_assert_idom_logged_error():
AssertionError,
match=r"Could not find a log record matching the given",
):
- with testing.assert_idom_did_log(
+ with testing.assert_reactpy_did_log(
match_message="log message",
error_type=ValueError,
match_error="my value error",
@@ -55,7 +55,7 @@ def test_assert_idom_logged_error():
AssertionError,
match=r"Could not find a log record matching the given",
):
- with testing.assert_idom_did_log(
+ with testing.assert_reactpy_did_log(
match_message="log message",
error_type=ValueError,
match_error="my value error",
@@ -70,7 +70,7 @@ def test_assert_idom_logged_error():
AssertionError,
match=r"Could not find a log record matching the given",
):
- with testing.assert_idom_did_log(
+ with testing.assert_reactpy_did_log(
match_message="log message",
error_type=ValueError,
match_error="my value error",
@@ -82,12 +82,12 @@ def test_assert_idom_logged_error():
ROOT_LOGGER.exception("something else")
-def test_assert_idom_logged_assertion_error_message():
+def test_assert_reactpy_logged_assertion_error_message():
with pytest.raises(
AssertionError,
match=r"Could not find a log record matching the given",
):
- with testing.assert_idom_did_log(
+ with testing.assert_reactpy_did_log(
# put in all possible params full assertion error message
match_message=r".*",
error_type=Exception,
@@ -96,29 +96,29 @@ def test_assert_idom_logged_assertion_error_message():
pass
-def test_assert_idom_logged_ignores_level():
+def test_assert_reactpy_logged_ignores_level():
original_level = ROOT_LOGGER.level
ROOT_LOGGER.setLevel(logging.INFO)
try:
- with testing.assert_idom_did_log(match_message=r".*"):
+ with testing.assert_reactpy_did_log(match_message=r".*"):
# this log would normally be ignored
ROOT_LOGGER.debug("my message")
finally:
ROOT_LOGGER.setLevel(original_level)
-def test_assert_idom_did_not_log():
- with testing.assert_idom_did_not_log(match_message="my message"):
+def test_assert_reactpy_did_not_log():
+ with testing.assert_reactpy_did_not_log(match_message="my message"):
pass
- with testing.assert_idom_did_not_log(match_message=r"something else"):
+ with testing.assert_reactpy_did_not_log(match_message=r"something else"):
ROOT_LOGGER.info("my message")
with pytest.raises(
AssertionError,
match=r"Did find a log record matching the given",
):
- with testing.assert_idom_did_not_log(
+ with testing.assert_reactpy_did_not_log(
# put in all possible params full assertion error message
match_message=r".*",
error_type=Exception,
@@ -153,7 +153,7 @@ def test_if_app_is_given_implementation_must_be_too():
def test_list_logged_excptions():
the_error = None
- with testing.capture_idom_logs() as records:
+ with testing.capture_reactpy_logs() as records:
ROOT_LOGGER.info("A non-error log message")
try:
diff --git a/tests/test_utils.py b/tests/test_utils.py
index d08148662..d3bc64e04 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -2,9 +2,9 @@
import pytest
-import idom
-from idom import html
-from idom.utils import (
+import reactpy
+from reactpy import html
+from reactpy.utils import (
HTMLParseError,
del_html_head_body_transform,
html_to_vdom,
@@ -13,7 +13,7 @@
def test_basic_ref_behavior():
- r = idom.Ref(1)
+ r = reactpy.Ref(1)
assert r.current == 1
r.current = 2
@@ -22,7 +22,7 @@ def test_basic_ref_behavior():
assert r.set_current(3) == 2
assert r.current == 3
- r = idom.Ref()
+ r = reactpy.Ref()
with pytest.raises(AttributeError):
r.current
@@ -31,16 +31,16 @@ def test_basic_ref_behavior():
def test_ref_equivalence():
- assert idom.Ref([1, 2, 3]) == idom.Ref([1, 2, 3])
- assert idom.Ref([1, 2, 3]) != idom.Ref([1, 2])
- assert idom.Ref([1, 2, 3]) != [1, 2, 3]
- assert idom.Ref() != idom.Ref()
- assert idom.Ref() != idom.Ref(1)
+ assert reactpy.Ref([1, 2, 3]) == reactpy.Ref([1, 2, 3])
+ assert reactpy.Ref([1, 2, 3]) != reactpy.Ref([1, 2])
+ assert reactpy.Ref([1, 2, 3]) != [1, 2, 3]
+ assert reactpy.Ref() != reactpy.Ref()
+ assert reactpy.Ref() != reactpy.Ref(1)
def test_ref_repr():
- assert repr(idom.Ref([1, 2, 3])) == "Ref([1, 2, 3])"
- assert repr(idom.Ref()) == "Ref()"
+ assert repr(reactpy.Ref([1, 2, 3])) == "Ref([1, 2, 3])"
+ assert repr(reactpy.Ref()) == "Ref()"
@pytest.mark.parametrize(
diff --git a/tests/test_web/test_module.py b/tests/test_web/test_module.py
index 497b89787..4b0de2af1 100644
--- a/tests/test_web/test_module.py
+++ b/tests/test_web/test_module.py
@@ -3,35 +3,35 @@
import pytest
from sanic import Sanic
-import idom
-from idom.backend import sanic as sanic_implementation
-from idom.testing import (
+import reactpy
+from reactpy.backend import sanic as sanic_implementation
+from reactpy.testing import (
BackendFixture,
DisplayFixture,
- assert_idom_did_log,
- assert_idom_did_not_log,
+ assert_reactpy_did_log,
+ assert_reactpy_did_not_log,
poll,
)
-from idom.web.module import NAME_SOURCE, WebModule
+from reactpy.web.module import NAME_SOURCE, WebModule
JS_FIXTURES_DIR = Path(__file__).parent / "js_fixtures"
async def test_that_js_module_unmount_is_called(display: DisplayFixture):
- SomeComponent = idom.web.export(
- idom.web.module_from_file(
+ SomeComponent = reactpy.web.export(
+ reactpy.web.module_from_file(
"set-flag-when-unmount-is-called",
JS_FIXTURES_DIR / "set-flag-when-unmount-is-called.js",
),
"SomeComponent",
)
- set_current_component = idom.Ref(None)
+ set_current_component = reactpy.Ref(None)
- @idom.component
+ @reactpy.component
def ShowCurrentComponent():
- current_component, set_current_component.current = idom.hooks.use_state(
+ current_component, set_current_component.current = reactpy.hooks.use_state(
lambda: SomeComponent({"id": "some-component", "text": "initial component"})
)
return current_component
@@ -41,7 +41,7 @@ def ShowCurrentComponent():
await display.page.wait_for_selector("#some-component", state="attached")
set_current_component.current(
- idom.html.h1({"id": "some-other-component"}, "some other component")
+ reactpy.html.h1({"id": "some-other-component"}, "some other component")
)
# the new component has been displayed
@@ -61,12 +61,12 @@ async def test_module_from_url(browser):
content_type="text/javascript",
)
- SimpleButton = idom.web.export(
- idom.web.module_from_url("/simple-button.js", resolve_exports=False),
+ SimpleButton = reactpy.web.export(
+ reactpy.web.module_from_url("/simple-button.js", resolve_exports=False),
"SimpleButton",
)
- @idom.component
+ @reactpy.component
def ShowSimpleButton():
return SimpleButton({"id": "my-button"})
@@ -79,30 +79,30 @@ def ShowSimpleButton():
def test_module_from_template_where_template_does_not_exist():
with pytest.raises(ValueError, match="No template for 'does-not-exist.js'"):
- idom.web.module_from_template("does-not-exist", "something.js")
+ reactpy.web.module_from_template("does-not-exist", "something.js")
async def test_module_from_template(display: DisplayFixture):
- victory = idom.web.module_from_template("react@18.2.0", "victory-bar@35.4.0")
+ victory = reactpy.web.module_from_template("react@18.2.0", "victory-bar@35.4.0")
assert "react@18.2.0" in victory.file.read_text()
- VictoryBar = idom.web.export(victory, "VictoryBar")
+ VictoryBar = reactpy.web.export(victory, "VictoryBar")
await display.show(VictoryBar)
await display.page.wait_for_selector(".VictoryContainer")
async def test_module_from_file(display: DisplayFixture):
- SimpleButton = idom.web.export(
- idom.web.module_from_file(
+ SimpleButton = reactpy.web.export(
+ reactpy.web.module_from_file(
"simple-button", JS_FIXTURES_DIR / "simple-button.js"
),
"SimpleButton",
)
- is_clicked = idom.Ref(False)
+ is_clicked = reactpy.Ref(False)
- @idom.component
+ @reactpy.component
def ShowSimpleButton():
return SimpleButton(
{"id": "my-button", "onClick": lambda event: is_clicked.set_current(True)}
@@ -119,30 +119,30 @@ def test_module_from_file_source_conflict(tmp_path):
first_file = tmp_path / "first.js"
with pytest.raises(FileNotFoundError, match="does not exist"):
- idom.web.module_from_file("temp", first_file)
+ reactpy.web.module_from_file("temp", first_file)
first_file.touch()
- idom.web.module_from_file("temp", first_file)
+ reactpy.web.module_from_file("temp", first_file)
second_file = tmp_path / "second.js"
second_file.touch()
# ok, same content
- idom.web.module_from_file("temp", second_file)
+ reactpy.web.module_from_file("temp", second_file)
third_file = tmp_path / "third.js"
third_file.write_text("something-different")
- with assert_idom_did_log(r"Existing web module .* will be replaced with"):
- idom.web.module_from_file("temp", third_file)
+ with assert_reactpy_did_log(r"Existing web module .* will be replaced with"):
+ reactpy.web.module_from_file("temp", third_file)
def test_web_module_from_file_symlink(tmp_path):
file = tmp_path / "temp.js"
file.touch()
- module = idom.web.module_from_file("temp", file, symlink=True)
+ module = reactpy.web.module_from_file("temp", file, symlink=True)
assert module.file.resolve().read_text() == ""
@@ -155,44 +155,44 @@ def test_web_module_from_file_symlink_twice(tmp_path):
file_1 = tmp_path / "temp_1.js"
file_1.touch()
- idom.web.module_from_file("temp", file_1, symlink=True)
+ reactpy.web.module_from_file("temp", file_1, symlink=True)
- with assert_idom_did_not_log(r"Existing web module .* will be replaced with"):
- idom.web.module_from_file("temp", file_1, symlink=True)
+ with assert_reactpy_did_not_log(r"Existing web module .* will be replaced with"):
+ reactpy.web.module_from_file("temp", file_1, symlink=True)
file_2 = tmp_path / "temp_2.js"
file_2.write_text("something")
- with assert_idom_did_log(r"Existing web module .* will be replaced with"):
- idom.web.module_from_file("temp", file_2, symlink=True)
+ with assert_reactpy_did_log(r"Existing web module .* will be replaced with"):
+ reactpy.web.module_from_file("temp", file_2, symlink=True)
def test_web_module_from_file_replace_existing(tmp_path):
file1 = tmp_path / "temp1.js"
file1.touch()
- idom.web.module_from_file("temp", file1)
+ reactpy.web.module_from_file("temp", file1)
file2 = tmp_path / "temp2.js"
file2.write_text("something")
- with assert_idom_did_log(r"Existing web module .* will be replaced with"):
- idom.web.module_from_file("temp", file2)
+ with assert_reactpy_did_log(r"Existing web module .* will be replaced with"):
+ reactpy.web.module_from_file("temp", file2)
def test_module_missing_exports():
module = WebModule("test", NAME_SOURCE, None, {"a", "b", "c"}, None, False)
with pytest.raises(ValueError, match="does not export 'x'"):
- idom.web.export(module, "x")
+ reactpy.web.export(module, "x")
with pytest.raises(ValueError, match=r"does not export \['x', 'y'\]"):
- idom.web.export(module, ["x", "y"])
+ reactpy.web.export(module, ["x", "y"])
async def test_module_exports_multiple_components(display: DisplayFixture):
- Header1, Header2 = idom.web.export(
- idom.web.module_from_file(
+ Header1, Header2 = reactpy.web.export(
+ reactpy.web.module_from_file(
"exports-two-components", JS_FIXTURES_DIR / "exports-two-components.js"
),
["Header1", "Header2"],
@@ -208,10 +208,10 @@ async def test_module_exports_multiple_components(display: DisplayFixture):
async def test_imported_components_can_render_children(display: DisplayFixture):
- module = idom.web.module_from_file(
+ module = reactpy.web.module_from_file(
"component-can-have-child", JS_FIXTURES_DIR / "component-can-have-child.js"
)
- Parent, Child = idom.web.export(module, ["Parent", "Child"])
+ Parent, Child = reactpy.web.export(module, ["Parent", "Child"])
await display.show(
lambda: Parent(
@@ -231,6 +231,6 @@ async def test_imported_components_can_render_children(display: DisplayFixture):
def test_module_from_string():
- idom.web.module_from_string("temp", "old")
- with assert_idom_did_log(r"Existing web module .* will be replaced with"):
- idom.web.module_from_string("temp", "new")
+ reactpy.web.module_from_string("temp", "old")
+ with assert_reactpy_did_log(r"Existing web module .* will be replaced with"):
+ reactpy.web.module_from_string("temp", "new")
diff --git a/tests/test_web/test_utils.py b/tests/test_web/test_utils.py
index 29a24142c..4ed01dd83 100644
--- a/tests/test_web/test_utils.py
+++ b/tests/test_web/test_utils.py
@@ -3,8 +3,8 @@
import pytest
import responses
-from idom.testing import assert_idom_did_log
-from idom.web.utils import (
+from reactpy.testing import assert_reactpy_did_log
+from reactpy.web.utils import (
module_name_suffix,
resolve_module_exports_from_file,
resolve_module_exports_from_source,
@@ -147,7 +147,7 @@ def test_resolve_module_exports_from_source():
def test_log_on_unknown_export_type():
- with assert_idom_did_log(match_message="Unknown export type "):
+ with assert_reactpy_did_log(match_message="Unknown export type "):
assert resolve_module_exports_from_source(
"export something unknown;", exclude_default=False
) == (set(), set())
diff --git a/tests/test_widgets.py b/tests/test_widgets.py
index cd6f9b2c2..e4ac1a341 100644
--- a/tests/test_widgets.py
+++ b/tests/test_widgets.py
@@ -1,8 +1,8 @@
from base64 import b64encode
from pathlib import Path
-import idom
-from idom.testing import DisplayFixture, poll
+import reactpy
+from reactpy.testing import DisplayFixture, poll
from tests.tooling.common import DEFAULT_TYPE_DELAY
@@ -19,23 +19,23 @@
async def test_image_from_string(display: DisplayFixture):
src = IMAGE_SRC_BYTES.decode()
- await display.show(lambda: idom.widgets.image("svg", src, {"id": "a-circle-1"}))
+ await display.show(lambda: reactpy.widgets.image("svg", src, {"id": "a-circle-1"}))
client_img = await display.page.wait_for_selector("#a-circle-1")
assert BASE64_IMAGE_SRC in (await client_img.get_attribute("src"))
async def test_image_from_bytes(display: DisplayFixture):
src = IMAGE_SRC_BYTES
- await display.show(lambda: idom.widgets.image("svg", src, {"id": "a-circle-1"}))
+ await display.show(lambda: reactpy.widgets.image("svg", src, {"id": "a-circle-1"}))
client_img = await display.page.wait_for_selector("#a-circle-1")
assert BASE64_IMAGE_SRC in (await client_img.get_attribute("src"))
async def test_use_linked_inputs(display: DisplayFixture):
- @idom.component
+ @reactpy.component
def SomeComponent():
- i_1, i_2 = idom.widgets.use_linked_inputs([{"id": "i_1"}, {"id": "i_2"}])
- return idom.html.div(i_1, i_2)
+ i_1, i_2 = reactpy.widgets.use_linked_inputs([{"id": "i_1"}, {"id": "i_2"}])
+ return reactpy.html.div(i_1, i_2)
await display.show(SomeComponent)
@@ -55,15 +55,15 @@ def SomeComponent():
async def test_use_linked_inputs_on_change(display: DisplayFixture):
- value = idom.Ref(None)
+ value = reactpy.Ref(None)
- @idom.component
+ @reactpy.component
def SomeComponent():
- i_1, i_2 = idom.widgets.use_linked_inputs(
+ i_1, i_2 = reactpy.widgets.use_linked_inputs(
[{"id": "i_1"}, {"id": "i_2"}],
on_change=value.set_current,
)
- return idom.html.div(i_1, i_2)
+ return reactpy.html.div(i_1, i_2)
await display.show(SomeComponent)
@@ -83,14 +83,14 @@ def SomeComponent():
async def test_use_linked_inputs_on_change_with_cast(display: DisplayFixture):
- value = idom.Ref(None)
+ value = reactpy.Ref(None)
- @idom.component
+ @reactpy.component
def SomeComponent():
- i_1, i_2 = idom.widgets.use_linked_inputs(
+ i_1, i_2 = reactpy.widgets.use_linked_inputs(
[{"id": "i_1"}, {"id": "i_2"}], on_change=value.set_current, cast=int
)
- return idom.html.div(i_1, i_2)
+ return reactpy.html.div(i_1, i_2)
await display.show(SomeComponent)
@@ -110,16 +110,16 @@ def SomeComponent():
async def test_use_linked_inputs_ignore_empty(display: DisplayFixture):
- value = idom.Ref(None)
+ value = reactpy.Ref(None)
- @idom.component
+ @reactpy.component
def SomeComponent():
- i_1, i_2 = idom.widgets.use_linked_inputs(
+ i_1, i_2 = reactpy.widgets.use_linked_inputs(
[{"id": "i_1"}, {"id": "i_2"}],
on_change=value.set_current,
ignore_empty=True,
)
- return idom.html.div(i_1, i_2)
+ return reactpy.html.div(i_1, i_2)
await display.show(SomeComponent)
diff --git a/tests/tooling/common.py b/tests/tooling/common.py
index e0706b561..8a929edce 100644
--- a/tests/tooling/common.py
+++ b/tests/tooling/common.py
@@ -1,6 +1,6 @@
from typing import Any
-from idom.core.types import LayoutEventMessage, LayoutUpdateMessage
+from reactpy.core.types import LayoutEventMessage, LayoutUpdateMessage
# see: https://github.com/microsoft/playwright-python/issues/1614
diff --git a/tests/tooling/hooks.py b/tests/tooling/hooks.py
index 049052c71..1926a93bc 100644
--- a/tests/tooling/hooks.py
+++ b/tests/tooling/hooks.py
@@ -1,4 +1,4 @@
-from idom.core.hooks import current_hook, use_state
+from reactpy.core.hooks import current_hook, use_state
def use_force_render():
diff --git a/tests/tooling/loop.py b/tests/tooling/loop.py
index 58f7d9fe3..db6f91b83 100644
--- a/tests/tooling/loop.py
+++ b/tests/tooling/loop.py
@@ -6,7 +6,7 @@
from contextlib import contextmanager
from typing import Iterator
-from idom.config import IDOM_TESTING_DEFAULT_TIMEOUT
+from reactpy.config import REACTPY_TESTING_DEFAULT_TIMEOUT
@contextmanager
@@ -29,7 +29,7 @@ def open_event_loop(as_current: bool = True) -> Iterator[asyncio.AbstractEventLo
loop.run_until_complete(
wait_for(
loop.shutdown_asyncgens(),
- IDOM_TESTING_DEFAULT_TIMEOUT.current,
+ REACTPY_TESTING_DEFAULT_TIMEOUT.current,
)
)
if sys.version_info >= (3, 9):
@@ -37,7 +37,7 @@ def open_event_loop(as_current: bool = True) -> Iterator[asyncio.AbstractEventLo
loop.run_until_complete(
wait_for(
loop.shutdown_default_executor(),
- IDOM_TESTING_DEFAULT_TIMEOUT.current,
+ REACTPY_TESTING_DEFAULT_TIMEOUT.current,
)
)
finally:
@@ -45,10 +45,10 @@ def open_event_loop(as_current: bool = True) -> Iterator[asyncio.AbstractEventLo
asyncio.set_event_loop(None)
start = time.time()
while loop.is_running():
- if (time.time() - start) > IDOM_TESTING_DEFAULT_TIMEOUT.current:
+ if (time.time() - start) > REACTPY_TESTING_DEFAULT_TIMEOUT.current:
raise TimeoutError(
"Failed to stop loop after "
- f"{IDOM_TESTING_DEFAULT_TIMEOUT.current} seconds"
+ f"{REACTPY_TESTING_DEFAULT_TIMEOUT.current} seconds"
)
time.sleep(0.1)
loop.close()
@@ -76,7 +76,7 @@ def one_task_finished(future):
loop.run_until_complete(
wait_for(
asyncio.gather(*to_cancel, return_exceptions=True),
- IDOM_TESTING_DEFAULT_TIMEOUT.current,
+ REACTPY_TESTING_DEFAULT_TIMEOUT.current,
)
)
else: