From 8801c93f1d484ac8116ea1300b377b8e14c6eb98 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Tue, 6 Jun 2023 12:31:13 +0800 Subject: [PATCH 1/4] Fix typos Found via: - `codespell -S package-lock.json -L inflight,ue,falsy` - `typos --format brief` --- docs/README.md | 2 +- docs/source/_custom_js/src/index.js | 2 +- docs/source/about/changelog.rst | 4 ++-- .../_examples/adding_state_variable/data.json | 2 +- .../_examples/isolated_state/data.json | 2 +- .../multiple_state_variables/data.json | 2 +- .../when_variables_are_not_enough/data.json | 2 +- .../dangers-of-mutability/index.rst | 4 ++-- .../guides/adding-interactivity/index.rst | 4 ++-- .../multiple-state-updates/index.rst | 4 ++-- .../_examples/stop_event_propagation.py | 2 +- .../responding-to-events/index.rst | 4 ++-- .../state-as-a-snapshot/index.rst | 6 +++--- .../html-with-reactpy/index.rst | 2 +- .../distributing-javascript.rst | 2 +- .../_examples/debug_error_example.py | 2 +- .../representing-html.rst | 2 +- .../reference/_static/vdom-json-schema.json | 2 +- docs/source/reference/html-attributes.rst | 2 +- pyproject.toml | 2 +- .../tests/event-to-object.test.ts | 2 +- src/py/reactpy/reactpy/_console/ast_utils.py | 2 +- .../reactpy/reactpy/_console/rewrite_keys.py | 2 +- src/py/reactpy/reactpy/backend/flask.py | 2 +- src/py/reactpy/reactpy/config.py | 4 ++-- src/py/reactpy/reactpy/core/events.py | 4 ++-- src/py/reactpy/reactpy/core/hooks.py | 8 ++++---- src/py/reactpy/reactpy/core/layout.py | 2 +- src/py/reactpy/reactpy/core/types.py | 2 +- src/py/reactpy/reactpy/core/vdom.py | 6 +++--- src/py/reactpy/reactpy/html.py | 4 ++-- src/py/reactpy/reactpy/testing/backend.py | 2 +- src/py/reactpy/reactpy/utils.py | 2 +- src/py/reactpy/reactpy/web/module.py | 20 +++++++++---------- src/py/reactpy/tests/conftest.py | 2 +- src/py/reactpy/tests/test_backend/test_all.py | 2 +- src/py/reactpy/tests/test_client.py | 2 +- .../reactpy/tests/test_core/test_component.py | 8 ++++---- src/py/reactpy/tests/test_core/test_events.py | 2 +- src/py/reactpy/tests/test_core/test_hooks.py | 2 +- src/py/reactpy/tests/test_core/test_layout.py | 8 ++++---- src/py/reactpy/tests/test_core/test_serve.py | 2 +- src/py/reactpy/tests/test_core/test_vdom.py | 4 ++-- src/py/reactpy/tests/test_testing.py | 2 +- src/py/reactpy/tests/tooling/common.py | 2 +- tasks.py | 2 +- 46 files changed, 77 insertions(+), 77 deletions(-) diff --git a/docs/README.md b/docs/README.md index 156fe4ea1..1360bc825 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,7 +3,7 @@ We provide two main ways to run the docs. Both use [`nox`](https://pypi.org/project/nox/): -- `nox -s docs` - displayes the docs and rebuilds when files are modified. +- `nox -s docs` - displays 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), diff --git a/docs/source/_custom_js/src/index.js b/docs/source/_custom_js/src/index.js index da04d98c7..505adedd0 100644 --- a/docs/source/_custom_js/src/index.js +++ b/docs/source/_custom_js/src/index.js @@ -86,7 +86,7 @@ function triggerIfInViewport(element, callback) { }, { root: null, - threshold: 0.1, // set offset 0.1 means trigger if atleast 10% of element in viewport + threshold: 0.1, // set offset 0.1 means trigger if at least 10% of element in viewport }, ); diff --git a/docs/source/about/changelog.rst b/docs/source/about/changelog.rst index 3268f3739..f739ce980 100644 --- a/docs/source/about/changelog.rst +++ b/docs/source/about/changelog.rst @@ -62,7 +62,7 @@ v1.0.0-a4 **Deprecated** -- :pull:`919` - Declaration of keys via keywork arguments in standard elements. A script +- :pull:`919` - Declaration of keys via keyword arguments in standard elements. A script has been added to automatically convert old usages where possible. @@ -590,7 +590,7 @@ v0.35.2 This release includes several bug fixes. The most significant of which is the ability to change the type of an element in the try (i.e. to and from being a component) without getting an error. Originally the errors were introduced because it was though changing -element type would not be desireable. This was not the case though - swapping types +element type would not be desirable. This was not the case though - swapping types turns out to be quite common and useful. **Closed Issues** diff --git a/docs/source/guides/adding-interactivity/components-with-state/_examples/adding_state_variable/data.json b/docs/source/guides/adding-interactivity/components-with-state/_examples/adding_state_variable/data.json index b2a2ba966..b1315912d 100644 --- a/docs/source/guides/adding-interactivity/components-with-state/_examples/adding_state_variable/data.json +++ b/docs/source/guides/adding-interactivity/components-with-state/_examples/adding_state_variable/data.json @@ -44,7 +44,7 @@ { "name": "Terracotta Army", "artist": "Unknown Artist", - "description": "The Terracotta Army is a collection of terracotta sculptures depicting the armies of Qin Shi Huang, the first Emperor of China. The army consited of more than 8,000 soldiers, 130 chariots with 520 horses, and 150 cavalry horses.", + "description": "The Terracotta Army is a collection of terracotta sculptures depicting the armies of Qin Shi Huang, the first Emperor of China. The army consisted of more than 8,000 soldiers, 130 chariots with 520 horses, and 150 cavalry horses.", "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/2015-09-22-081415_-_Terrakotta-Armee%2C_Grosse_Halle.jpg/1920px-2015-09-22-081415_-_Terrakotta-Armee%2C_Grosse_Halle.jpg", "alt": "12 terracotta sculptures of solemn warriors, each with a unique facial expression and armor." }, diff --git a/docs/source/guides/adding-interactivity/components-with-state/_examples/isolated_state/data.json b/docs/source/guides/adding-interactivity/components-with-state/_examples/isolated_state/data.json index b2a2ba966..b1315912d 100644 --- a/docs/source/guides/adding-interactivity/components-with-state/_examples/isolated_state/data.json +++ b/docs/source/guides/adding-interactivity/components-with-state/_examples/isolated_state/data.json @@ -44,7 +44,7 @@ { "name": "Terracotta Army", "artist": "Unknown Artist", - "description": "The Terracotta Army is a collection of terracotta sculptures depicting the armies of Qin Shi Huang, the first Emperor of China. The army consited of more than 8,000 soldiers, 130 chariots with 520 horses, and 150 cavalry horses.", + "description": "The Terracotta Army is a collection of terracotta sculptures depicting the armies of Qin Shi Huang, the first Emperor of China. The army consisted of more than 8,000 soldiers, 130 chariots with 520 horses, and 150 cavalry horses.", "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/2015-09-22-081415_-_Terrakotta-Armee%2C_Grosse_Halle.jpg/1920px-2015-09-22-081415_-_Terrakotta-Armee%2C_Grosse_Halle.jpg", "alt": "12 terracotta sculptures of solemn warriors, each with a unique facial expression and armor." }, diff --git a/docs/source/guides/adding-interactivity/components-with-state/_examples/multiple_state_variables/data.json b/docs/source/guides/adding-interactivity/components-with-state/_examples/multiple_state_variables/data.json index b2a2ba966..b1315912d 100644 --- a/docs/source/guides/adding-interactivity/components-with-state/_examples/multiple_state_variables/data.json +++ b/docs/source/guides/adding-interactivity/components-with-state/_examples/multiple_state_variables/data.json @@ -44,7 +44,7 @@ { "name": "Terracotta Army", "artist": "Unknown Artist", - "description": "The Terracotta Army is a collection of terracotta sculptures depicting the armies of Qin Shi Huang, the first Emperor of China. The army consited of more than 8,000 soldiers, 130 chariots with 520 horses, and 150 cavalry horses.", + "description": "The Terracotta Army is a collection of terracotta sculptures depicting the armies of Qin Shi Huang, the first Emperor of China. The army consisted of more than 8,000 soldiers, 130 chariots with 520 horses, and 150 cavalry horses.", "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/2015-09-22-081415_-_Terrakotta-Armee%2C_Grosse_Halle.jpg/1920px-2015-09-22-081415_-_Terrakotta-Armee%2C_Grosse_Halle.jpg", "alt": "12 terracotta sculptures of solemn warriors, each with a unique facial expression and armor." }, diff --git a/docs/source/guides/adding-interactivity/components-with-state/_examples/when_variables_are_not_enough/data.json b/docs/source/guides/adding-interactivity/components-with-state/_examples/when_variables_are_not_enough/data.json index b2a2ba966..b1315912d 100644 --- a/docs/source/guides/adding-interactivity/components-with-state/_examples/when_variables_are_not_enough/data.json +++ b/docs/source/guides/adding-interactivity/components-with-state/_examples/when_variables_are_not_enough/data.json @@ -44,7 +44,7 @@ { "name": "Terracotta Army", "artist": "Unknown Artist", - "description": "The Terracotta Army is a collection of terracotta sculptures depicting the armies of Qin Shi Huang, the first Emperor of China. The army consited of more than 8,000 soldiers, 130 chariots with 520 horses, and 150 cavalry horses.", + "description": "The Terracotta Army is a collection of terracotta sculptures depicting the armies of Qin Shi Huang, the first Emperor of China. The army consisted of more than 8,000 soldiers, 130 chariots with 520 horses, and 150 cavalry horses.", "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/2015-09-22-081415_-_Terrakotta-Armee%2C_Grosse_Halle.jpg/1920px-2015-09-22-081415_-_Terrakotta-Armee%2C_Grosse_Halle.jpg", "alt": "12 terracotta sculptures of solemn warriors, each with a unique facial expression and armor." }, 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 35dfe580a..fcf817ff4 100644 --- a/docs/source/guides/adding-interactivity/dangers-of-mutability/index.rst +++ b/docs/source/guides/adding-interactivity/dangers-of-mutability/index.rst @@ -531,7 +531,7 @@ Removing Set Items s.difference_update(values) s -= values # "in-place" operators mutate! - s.symetric_difference_update(values) + s.symmetric_difference_update(values) s ^= values # "in-place" operators mutate! s.intersection_update(values) @@ -547,7 +547,7 @@ Removing Set Items s.difference(values) s - values - s.symetric_difference(values) + s.symmetric_difference(values) s ^ values s.intersection(values) diff --git a/docs/source/guides/adding-interactivity/index.rst b/docs/source/guides/adding-interactivity/index.rst index 5f08bc5e4..b2beb3a81 100644 --- a/docs/source/guides/adding-interactivity/index.rst +++ b/docs/source/guides/adding-interactivity/index.rst @@ -111,7 +111,7 @@ Section 3: State as a Snapshot ------------------------------ As we :ref:`learned earlier `, state setters behave a little -differently than you might exepct at first glance. Instead of updating your current +differently than you might expect at first glance. Instead of updating your current handle on the setter's corresponding variable, it schedules a re-render of the component which owns the state. @@ -133,7 +133,7 @@ actually sent? .. 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 +where the message ultimately goes. However, one could imagine a bug where the recipient of a message is determined at the time the message is sent rather than at the time the "Send" button it clicked. Thus changing the recipient after pressing send would change where the message got sent. 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 6cfc415cd..bc3245d7e 100644 --- a/docs/source/guides/adding-interactivity/multiple-state-updates/index.rst +++ b/docs/source/guides/adding-interactivity/multiple-state-updates/index.rst @@ -10,7 +10,7 @@ Batched Updates --------------- As we learned :ref:`previously `, state variables remain fixed -inside each render as if state were a snapshot taken at the begining of each render. +inside each render as if state were a snapshot taken at the beginning of each render. 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``: @@ -22,7 +22,7 @@ the event handler is not an ``async`` function), ReactPy waits until all the cod 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: +the color does not quickly flash orange and pink before blue - it always remains blue: .. reactpy:: _examples/set_color_3_times 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 15e345bdd..41c575042 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 @@ -30,7 +30,7 @@ def DivInDiv(): return html.div( html.button( {"on_click": lambda event: set_stop_propagatation(not stop_propagatation)}, - "Toggle Propogation", + "Toggle Propagation", ), html.pre(f"Will propagate: {not stop_propagatation}"), html.pre(f"Inner click count: {inner_count}"), 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 26f1c49e4..583a4a4b7 100644 --- a/docs/source/guides/adding-interactivity/responding-to-events/index.rst +++ b/docs/source/guides/adding-interactivity/responding-to-events/index.rst @@ -131,13 +131,13 @@ Unfortunately this means you cannot conditionally prevent default behavior in re to event data without writing :ref:`Custom Javascript Components`. -Stop Event Propogation +Stop Event Propagation ...................... Similarly to :ref:`preventing default behavior `, you 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 +the example below we place a red ``div`` inside a parent blue ``div``. When propagation 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. 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 a7ede86ca..a677a3e68 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 @@ -17,7 +17,7 @@ version of the view rather then mutating the existing one. 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 +using what state was present at the time of that render. Then, when user interactions 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. @@ -70,7 +70,7 @@ Even though, we called ``set_count`` three times with what might have seemed lik different values, every time we were actually just doing ``set_count(1)`` on each call. 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 +same substitution as before to see what the next number will be after we click "Increment": .. code-block:: @@ -89,7 +89,7 @@ to reason about what should happen in the example below. What will be printed wh .. reactpy:: _examples/print_count_after_set -If we use the same subtitution trick we saw before, we can rewrite these lines: +If we use the same substitution trick we saw before, we can rewrite these lines: .. code-block:: diff --git a/docs/source/guides/creating-interfaces/html-with-reactpy/index.rst b/docs/source/guides/creating-interfaces/html-with-reactpy/index.rst index 99a973d94..df709148a 100644 --- a/docs/source/guides/creating-interfaces/html-with-reactpy/index.rst +++ b/docs/source/guides/creating-interfaces/html-with-reactpy/index.rst @@ -99,7 +99,7 @@ In ReactPy we add these attributes to elements using a dictionary: .. raw:: html - + `, 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 ReactPy: diff --git a/docs/source/reference/_static/vdom-json-schema.json b/docs/source/reference/_static/vdom-json-schema.json index 2281657e3..b1005d2ed 100644 --- a/docs/source/reference/_static/vdom-json-schema.json +++ b/docs/source/reference/_static/vdom-json-schema.json @@ -61,7 +61,7 @@ }, "type": ["object", "string"] }, - "eventHander": { + "eventHandler": { "properties": { "preventDefault": { "type": "boolean" diff --git a/docs/source/reference/html-attributes.rst b/docs/source/reference/html-attributes.rst index 25530b033..967f2dfe2 100644 --- a/docs/source/reference/html-attributes.rst +++ b/docs/source/reference/html-attributes.rst @@ -11,7 +11,7 @@ words. For example, ``tabindex`` and ``margin-left`` become ``tab_index`` and ``margin_left`` respectively. -Noteable Attributes +Notable Attributes ------------------- Some attributes in ReactPy are renamed, have special meaning, or are used differently diff --git a/pyproject.toml b/pyproject.toml index c2845ea6f..38e3acf48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ [project] name = "scripts" version = "0.0.0" -description = "Scripts for managing the ReactPy respository" +description = "Scripts for managing the ReactPy repository" # --- Hatch ---------------------------------------------------------------------------- diff --git a/src/js/packages/event-to-object/tests/event-to-object.test.ts b/src/js/packages/event-to-object/tests/event-to-object.test.ts index bad3c28aa..b7b8c68af 100644 --- a/src/js/packages/event-to-object/tests/event-to-object.test.ts +++ b/src/js/packages/event-to-object/tests/event-to-object.test.ts @@ -57,7 +57,7 @@ const simpleTestCases: SimpleTestCase[] = [ }, { types: ["copy", "cut", "paste"], - description: "clipboad event", + description: "clipboard event", givenEventType: window.ClipboardEvent, expectedConversion: { clipboardData: null }, }, diff --git a/src/py/reactpy/reactpy/_console/ast_utils.py b/src/py/reactpy/reactpy/_console/ast_utils.py index 180cb0e4b..220751119 100644 --- a/src/py/reactpy/reactpy/_console/ast_utils.py +++ b/src/py/reactpy/reactpy/_console/ast_utils.py @@ -41,7 +41,7 @@ def rewrite_changed_nodes( msg = "Failed to change code" raise RuntimeError(msg) - # check if an nodes to rewrite contain eachother, pick outermost nodes + # check if an nodes to rewrite contain each other, pick outermost nodes current_outermost_node, *sorted_nodes_to_unparse = sorted( nodes_to_unparse, key=lambda n: n.lineno ) diff --git a/src/py/reactpy/reactpy/_console/rewrite_keys.py b/src/py/reactpy/reactpy/_console/rewrite_keys.py index cbd90351a..64ed42f33 100644 --- a/src/py/reactpy/reactpy/_console/rewrite_keys.py +++ b/src/py/reactpy/reactpy/_console/rewrite_keys.py @@ -40,7 +40,7 @@ def rewrite_keys(paths: list[str]) -> None: recommend running your code formatter like Black against your code after executing this command. - Additionally, We are unable to perserve the location of comments that lie within any + Additionally, We are unable to preserve the location of comments that lie within any rewritten code. This command will place the comments in the code it plans to rewrite just above its changes. As such it requires manual intervention to put those comments back in their original location. diff --git a/src/py/reactpy/reactpy/backend/flask.py b/src/py/reactpy/reactpy/backend/flask.py index e28ed7652..46aed3c46 100644 --- a/src/py/reactpy/reactpy/backend/flask.py +++ b/src/py/reactpy/reactpy/backend/flask.py @@ -106,7 +106,7 @@ def run_server() -> None: try: await stopped.wait() finally: - # we may have exitted because this task was cancelled + # we may have exited because this task was cancelled server.current.shutdown() # the thread should eventually join thread.join(timeout=3) diff --git a/src/py/reactpy/reactpy/config.py b/src/py/reactpy/reactpy/config.py index ace93b6d2..6dc29096c 100644 --- a/src/py/reactpy/reactpy/config.py +++ b/src/py/reactpy/reactpy/config.py @@ -1,6 +1,6 @@ """ ReactPy provides a series of configuration options that can be set using environment -variables or, for those which allow it, a programatic interface. +variables or, for those which allow it, a programmatic interface. """ from pathlib import Path @@ -49,7 +49,7 @@ This directory **MUST** be treated as a black box. Downstream applications **MUST NOT** 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. +set of publicly available APIs for working with the client. """ REACTPY_TESTING_DEFAULT_TIMEOUT = _Option( diff --git a/src/py/reactpy/reactpy/core/events.py b/src/py/reactpy/reactpy/core/events.py index 51fe8d0d3..acc2077b2 100644 --- a/src/py/reactpy/reactpy/core/events.py +++ b/src/py/reactpy/reactpy/core/events.py @@ -44,7 +44,7 @@ def event( 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 + from taking place, or stopping the event from propagating up the DOM. This decorator allows you to add that functionality to your callbacks. .. code-block:: python @@ -191,7 +191,7 @@ def merge_event_handlers( or handler.prevent_default != prevent_default or handler.target != target ): - msg = "Cannot merge handlers - 'stop_propagation', 'prevent_default' or 'target' mistmatch." + msg = "Cannot merge handlers - 'stop_propagation', 'prevent_default' or 'target' mismatch." raise ValueError(msg) return EventHandler( diff --git a/src/py/reactpy/reactpy/core/hooks.py b/src/py/reactpy/reactpy/core/hooks.py index 9b025c0ca..a8334458b 100644 --- a/src/py/reactpy/reactpy/core/hooks.py +++ b/src/py/reactpy/reactpy/core/hooks.py @@ -341,7 +341,7 @@ def use_callback( function: The function whose identity will be preserved dependencies: - Dependencies of the callback. The identity the ``function`` will be udpated + Dependencies of the callback. The identity the ``function`` will be updated if the identity of any value in the given sequence changes (i.e. their :func:`id` is different). By default these are inferred based on local variables that are referenced by the given function. @@ -573,7 +573,7 @@ class LifeCycleHook: # given render have been completed. hook.affect_layout_did_render() - # Typically an event occurs and a new render is scheduled, thus begining + # Typically an event occurs and a new render is scheduled, thus beginning # the render cycle anew. hook.schedule_render() @@ -626,7 +626,7 @@ def schedule_render(self) -> None: def use_state(self, function: Callable[[], _Type]) -> _Type: if not self._rendered_atleast_once: - # since we're not intialized yet we're just appending state + # since we're not initialized yet we're just appending state result = function() self._state += (result,) else: @@ -636,7 +636,7 @@ def use_state(self, function: Callable[[], _Type]) -> _Type: return result def add_effect(self, effect_type: EffectType, function: Callable[[], None]) -> None: - """Trigger a function on the occurance of the given effect type""" + """Trigger a function on the occurrence of the given effect type""" self._event_effects[effect_type].append(function) def set_context_provider(self, provider: ContextProvider[Any]) -> None: diff --git a/src/py/reactpy/reactpy/core/layout.py b/src/py/reactpy/reactpy/core/layout.py index 368e79c7d..7c24e5ef7 100644 --- a/src/py/reactpy/reactpy/core/layout.py +++ b/src/py/reactpy/reactpy/core/layout.py @@ -568,7 +568,7 @@ def __init__( """The actual model of the element""" self.patch_path = patch_path - """A "/" delimitted path to the element within the greater layout""" + """A "/" delimited path to the element within the greater layout""" self.children_by_key = children_by_key """Child model states indexed by their unique keys""" diff --git a/src/py/reactpy/reactpy/core/types.py b/src/py/reactpy/reactpy/core/types.py index 93f4fe36b..45f300f4f 100644 --- a/src/py/reactpy/reactpy/core/types.py +++ b/src/py/reactpy/reactpy/core/types.py @@ -187,7 +187,7 @@ class EventHandlerType(Protocol): """Typically left as ``None`` except when a static target is useful. When testing, it may be useful to specify a static target ID so events can be - triggered programatically. + triggered programmatically. .. note:: diff --git a/src/py/reactpy/reactpy/core/vdom.py b/src/py/reactpy/reactpy/core/vdom.py index c716fe347..0548c6afc 100644 --- a/src/py/reactpy/reactpy/core/vdom.py +++ b/src/py/reactpy/reactpy/core/vdom.py @@ -58,10 +58,10 @@ "elementEventHandlers": { "type": "object", "patternProperties": { - ".*": {"$ref": "#/definitions/eventHander"}, + ".*": {"$ref": "#/definitions/eventHandler"}, }, }, - "eventHander": { + "eventHandler": { "type": "object", "properties": { "target": {"type": "string"}, @@ -152,7 +152,7 @@ def vdom( iterables of children. The attribute mapping **must** precede the children, or children which will be merged into their respective parts of the model. key: - A string idicating the identity of a particular element. This is significant + A string indicating the identity of a particular element. This is significant to preserve event handlers across updates - without a key, a re-render would cause these handlers to be deleted, but with a key, they would be redirected to any newly defined handlers. diff --git a/src/py/reactpy/reactpy/html.py b/src/py/reactpy/reactpy/html.py index 0387b3135..22d318639 100644 --- a/src/py/reactpy/reactpy/html.py +++ b/src/py/reactpy/reactpy/html.py @@ -4,7 +4,7 @@ - :func:`_` -**Dcument metadata** +**Document metadata** - :func:`base` - :func:`head` @@ -309,7 +309,7 @@ def _fragment( _ = custom_vdom_constructor(_fragment) -# Dcument metadata +# Document metadata base = make_vdom_constructor("base") head = make_vdom_constructor("head") link = make_vdom_constructor("link") diff --git a/src/py/reactpy/reactpy/testing/backend.py b/src/py/reactpy/reactpy/testing/backend.py index 8e4042284..549e16056 100644 --- a/src/py/reactpy/reactpy/testing/backend.py +++ b/src/py/reactpy/reactpy/testing/backend.py @@ -167,7 +167,7 @@ def _hotswap(update_on_change: bool = False) -> tuple[_MountFunc, ComponentConst long as you set things up ahead of time. Parameters: - update_on_change: Whether or not all views of the layout should be udpated on a swap. + update_on_change: Whether or not all views of the layout should be updated on a swap. Example: .. code-block:: python diff --git a/src/py/reactpy/reactpy/utils.py b/src/py/reactpy/reactpy/utils.py index fead642f2..e5e06d98d 100644 --- a/src/py/reactpy/reactpy/utils.py +++ b/src/py/reactpy/reactpy/utils.py @@ -232,7 +232,7 @@ def _generate_vdom_children( ) -> list[VdomDict | str]: """Generates a list of VDOM children from an lxml node. - Inserts inner text and/or tail text inbetween VDOM children, if necessary. + Inserts inner text and/or tail text in between VDOM children, if necessary. """ return ( # Get the inner text of the current node [node.text] if node.text else [] diff --git a/src/py/reactpy/reactpy/web/module.py b/src/py/reactpy/reactpy/web/module.py index 5e615a981..48322fe24 100644 --- a/src/py/reactpy/reactpy/web/module.py +++ b/src/py/reactpy/reactpy/web/module.py @@ -24,7 +24,7 @@ SourceType = NewType("SourceType", str) NAME_SOURCE = SourceType("NAME") -"""A named souce - usually a Javascript package name""" +"""A named source - usually a Javascript package name""" URL_SOURCE = SourceType("URL") """A source loaded from a URL, usually a CDN""" @@ -44,14 +44,14 @@ def module_from_url( Where the javascript module will be loaded from which conforms to the interface for :ref:`Custom Javascript Components` fallback: - What to temporarilly display while the module is being loaded. + What to temporarily display while the module is being loaded. resolve_imports: Whether to try and find all the named exports of this module. resolve_exports_depth: How deeply to search for those exports. unmount_before_update: Cause the component to be unmounted before each update. This option should - only be used if the imported package failes to re-render when props change. + only be used if the imported package fails to re-render when props change. Using this option has negative performance consequences since all DOM elements must be changed on each render. See :issue:`461` for more info. """ @@ -110,14 +110,14 @@ def module_from_template( cdn: Where the package should be loaded from. The CDN must distribute ESM modules fallback: - What to temporarilly display while the module is being loaded. + What to temporarily display while the module is being loaded. resolve_imports: Whether to try and find all the named exports of this module. resolve_exports_depth: How deeply to search for those exports. unmount_before_update: Cause the component to be unmounted before each update. This option should - only be used if the imported package failes to re-render when props change. + only be used if the imported package fails to re-render when props change. Using this option has negative performance consequences since all DOM elements must be changed on each render. See :issue:`461` for more info. """ @@ -174,14 +174,14 @@ def module_from_file( file: The file from which the content of the web module will be created. fallback: - What to temporarilly display while the module is being loaded. + What to temporarily display while the module is being loaded. resolve_imports: Whether to try and find all the named exports of this module. resolve_exports_depth: How deeply to search for those exports. unmount_before_update: Cause the component to be unmounted before each update. This option should - only be used if the imported package failes to re-render when props change. + only be used if the imported package fails to re-render when props change. Using this option has negative performance consequences since all DOM elements must be changed on each render. See :issue:`461` for more info. symlink: @@ -255,14 +255,14 @@ def module_from_string( content: The contents of the web module fallback: - What to temporarilly display while the module is being loaded. + What to temporarily display while the module is being loaded. resolve_imports: Whether to try and find all the named exports of this module. resolve_exports_depth: How deeply to search for those exports. unmount_before_update: Cause the component to be unmounted before each update. This option should - only be used if the imported package failes to re-render when props change. + only be used if the imported package fails to re-render when props change. Using this option has negative performance consequences since all DOM elements must be changed on each render. See :issue:`461` for more info. """ @@ -342,7 +342,7 @@ def export( will be returned. If a list is given, then a list of components will be returned. fallback: - What to temporarilly display while the module is being loaded. + What to temporarily display while the module is being loaded. allow_children: Whether or not these components can have children. """ diff --git a/src/py/reactpy/tests/conftest.py b/src/py/reactpy/tests/conftest.py index 1a1f02098..21b23c12e 100644 --- a/src/py/reactpy/tests/conftest.py +++ b/src/py/reactpy/tests/conftest.py @@ -23,7 +23,7 @@ def pytest_addoption(parser: Parser) -> None: "--headed", dest="headed", action="store_true", - help="Open a browser window when runnging web-based tests", + help="Open a browser window when running web-based tests", ) diff --git a/src/py/reactpy/tests/test_backend/test_all.py b/src/py/reactpy/tests/test_backend/test_all.py index 796f096db..11b9693a2 100644 --- a/src/py/reactpy/tests/test_backend/test_all.py +++ b/src/py/reactpy/tests/test_backend/test_all.py @@ -45,7 +45,7 @@ def Hello(): await display.page.wait_for_selector("#hello") - # test that we can reconnect succefully + # test that we can reconnect successfully await display.page.reload() await display.page.wait_for_selector("#hello") diff --git a/src/py/reactpy/tests/test_client.py b/src/py/reactpy/tests/test_client.py index 5a51f8b16..3c7250e48 100644 --- a/src/py/reactpy/tests/test_client.py +++ b/src/py/reactpy/tests/test_client.py @@ -54,7 +54,7 @@ def SomeComponent(): DisplayFixture(server, driver=page) ) - # use mount instead of show to avoid a page refesh + # use mount instead of show to avoid a page refresh display.backend.mount(SomeComponent) async def get_count(): diff --git a/src/py/reactpy/tests/test_core/test_component.py b/src/py/reactpy/tests/test_core/test_component.py index 6f40c960c..f8d430ed2 100644 --- a/src/py/reactpy/tests/test_core/test_component.py +++ b/src/py/reactpy/tests/test_core/test_component.py @@ -56,18 +56,18 @@ def Hello(): async def test_pre_tags_are_rendered_correctly(display: DisplayFixture): @reactpy.component - def PreFormated(): + def PreFormatted(): return reactpy.html.pre( {"id": "pre-form-test"}, reactpy.html.span("this", reactpy.html.span("is"), "some"), - "pre-formated", + "pre-Formatted", " text", ) - await display.show(PreFormated) + await display.show(PreFormatted) pre = await display.page.wait_for_selector("#pre-form-test") assert ( await pre.evaluate("node => node.innerHTML") - ) == "thisissomepre-formated text" + ) == "thisissomepre-Formatted text" diff --git a/src/py/reactpy/tests/test_core/test_events.py b/src/py/reactpy/tests/test_core/test_events.py index 67c7c2ba9..ddaaee9b7 100644 --- a/src/py/reactpy/tests/test_core/test_events.py +++ b/src/py/reactpy/tests/test_core/test_events.py @@ -183,7 +183,7 @@ async def on_click(event): await display.page.wait_for_selector("#complete") -async def test_can_stop_event_propogation(display: DisplayFixture): +async def test_can_stop_event_Propagation(display: DisplayFixture): clicked = reactpy.Ref(False) @reactpy.component diff --git a/src/py/reactpy/tests/test_core/test_hooks.py b/src/py/reactpy/tests/test_core/test_hooks.py index ce9afdc12..453d07c99 100644 --- a/src/py/reactpy/tests/test_core/test_hooks.py +++ b/src/py/reactpy/tests/test_core/test_hooks.py @@ -547,7 +547,7 @@ async def effect(): # So I know we said the event never occurs but... to ensure the effect's future is # cancelled before the test is cleaned up we need to set the event. This is because - # the cancellation doesn't propogate before the test is resolved which causes + # the cancellation doesn't propagate before the test is resolved which causes # delayed log messages that impact other tests. event_that_never_occurs.set() diff --git a/src/py/reactpy/tests/test_core/test_layout.py b/src/py/reactpy/tests/test_core/test_layout.py index 4aa31fe73..3e9a40176 100644 --- a/src/py/reactpy/tests/test_core/test_layout.py +++ b/src/py/reactpy/tests/test_core/test_layout.py @@ -414,7 +414,7 @@ def Inner(): # For some reason, holding `set_inner_component` outside the render context causes # the associated hook to not be automatically garbage collected. After some - # imperical investigation, it seems that if we do not hold `set_inner_component` in + # empirical investigation, it seems that if we do not hold `set_inner_component` in # this way, the call to `gc.collect()` isn't required. This is demonstrated in # `test_root_component_life_cycle_hook_is_garbage_collected` gc.collect() @@ -1173,8 +1173,8 @@ def Child(): await layout.render() # If the context provider does not render its children then internally tracked - # state for the removed child component might not be cleaned up propperly. This - # occured in the past when the context provider implemented a should_render() + # state for the removed child component might not be cleaned up properly. This + # occurred in the past when the context provider implemented a should_render() # method that returned False (and thus did not render its children) when the # context value did not change. toggle_remove_child() @@ -1184,7 +1184,7 @@ def Child(): # correctly, scheduling a render for it might cause an error. schedule_removed_child_render() - # If things were cleaned up propperly, the above scheduled render should not + # If things were cleaned up properly, the above scheduled render should not # actually take place. Thus we expect the timeout to occur. render_task = asyncio.create_task(layout.render()) done, pending = await asyncio.wait([render_task], timeout=0.1) diff --git a/src/py/reactpy/tests/test_core/test_serve.py b/src/py/reactpy/tests/test_core/test_serve.py index 4d39f3e3d..64be0ec8b 100644 --- a/src/py/reactpy/tests/test_core/test_serve.py +++ b/src/py/reactpy/tests/test_core/test_serve.py @@ -18,7 +18,7 @@ def make_send_recv_callbacks(events_to_inject): changes = [] - # We need a semaphor here to simulate recieving an event after each update is sent. + # We need a semaphore here to simulate receiving an event after each update is sent. # The effect is that the send() and recv() callbacks trade off control. If we did # not do this, it would easy to determine when to halt because, while we might have # received all the events, they might not have been sent since the two callbacks are diff --git a/src/py/reactpy/tests/test_core/test_vdom.py b/src/py/reactpy/tests/test_core/test_vdom.py index 2aac75bb4..76e26e46f 100644 --- a/src/py/reactpy/tests/test_core/test_vdom.py +++ b/src/py/reactpy/tests/test_core/test_vdom.py @@ -136,7 +136,7 @@ def test_make_vdom_constructor(): "eventHandler": { "target": "something", "preventDefault": False, - "stopPropogation": True, + "stopPropagation": True, }, }, { @@ -165,7 +165,7 @@ def test_make_vdom_constructor(): "eventHandler": { "target": "something", "preventDefault": False, - "stopPropogation": True, + "stopPropagation": True, }, "importSource": { "source": "something", diff --git a/src/py/reactpy/tests/test_testing.py b/src/py/reactpy/tests/test_testing.py index 760e68af3..68e36e7f6 100644 --- a/src/py/reactpy/tests/test_testing.py +++ b/src/py/reactpy/tests/test_testing.py @@ -11,7 +11,7 @@ from reactpy.testing.display import DisplayFixture -def test_assert_reactpy_logged_does_not_supress_errors(): +def test_assert_reactpy_logged_does_not_suppress_errors(): with pytest.raises(RuntimeError, match="expected error"): with testing.assert_reactpy_did_log(): msg = "expected error" diff --git a/src/py/reactpy/tests/tooling/common.py b/src/py/reactpy/tests/tooling/common.py index b84a3ac96..c0191bd4e 100644 --- a/src/py/reactpy/tests/tooling/common.py +++ b/src/py/reactpy/tests/tooling/common.py @@ -3,7 +3,7 @@ from reactpy.core.types import LayoutEventMessage, LayoutUpdateMessage # see: https://github.com/microsoft/playwright-python/issues/1614 -DEFAULT_TYPE_DELAY = 100 # miliseconds +DEFAULT_TYPE_DELAY = 100 # milliseconds def event_message(target: str, *data: Any) -> LayoutEventMessage: diff --git a/tasks.py b/tasks.py index 0a0097c78..a0cee5f9e 100644 --- a/tasks.py +++ b/tasks.py @@ -315,7 +315,7 @@ def get_current_tags(context: Context) -> set[str]: context.run("git diff --cached --exit-code", hide=True) context.run("git diff --exit-code", hide=True) except Exception: - log.error("Cannot create a tag - there are uncommited changes") + log.error("Cannot create a tag - there are uncommitted changes") return set() tags_per_commit: dict[str, list[str]] = {} From 4bdd43dc723b3d79e08f667e98c104de69d24b3a Mon Sep 17 00:00:00 2001 From: Ryan Morshead Date: Mon, 5 Jun 2023 22:15:58 -0700 Subject: [PATCH 2/4] fix capitalization --- src/py/reactpy/tests/test_core/test_component.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/reactpy/tests/test_core/test_component.py b/src/py/reactpy/tests/test_core/test_component.py index f8d430ed2..9ac6d8fde 100644 --- a/src/py/reactpy/tests/test_core/test_component.py +++ b/src/py/reactpy/tests/test_core/test_component.py @@ -60,7 +60,7 @@ def PreFormatted(): return reactpy.html.pre( {"id": "pre-form-test"}, reactpy.html.span("this", reactpy.html.span("is"), "some"), - "pre-Formatted", + "pre-formatted", " text", ) From c4a87e9c0ea7ac124075a2dfedf2505087d8f69c Mon Sep 17 00:00:00 2001 From: Ryan Morshead Date: Mon, 5 Jun 2023 22:16:11 -0700 Subject: [PATCH 3/4] fix capitalization --- src/py/reactpy/tests/test_core/test_component.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/reactpy/tests/test_core/test_component.py b/src/py/reactpy/tests/test_core/test_component.py index 9ac6d8fde..aa8996d4e 100644 --- a/src/py/reactpy/tests/test_core/test_component.py +++ b/src/py/reactpy/tests/test_core/test_component.py @@ -70,4 +70,4 @@ def PreFormatted(): assert ( await pre.evaluate("node => node.innerHTML") - ) == "thisissomepre-Formatted text" + ) == "thisissomepre-formatted text" From c514152fee4c535eaa02680f21ee7a0e710c739f Mon Sep 17 00:00:00 2001 From: Ryan Morshead Date: Mon, 5 Jun 2023 22:16:29 -0700 Subject: [PATCH 4/4] fix capitalization --- src/py/reactpy/tests/test_core/test_events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/reactpy/tests/test_core/test_events.py b/src/py/reactpy/tests/test_core/test_events.py index ddaaee9b7..237c9d4ed 100644 --- a/src/py/reactpy/tests/test_core/test_events.py +++ b/src/py/reactpy/tests/test_core/test_events.py @@ -183,7 +183,7 @@ async def on_click(event): await display.page.wait_for_selector("#complete") -async def test_can_stop_event_Propagation(display: DisplayFixture): +async def test_can_stop_event_propagation(display: DisplayFixture): clicked = reactpy.Ref(False) @reactpy.component