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

Look into potentially having a workaround to get rid of the "useShinyjs()" function #101

Open
daattali opened this issue Nov 25, 2016 · 5 comments

Comments

@daattali
Copy link
Owner

Some hints here rstudio/shiny#1424

@daattali
Copy link
Owner Author

this gets extra complicated because both UI and server functions need shinyjs to be loaded, and both of them need to know whether it has been loaded already. Doesn't look feasible now, will maybe revisit at a later time

@daattali
Copy link
Owner Author

Opening this issue to try thinking about it again.

The parameters passed to useShinyjs() can be converted into options(). Or can maybe use a recently added feature in shiny internals or look at sys.calls() to figure out if need to use Rmd or not.

@daattali
Copy link
Owner Author

daattali commented Feb 6, 2018

Closing because this just seems to present too many problems without any proper solution. A few things that complicate it are the fact that the shinyjs code needs to be sometimes injected in the UI (when using hidden()/disabled()/any other UI functions) but usually in the server, and I want to make sure the code only gets injected once and not more, and the code needs to be injected properly when using Rmd or custom templates, and there's also the issue of extendShinyjs()

@daattali daattali closed this as completed Feb 6, 2018
@daattali
Copy link
Owner Author

daattali commented Feb 6, 2018

@alandipert @bborgesr It'd be nice to know if (1) there's any way within the UI to know whether or not a piece of code was already added earlier in the UI, and also (2) if there was a way for the server to know that a piece of code was already added to the UI

Just tagging you in case you can think of something, but I know I didn't describe the problem very well either so no worries if it's too vague

@daattali
Copy link
Owner Author

Re-opening once again, more than half a decade later, because I really do want this to happen. My biggest pet peeve with shinyjs from the very beginning was that users had to call an additional function, and unfortunately since then I've seen a lot of other packages copy my approach. My newer packages that are simpler no longer require a useX() call (for example shinyalert, shinyscreenshot, shinytip all removed it), but in shinyjs it is more complicated. I'm still trying :)

@daattali daattali reopened this Jan 16, 2023
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

No branches or pull requests

1 participant