Skip to content

Commit 24a8f8f

Browse files
committed
Merge pull request rstudio#830 from rstudio/check-htmlwidgets
Check htmlwidgets version
2 parents 054c911 + 90c00be commit 24a8f8f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

R/globals.R

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,17 @@
77
# the private seed during load.
88
withPrivateSeed(reinitializeSeed())
99
}
10+
11+
.onAttach <- function(libname, pkgname) {
12+
# Check for htmlwidgets version, if installed. As of Shiny 0.12.0 and
13+
# htmlwidgets 0.4, both packages switched from RJSONIO to jsonlite. Because of
14+
# this change, Shiny 0.12.0 will work only with htmlwidgets >= 0.4, and vice
15+
# versa.
16+
if (system.file(package = "htmlwidgets") != "" &&
17+
utils::packageVersion("htmlwidgets") < "0.4") {
18+
packageStartupMessage(
19+
"This version of Shiny is designed to work with htmlwidgets >= 0.4. ",
20+
"Please upgrade your version of htmlwidgets."
21+
)
22+
}
23+
}

0 commit comments

Comments
 (0)