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

Dependency order in Shiny #114

Closed
pvictor opened this issue Sep 24, 2018 · 3 comments
Closed

Dependency order in Shiny #114

pvictor opened this issue Sep 24, 2018 · 3 comments

Comments

@pvictor
Copy link

pvictor commented Sep 24, 2018

Hi,
Is there a way to specify the order of dependencies (using htmlDependency) in a shiny application ?

For example :

library(shiny)
library(htmltools)

addResourcePath(prefix = "mypackage", directoryPath = "")
ui <- fluidPage(  
  attachDependencies(
    tags$div(),
    htmlDependency(
      name = "dependency",
      version = "1.0.0",
      src = c(href = "mypackage/www"),
      script = "script.js"
    )
  )  
)
server <- function(input, output) { 
}
shinyApp(ui, server)

insert dependency between shiny deps :

image

ideally, I would like my script to be loaded after Bootstrap.

Thanks!

Victor

@nteetor
Copy link

nteetor commented Jan 2, 2019

I am also interested to know if there is a way to order dependencies. I thought perhaps they were sorted by name, but adding different prefixes to names appears to have no effect.

@jcheng5
Copy link
Member

jcheng5 commented Jan 2, 2019

When you attach dependencies, depend also on bootstrap, and make sure the bootstrap one appears earlier. htmltools will then make sure that any bootstrap dependency will come before your custom dependency. There isn't finer grained control than this though, and there isn't a way to more explicitly say "x depends on y". We could certainly add better control if it's warranted, though, so let me know if you have a scenario that's not supported by what we have now.

@wch
Copy link
Collaborator

wch commented Aug 26, 2019

Closing this issue. If you have more information to provide, feel free to reopen.

@wch wch closed this as completed Aug 26, 2019
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

4 participants