shiny.router 0.1.1 cannot work with R 3.5.0 or higher
csliangy opened this issue · 2 comments
Thanks again for your great effort on shiny.router and it worked perfect on our application. But we came across a problem after upgrading to R3.5.0. We also tested the following sample application and we observe the same issue.
Source code:
library(shiny)
#devtools::install_github("Appsilon/shiny.router")
library(shiny.router)
# This generates menu in user interface with links.
menu <- (
tags$ul(
tags$li(a(class = "item", href = "/", "Page")),
tags$li(a(class = "item", href = "/other", "Other"))
)
)
# This creates UI for each page.
page <- function(title, content) {
div(
menu,
titlePanel(title),
p(content)
)
}
# Both sample pages.
root_page <- page("Home page", "Welcome on sample routing page!")
other_page <- page("Some other page", "Lorem ipsum dolor sit amet")
# Creates router. We provide routing path and UI for this page.
router <- make_router(
route("/", root_page),
route("/other", other_page)
)
# Creat output for our router in main UI of Shiny app.
ui <- shinyUI(fluidPage(
router_ui()
))
# Plug router into Shiny server.
server <- shinyServer(function(input, output) {
router(input, output)
})
# Run server in a standard way.
shinyApp(ui, server)
R version: 3.5.0 or higher
Issues:
When we click the "Other", it shows the following error:
BTW, do you have plan to push it to CRAN?
Hello @csliangy ! Thank you for using shiny.router.
To fix the application just make small changes:
menu <- (
tags$ul(
tags$li(a(class = "item", href = "/", "Page")),
tags$li(a(class = "item", href = route_link("other"), "Other"))
)
)
and:
router <- make_router(
route("/", root_page),
route("other", other_page)
)
The url no should have form: <app-url>/#!/other
The package is actually on CRAN since about one week.
You can find info about latest features on our blog: https://appsilon.com/shiny-router-package/
Fantastic!!! Thanks again. Actually we were using that for several projects and recently we moved it out of our projects due to the aforementioned problems. Now I have the full confidence to bring it back. Thanks again for your amazing contributions.
I was also impressed by https://www.r-bloggers.com/how-we-built-a-shiny-app-for-700-users/ .