diff --git a/CHANGELOG.md b/CHANGELOG.md index 0691bbd8..a3321076 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,11 @@ All notable changes to `dash` will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -## [0.9.0] - 2020-10-31 +## [0.9.1] - 2020-11-16 +### Fixed +- A regression which prevented favicons from displaying properly has been resolved, and a default Dash favicon is now supplied when none is provided in the `assets` directory. [#240](https://github.com/plotly/dashr/pull/240) +## [0.9.0] - 2020-10-31 ### Fixed - Fixes a minor bug in `setCallbackContext` (described in [#236](https://github.com/plotly/dashR/issues/236)) which prevented pattern-matching callbacks from working properly if one or more `input` statements did not include a selector. [#237](https://github.com/plotly/dashR/pull/237) diff --git a/DESCRIPTION b/DESCRIPTION index dfabe490..aa522f42 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dash Title: An Interface to the Dash Ecosystem for Authoring Reactive Web Applications -Version: 0.9.0 +Version: 0.9.1 Authors@R: c(person("Chris", "Parmer", role = c("aut"), email = "chris@plotly.com"), person("Ryan Patrick", "Kyle", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-5829-9867"), email = "ryan@plotly.com"), person("Carson", "Sievert", role = c("aut"), comment = c(ORCID = "0000-0002-4958-2844")), person("Hammad", "Khan", role = c("aut"), comment = c(ORCID = "0000-0003-2479-9841"), email = "hammadkhan@plotly.com"), person(family = "Plotly Technologies", role = "cph")) Description: A framework for building analytical web applications, Dash offers a pleasant and productive development experience. No JavaScript required. Depends: diff --git a/R/dash.R b/R/dash.R index bca7936c..fc30660f 100644 --- a/R/dash.R +++ b/R/dash.R @@ -116,7 +116,7 @@ Dash <- R6::R6Class( # ------------------------------------------------------------ router <- routr::RouteStack$new() server$set_data("user-routes", list()) # placeholder for custom routes - + # ensure that assets_folder is neither NULL nor character(0) if (!(is.null(private$assets_folder)) & length(private$assets_folder) != 0) { if (!(dir.exists(private$assets_folder)) && gsub("/+", "", assets_folder) != "assets") { @@ -494,13 +494,17 @@ Dash <- R6::R6Class( } TRUE }) - dash_favicon <- paste0(self$config$routes_pathname_prefix, "_favicon.ico") route$add_handler("get", dash_favicon, function(request, response, keys, ...) { asset_path <- get_asset_path(private$asset_map, "/favicon.ico") + # If custom favicon is not present, get the path for the default Dash favicon + if (is.na(names(asset_path))) { + asset_path <- system.file("extdata", "favicon.ico", package = "dash") + } + file_handle <- file(asset_path, "rb") response$body <- readBin(file_handle, raw(), @@ -1891,9 +1895,11 @@ Dash <- R6::R6Class( # create tag for favicon, if present # other_files_map[names(other_files_map) %in% "/favicon.ico"] if ("/favicon.ico" %in% names(private$asset_map$other)) { - favicon <- sprintf("") + favicon_url <- sprintf('\"%s_favicon.ico\"', self$config$requests_pathname_prefix) + favicon <- sprintf("", favicon_url) } else { - favicon <- "" + favicon_url <- sprintf('\"%s_favicon.ico\"', self$config$requests_pathname_prefix) + favicon <- sprintf("", favicon_url) } # set script tag to invoke a new dash_renderer @@ -1901,7 +1907,6 @@ Dash <- R6::R6Class( "_dash-renderer", "application/javascript", "var renderer = new DashRenderer();") - # add inline tags scripts_inline <- private$inline_scripts @@ -1961,24 +1966,6 @@ Dash <- R6::R6Class( private$.index <- private$template_index } - # define the react-entry-point - app_entry <- "