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

extendShinyjs(script = htmlDependency(...), functions = ...) support #254

Open
mmuurr opened this issue Aug 9, 2022 · 6 comments
Open

Comments

@mmuurr
Copy link

mmuurr commented Aug 9, 2022

I'm wondering if there's a simple way to specify the script file holding {shinyjs} 'extension' functions as an {htmltools} htmlDependency object, using then the absolute file resolution codepath of that dependency.

I realize addResourcePath() does something similar already, but as I write some standardized wrappers I was just curious if htmlDependency() had ever been considered :-)

Cheers and thanks!

@daattali
Copy link
Owner

I haven't thought of this before, so it's not supported. The only reason it's not supported is because this function was written many years ago before I understood how htmlDependency() works. This would be a good idea if anyone wants to try to implement it.

@daattali
Copy link
Owner

daattali commented Jan 16, 2023

@mmuurr This should now be supported, you can use the script argument with an htmlDependency. Can you please let me know if it works for you?

Note to self: before closing the issue, update documentation anywhere that addResourcePath is used or where extendShinyjs is used

@mmuurr
Copy link
Author

mmuurr commented Jan 18, 2023

@daattali,

This should not be supported ...

I assume that's a typo and it actually should be, "This should now be supported"; correct?

(It's a shame that two dramatically different meanings are separable by only one character :-))

@daattali
Copy link
Owner

I should not be writing messages (or even worse, coding) at 4:50am... yet here we are. Hopefully the code was better than the message. Can you please verify that this works for you?

@mmuurr
Copy link
Author

mmuurr commented Jan 22, 2023

Yup, this seems to be working for me now; thanks!

(I still always struggle with the various options of htmlDependency() itself and how to get the output HTML tags to what I want, but that's {htmltools}' issue and the challenges that come with heavily-overloading a single function's optional parameters :-| )

@daattali
Copy link
Owner

Oh I also do! Every single time I need to use htmlDependency(), I do a github serach through my own repos to see how to use it. Every single time.

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

2 participants