Metadata-Version: 2.1
Name: ipywatch
Version: 0.0.1
Summary: A debugbar tool for ipywidgets/reacton/solara
Home-page: https://github.com/itepifanio/ipywatch
Author: Ítalo Epifânio
Author-email: italoepifaniols@gmail.com
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE

# Debugbar

<!-- 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.

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.

## Strategies

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.
