Skip to content
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

feat: Fully reload ui/server when autoreload occurs #4184

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gadenbuie
Copy link
Member

This PR updates the auto reload to fully reload both the UI and server source code when any change is detected in the watched autoreload files.

Previously, auto reload would trigger a refresh of the app but the UI or server functions would be updated only if the ui.R or server.R files themselves changed (or both if using a single-file app source).

This PR updates auto reloading so that any change to the files matching shiny.autoreload.pattern causes both the UI and server source to be reloaded.

This fixes two long-standing open issues:

Fixes #2711
Fixes #1142

Example app

For testing, the following app sources R files and uses stylesheets outside the main app.R. Currently, in main, any changes to the supporting files causes the app to be reloaded but the reloaded app does not reflect the changes.

After this PR, changes to support files are reflected after the reload.

Example app on shinylive.

@gadenbuie gadenbuie requested a review from jcheng5 February 3, 2025 23:05
R/shinyapp.R Outdated Show resolved Hide resolved
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.

autoreload doesn't load with Shiny modules Autoreload does not load css files
1 participant