Skip to content

Enable auto-run by default in playground UI #1082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

haydenflinner
Copy link

One less click to get to the output of a playground link (click Output vs Checking AutoRun then clicking Output) and the accompanying very-cool live-edit experience.

I spent a few hours trying to get "Output as the default tab, with Results filled in once page loads and can run the code" working seamlessly too (i.e. 0 clicks), but am struggling with waiting for the output tab's iframe to be loaded before triggering the "RunCode" functionality.

@fhammerschmidt fhammerschmidt requested a review from tsnobip August 18, 2025 08:03
@fhammerschmidt
Copy link
Member

@tsnobip what do you think?

I am just worried about a full refresh giving you the same result when you accidentally produce an infinite loop. The page will freeze then.

@tsnobip
Copy link
Member

tsnobip commented Aug 23, 2025

@fhammerschmidt I'm not a big fan, it means if the code is too heavy and blocks the page, you just can't modify it, it doesn't seem like a great default to me. We should at least add a query param to disable it, or run the code in the background? But can you actually do it if you use react? Or maybe we should add some kind of timer and force stop the execution after some time. I don't know, what do you guys think?

@fhammerschmidt
Copy link
Member

React needs to run on the main (UI) thread, so a web worker would only help for everything else.
So I'd go for the extra query parameter.

@haydenflinner Would it be enough for you if you could bookmark https://rescript-lang.org/try?autorun or something similar?
And if so, are you keen to implement it?

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.

3 participants