Skip to content

feat: Add the standalone Reactlog viewer and Python package - #166

Open
karangattu wants to merge 1 commit into
mainfrom
feat/python-report-viewer
Open

karangattu wants to merge 1 commit into
mainfrom
feat/python-report-viewer

Conversation

@karangattu

Copy link
Copy Markdown
Contributor

Reactlog now owns the standalone report viewer from the Shiny for Python Reactlog PRs. A Python caller can read a saved R or Python trace and write an interactive HTML file with the viewer embedded.

  • Move the R package to pkg-r/ and update its build, checks, RStudio project, and pkgdown demo. Development installs use remotes::install_github("rstudio/reactlog/pkg-r").
  • Add the Python reactlog package under pkg-py/. It ships the report template, stylesheet, and compiled JavaScript in the wheel and has no runtime dependencies.
  • Bring the report TypeScript, replay tests, and standalone browser coverage into this repository. The R package continues to use its existing viewer. Recording, CLI commands, and Shiny class and session integration tests belong in py-shiny.

The viewer comes from the top of the py-shiny Reactlog stack. Wiring the consumer PRs to the new package is a separate change. py-shiny#2467 · py-shiny#2531

Try it

From the repository root, run uv pip install ./pkg-py. With an exported trace in trace.json:

from pathlib import Path
from reactlog import format_reactlog_html, load_reactlog_json

trace = load_reactlog_json(Path("trace.json").read_text(encoding="utf-8"))
Path("report.html").write_text(format_reactlog_html(trace, source_code=""), encoding="utf-8")

Verification

  • Built the source distribution and wheel. The installed wheel passed 82 tests on Python 3.10, including Chromium playback and import tests.
  • Ran npm run build. TypeScript checks and all nine JavaScript tests passed.
  • Ran devtools::check("pkg-r") with --no-manual. Zero errors and warnings, one note for the existing rmarkdown import.
  • Built the pkgdown site and checked its reference index, demo assets, and source links.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant