Skip to content

Commit

Permalink
Tweak autoreload behavior
Browse files Browse the repository at this point in the history
I had to update scripts/htmlDependencies.R to pull from the
rstudio/shiny@autoreload-tweaks branch, because we're not ready to
pull all of the changes from rstudio/shiny@main right at this moment
  • Loading branch information
jcheng5 committed Oct 19, 2023
1 parent 4d1e6db commit f9db1ab
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 22 deletions.
2 changes: 1 addition & 1 deletion shiny/www/shared/_version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"note!": "This file is auto-generated by scripts/htmlDependencies.R",
"package": "shiny",
"version": "Github (rstudio/shiny@68546c319e465a9cb113ea4499912823e264e75f)"
"version": "Github (rstudio/shiny@ab69d7292c51d8983174e0828496a7096f513673)"
}
2 changes: 1 addition & 1 deletion shiny/www/shared/bootstrap/_version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"note!": "This file is auto-generated by scripts/htmlDependencies.R",
"shiny_version": "Github (rstudio/shiny@68546c319e465a9cb113ea4499912823e264e75f)",
"shiny_version": "Github (rstudio/shiny@ab69d7292c51d8983174e0828496a7096f513673)",
"bslib_version": "Github (rstudio/bslib@a076e72e78562d7f006889da4118cd781c66c84c)",
"htmltools_version": "Github (rstudio/htmltools@9338b7f3e2ed7b3fef8fd813904b9b05281344aa)",
"bootstrap_version": "5.2.2"
Expand Down
3 changes: 2 additions & 1 deletion shiny/www/shared/shiny-autoreload.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shiny/www/shared/shiny-autoreload.js.map

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions shiny/www/shared/shiny.js
Original file line number Diff line number Diff line change
Expand Up @@ -17894,15 +17894,16 @@
}, _callee2);
})));
};
socket.onclose = function() {
socket.onclose = function(e) {
var restarting = e.code === 1012;
if (hasOpened) {
(0, import_jquery38.default)(document).trigger({
type: "shiny:disconnected",
socket: socket
});
_this.$notifyDisconnected();
}
_this.onDisconnected();
_this.onDisconnected(restarting);
_this.$removeSocket();
};
return socket;
Expand Down Expand Up @@ -17982,10 +17983,11 @@
}, {
key: "onDisconnected",
value: function onDisconnected() {
var $overlay = (0, import_jquery38.default)("#shiny-disconnected-overlay");
if ($overlay.length === 0) {
var reloading = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
if ((0, import_jquery38.default)("#shiny-disconnected-overlay").length === 0) {
(0, import_jquery38.default)(document.body).append('<div id="shiny-disconnected-overlay"></div>');
}
(0, import_jquery38.default)("#shiny-disconnected-overlay").toggleClass("reloading", reloading);
if (this.$allowReconnect === true && this.$socket.allowReconnect === true || this.$allowReconnect === "force") {
var delay = this.reconnectDelay.next();
showReconnectDialog(delay);
Expand Down
4 changes: 2 additions & 2 deletions shiny/www/shared/shiny.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion shiny/www/shared/shiny.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion shiny/www/shared/shiny.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions shiny/www/shared/shiny.min.js.map

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions shiny/www/shared/shiny_scss/shiny.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,25 @@ pre.shiny-text-output {

#shiny-disconnected-overlay {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
inset: 0;
background-color: $shiny-disconnected-bg;
opacity: 0.5;
overflow: hidden;
z-index: 99998;
pointer-events: none;
}

html.autoreload-enabled #shiny-disconnected-overlay.reloading {
opacity: 0;
animation: fadeIn 250ms forwards;
animation-delay: 1s;
}
@keyframes fadeIn {
to {
opacity: 0.1;
}
}

.table.shiny-table {
@include table-padding($left: 12px, $right: 12px);
}
Expand Down

0 comments on commit f9db1ab

Please sign in to comment.