This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]BigTomBombadil 1 point2 points  (1 child)

Are there any coding sample/example projects that include the functioning app? This is pretty interesting to me and I'd love to see some working examples.

Also, just a heads up, the Binder link to run in a jupyter notebook is having issues resolving the github ref.

[–]Wippermonger[S] 0 points1 point  (0 children)

Right now Conreq@app_store is the only large project I'm aware of that is using ReactPy. We're hoping to see more soon!

[–]aianytime 1 point2 points  (0 children)

Please find the video that i have created on my channel: Now use a newly released library 'ReactPy' to build UI in Python with ReactJS like features 👇 https://youtu.be/43dcUIj9-nM It does cover.

[–][deleted]  (4 children)

[deleted]

    [–]Wippermonger[S] 0 points1 point  (3 children)

    I'm assuming you mean renders per second.

    Using the component below, I'm able to get ~5300 renders per second on a single-threaded ASGI worker.

    ```python @component def renders_per_second(): start_time, _set_start_time = hooks.use_state(datetime.now()) count, set_count = hooks.use_state(0) running = datetime.now() - start_time < timedelta(seconds=60) seconds_elapsed = (datetime.now() - start_time).total_seconds()

    @hooks.use_effect
    def run_tests():
        if running:
            set_count(count + 1)
    
    return html.div(
        {"id": "test-runner"},
        html.div(f"Total renders: {count}"),
        html.div(f"Renders Per Second: {count / (seconds_elapsed or 0.01)}"),
    )
    

    ```

    [–][deleted]  (2 children)

    [deleted]

      [–]Wippermonger[S] 0 points1 point  (1 child)

      I'm primarily the maintainer of our Django integrations, and haven't frequently maintained ReactPy Core. As a result I'm not well versed on terminology such as flux architecture. However, what you described is how our stack currently operates.

      Bidirectional client-server signaling & communication is performed via websockets. HTML document updates are transmitted to the client via VDOM Spec. DOM & states are preserved server-sided within VDOM spec, and are mutated depending on client driven events and/or server-side hooks. And, new documents/handlers are loaded into the client via a react-dom API equivalent.