{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/shiny/issues/1389","repository_url":"https://api.github.com/repos/rstudio/shiny","labels_url":"https://api.github.com/repos/rstudio/shiny/issues/1389/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/shiny/issues/1389/comments","events_url":"https://api.github.com/repos/rstudio/shiny/issues/1389/events","html_url":"https://github.com/rstudio/shiny/issues/1389","id":179238481,"number":1389,"title":"htmldependency injection is sometimes asynchronous","user":{"login":"bhaskarvk","id":1761224,"avatar_url":"https://avatars.githubusercontent.com/u/1761224?v=3","gravatar_id":"","url":"https://api.github.com/users/bhaskarvk","html_url":"https://github.com/bhaskarvk","followers_url":"https://api.github.com/users/bhaskarvk/followers","following_url":"https://api.github.com/users/bhaskarvk/following{/other_user}","gists_url":"https://api.github.com/users/bhaskarvk/gists{/gist_id}","starred_url":"https://api.github.com/users/bhaskarvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhaskarvk/subscriptions","organizations_url":"https://api.github.com/users/bhaskarvk/orgs","repos_url":"https://api.github.com/users/bhaskarvk/repos","events_url":"https://api.github.com/users/bhaskarvk/events{/privacy}","received_events_url":"https://api.github.com/users/bhaskarvk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-26T14:07:07Z","updated_at":"2016-09-26T16:59:53Z","closed_at":null,"body":"Here's a working e.g. of a standalone htmlwidget (leaflet) with an onRender call.\r\n\r\nhttps://gist.github.com/bhaskarvk/0c665350557e8ff79a9870cecc88f571\r\n\r\nThe idea is taken from https://gist.github.com/jcheng5/c084a59717f18e947a17955007dc5f92 to add a HTML dependency to leaflet on the fly and use it in `onRender`. \r\n\r\nSame code in Shiny \r\nhttps://gist.github.com/bhaskarvk/f3e3a609fa901b4fefea624fcb1d863a\r\n\r\nBut in this case, the `onRender` function is called before the dependency is attached to the widget, and hence fails. If I remove the `onRender` code then the map displays and the dependency is attached. But that is pointless as I can't use it."},"comment":{"url":"https://api.github.com/repos/rstudio/shiny/issues/comments/249630448","html_url":"https://github.com/rstudio/shiny/issues/1389#issuecomment-249630448","issue_url":"https://api.github.com/repos/rstudio/shiny/issues/1389","id":249630448,"user":{"login":"jcheng5","id":129551,"avatar_url":"https://avatars.githubusercontent.com/u/129551?v=3","gravatar_id":"","url":"https://api.github.com/users/jcheng5","html_url":"https://github.com/jcheng5","followers_url":"https://api.github.com/users/jcheng5/followers","following_url":"https://api.github.com/users/jcheng5/following{/other_user}","gists_url":"https://api.github.com/users/jcheng5/gists{/gist_id}","starred_url":"https://api.github.com/users/jcheng5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcheng5/subscriptions","organizations_url":"https://api.github.com/users/jcheng5/orgs","repos_url":"https://api.github.com/users/jcheng5/repos","events_url":"https://api.github.com/users/jcheng5/events{/privacy}","received_events_url":"https://api.github.com/users/jcheng5/received_events","type":"User","site_admin":false},"created_at":"2016-09-26T16:59:53Z","updated_at":"2016-09-26T16:59:53Z","body":"What this means is that it's almost never going to be a good idea to use a `htmlDependency(src = c(href = \"http://...\"))` for any dependency that's intended to be used with Shiny. I'm of half a mind to simply outlaw this from htmltools, or at least warn by default."}}
{"actor":{"display_login":"jcheng5"}}