-
Notifications
You must be signed in to change notification settings - Fork 6
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
Pause unpause #6
Conversation
R/html_dependency.R
Outdated
), | ||
script = "mousetrap.min.js" | ||
src = system.file("mousetrap", package = "keys"), | ||
script = c("mousetrap.min.js", "moustrap-pause.min.js") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to get your thoughts on the approach you suggest here compared to this approach. I thought there might be benefit to showing the src of the javascript both local and on CDN but not actually sure if there is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, after addressing the typo in file moustrap-pause.min.js
, please update the typo here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey,
You can choose to do both, as in https://github.com/ColinFay/glouton/blob/master/R/cookies.R#L9
The issue with relying on a CDN is that if the shiny app doesn't have access to the internet, it won't be able to load the script, whereas bundling the script inside the package makes it more reliable. Given that {shiny}
apps might be used in contexts where the computer doesn't have internet, it might be a good solution.
Also, CDN might (but that's very rare) be subject to external attackers that can modify the script, creating a security vulnerability in your app.
On the other hand, using a CDN makes things faster as it's cached by the browser... so... I don't know what's best :) But there should definitely be a backup plan in case the computer doesn't have access to the web.
Small typo: |
Typo corrected ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🎉
This PR implements two things:
html dependencies are not set to local package, instead of relying on CDN (which would make the shiny app fail if there is no internet and you don't have the source in the browser storage)
pause and unpause methods from the pause plugin