-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Ensure that extendShinyjs does not overwrite other shinyjs functions #230
Conversation
Good idea! There is already a place that defines a list of some shinyjs functions Line 67 in 2404d5f
I'd be worried about introducing another similar list, it would be very easy to forget to update it. I think the better approach here would be to define these lists elsewhere , perhaps in the |
Thanks for your feedback. That makes sense. I added a helper function I hope you are okay with a helper function instead of using the |
The helper function is good. A few things to fix:
|
…inyjsFunctionNames.
I fixed the mentioned issues. I removed By the way, how do you test any changes you make to your package? |
Unfortunately I don't have any good way of automatic testing for this package. That's one big disadvantage of writing sihny packages rather than regular R packages. If you're up for it I would love to strat accumulating some tests for shinyjs. |
I imagine this to be quite a huge task, if one would do this for every aspect of your package. There is probably no single solution that covers all aspects. I guess you could use the What kind of tests do you consider meaningful? I noticed you already have tests for |
This package was created before any testing frameworks for shiny existed, so the only thing I could test at the time was pure R code. You're right this would be a big undertaking, but even if just some of the core functions (show/hide/disabled/enabled/reset) are tested that would already be a big improvement. I'm open to suggestions for what would be the best apprroach, I haven't given it too much thought, I've been focusing on other packages recently. |
I noticed that one could overwrite other shinyjs functions using
extendShinyjs
, which is probably not intended. I therefore added an additional check toextendShinyjs
.