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

Pause unpause #6

Merged
merged 3 commits into from
Oct 8, 2020
Merged

Pause unpause #6

merged 3 commits into from
Oct 8, 2020

Conversation

ColinFay
Copy link
Contributor

@ColinFay ColinFay commented Oct 7, 2020

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

@tylerlittlefield tylerlittlefield added the hacktoberfest Hacktoberfest! label Oct 7, 2020
),
script = "mousetrap.min.js"
src = system.file("mousetrap", package = "keys"),
script = c("mousetrap.min.js", "moustrap-pause.min.js")
Copy link
Member

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.

Copy link
Member

@tylerlittlefield tylerlittlefield Oct 7, 2020

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.

Copy link
Contributor Author

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.

@tylerlittlefield
Copy link
Member

Small typo: moustrap-pause.min.js -> mousetrap-pause.min.js

@tylerlittlefield tylerlittlefield mentioned this pull request Oct 7, 2020
@tylerlittlefield tylerlittlefield added the enhancement New feature or request label Oct 7, 2020
@ColinFay
Copy link
Contributor Author

ColinFay commented Oct 8, 2020

Typo corrected ✅

Copy link
Member

@tylerlittlefield tylerlittlefield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🎉

@tylerlittlefield tylerlittlefield merged commit 949214a into r4fun:master Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest Hacktoberfest!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants