Skip to content

Commit

Permalink
Update readme. Add assets
Browse files Browse the repository at this point in the history
  • Loading branch information
itepifanio committed Feb 19, 2024
1 parent 7fbf42b commit 637c29c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 60 deletions.
49 changes: 6 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,12 @@

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

Welcome to the Debugbar project, a proof of concept (POC) aimed at
exploring various strategies to develop a debugging tool for IPyWidgets,
Reacton, and Solara components. This project serves as an investigative
stage, focusing on identifying effective methods to debug and track the
state and interactions within these frameworks.
Welcome to the Ipywatch project a debugging solution for developers
working with IPyWidgets, Reacton, and Solara.

The Debugbar project represents the first step towards a sophisticated
debugging solution for developers working with IPyWidgets, Reacton, and
Solara. By methodically exploring and refining the strategies outlined,
we aim to enhance the development experience and enable more efficient
debugging workflows for complex applications.
The lib monitors state changes at ipywidgets level by listening to the
[Comm API](https://jupyter-notebook.readthedocs.io/en/4.x/comms.html)

## Strategies
## Installing

Below are the strategies currently under exploration, each offering a
unique angle to approach debugging within the Jupyter ecosystem and
Reacton/Solara components.

### Comm

- Description: The Comm API, part of the Jupyter notebook’s
infrastructure, facilitates communication between the front-end and
back-end by sending JSON-able blobs. This API is used by widgets for
maintaining state synchronization.
- Approach: By monkey-patching the `comm.create_comm` function, we can
intercept and log all messages exchanged between widgets. This allows
the Debugbar to track and modify states dynamically, providing a
tool-agnostic method for debugging that doesn’t rely directly on the
internal state management of Reacton.

### Reacton

- Description: Reacton’s `RenderContext` object plays a crucial role in
state management, especially with its `state_get` method, which is
pivotal during state restoration post-hot reloads.
- Approach:
- State Tracking: Implementing tracking for the `state_get` call
within `RenderContext` offers insight into state restoration
processes.
- Pre-Render Event: Introducing a pre_render event in Reacton could
allow for `state_get` invocations before each rendering phase,
enhancing visibility into state changes.
- Integration with Chrome Tracing: Exploring the potential of
Reacton’s tracer, previously developed by the Widgetti team, to
generate trace data compatible with `chrome://tracing` for a
detailed analysis of rendering and state management performance.
`pip install ipywatch`
Binary file added assets/ipywatch.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 4 additions & 17 deletions nbs/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,18 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Welcome to the Debugbar project, a proof of concept (POC) aimed at exploring various strategies to develop a debugging tool for IPyWidgets, Reacton, and Solara components. This project serves as an investigative stage, focusing on identifying effective methods to debug and track the state and interactions within these frameworks.\n",
"Welcome to the Ipywatch project a debugging solution for developers working with IPyWidgets, Reacton, and Solara. \n",
"\n",
"The Debugbar project represents the first step towards a sophisticated debugging solution for developers working with IPyWidgets, Reacton, and Solara. By methodically exploring and refining the strategies outlined, we aim to enhance the development experience and enable more efficient debugging workflows for complex applications."
"The lib monitors state changes at ipywidgets level by listening to the [Comm API](https://jupyter-notebook.readthedocs.io/en/4.x/comms.html)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Strategies\n",
"## Installing\n",
"\n",
"Below are the strategies currently under exploration, each offering a unique angle to approach debugging within the Jupyter ecosystem and Reacton/Solara components.\n",
"\n",
"### Comm\n",
"\n",
"- Description: The Comm API, part of the Jupyter notebook's infrastructure, facilitates communication between the front-end and back-end by sending JSON-able blobs. This API is used by widgets for maintaining state synchronization.\n",
"- Approach: By monkey-patching the `comm.create_comm` function, we can intercept and log all messages exchanged between widgets. This allows the Debugbar to track and modify states dynamically, providing a tool-agnostic method for debugging that doesn't rely directly on the internal state management of Reacton.\n",
"\n",
"### Reacton\n",
"\n",
"- Description: Reacton's `RenderContext` object plays a crucial role in state management, especially with its [`state_get`](https://github.com/widgetti/reacton/blob/3eee8f7681d5aad8d56c284f0c76fb7e55f8d917/reacton/core.py#L1195) method, which is pivotal during state restoration post-hot reloads ([1](https://github.com/widgetti/solara/blob/0099274e25116860e690f32074ffa4136c7edfd6/solara/server/app.py#L239), [2](https://github.com/widgetti/solara/blob/0099274e25116860e690f32074ffa4136c7edfd6/solara/server/app.py#L291)).\n",
"- Approach:\n",
" - State Tracking: Implementing tracking for the `state_get` call within `RenderContext` offers insight into state restoration processes.\n",
" - Pre-Render Event: Introducing a pre_render event in Reacton could allow for `state_get` invocations before each rendering phase, enhancing visibility into state changes.\n",
" - Integration with Chrome Tracing: Exploring the potential of Reacton's tracer, previously developed by the Widgetti team, to generate trace data compatible with `chrome://tracing` for a detailed analysis of rendering and state management performance.\n"
"`pip install ipywatch`"
]
}
],
Expand Down

0 comments on commit 637c29c

Please sign in to comment.