Skip to content

Restart R without reloading the page - #52

Merged
PeterSlijkhuis merged 1 commit into
mainfrom
restart-r
Sep 30, 2026
Merged

PeterSlijkhuis merged 1 commit into
mainfrom
restart-r

Conversation

@PeterSlijkhuis

Copy link
Copy Markdown
Owner

Before: "Restart R" (and "Try again" after a failed start) reloaded the whole page.

After: it stops R, even in the middle of an endless loop, and starts a fresh R in the same page. Lessons and the R Workspace pick up the new R, and drafts and scripts are kept.

How: restartR() closes the webR worker and tells listeners; the session setup, package and upload caches reset, and App remounts the page content and boots again. Checked with real R in a local browser: while (TRUE) {} in a lesson block and in the Workspace, then Restart R, then new code runs on a fresh R with no page reload.


Generated by Claude Code

Restart R now closes the webR worker, which stops R even in the middle of an
endless loop, and boots a fresh one in the same page. The per-instance caches
(session setup, installed packages, restored uploads) reset, and the page
content remounts so lessons and the R Workspace pick up the new R. Drafts
and scripts are kept.
@PeterSlijkhuis
PeterSlijkhuis merged commit c7ee70f into main Sep 30, 2026
4 checks passed
@PeterSlijkhuis
PeterSlijkhuis deleted the restart-r branch October 1, 2026 07:17

This branch was successfully deployed

1 active deployment
github-pages — c7ee70fe Deployed Sep 30, 2026 by PeterSlijkhuis via deploy #137
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