-
Notifications
You must be signed in to change notification settings - Fork 1.9k
createWebDependency can't handle relative htmlDependencies #2383
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
Comments
It looks like when Shiny internally calls That's a real sucky API though... |
Maybe resolveDependencies should add a class to each dependency object, and createWebDependency should warn if the objects it gets aren't marked with the class? |
This doesn't seem quite right either. You could still end up in a situation where you have manually combined 2 (or more) lists of the same resolved dependencies, which should "un-resolve" them, but there's no way for us to detect or prevent that from happening. If we're really concerned about duplicated dependencies, maybe pattern <- paste0("^", dependency$name, "-")
if (grepl(pattern, names(.globals$resources))) {
warning("HTML dependency ", dependency$name, " has likely already been registered as a web resource.")
} |
Minimal example, this works as expected
This does not:
I noticed this in a shiny app that uses crosstalk and leaflet. The dev version of
crosstalk::crosstalkLibs()
now returns html dependencies with relative paths which ends up being a problem for this line of leaflethttps://github.com/rstudio/leaflet/blob/44df7d18a2618e0aeecb4145d765e597ec65878b/R/utils.R#L201
Since others might want to use
shiny::createWebDependency()
in a similar way, I figured the fix should derive from here.The text was updated successfully, but these errors were encountered: