Skip to content

Commit

Permalink
Update dash-renderer to 1.2.2 and fix dev tools UI display of stack t…
Browse files Browse the repository at this point in the history
…races (#137)

* 🚚 upgrade dash-renderer to v1.2.2, 🔨 fix stack traces

* 🚚 add polyfill.js
  • Loading branch information
rpkyle authored Dec 25, 2019
1 parent 006b6d3 commit 93345e6
Show file tree
Hide file tree
Showing 11 changed files with 25,597 additions and 31,736 deletions.
1 change: 1 addition & 0 deletions R/dash.R
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,7 @@ Dash <- R6::R6Class(
depsAll <- compact(c(
private$react_deps()[private$react_versions() %in% private$react_version_enabled()],
private$dependencies_internal[grepl(pattern = "prop-types", x = private$dependencies_internal)],
private$dependencies_internal[grepl(pattern = "polyfill", x = private$dependencies_internal)],
private$dependencies,
private$dependencies_user,
private$dependencies_internal[grepl(pattern = "dash-renderer", x = private$dependencies_internal)]
Expand Down
36 changes: 24 additions & 12 deletions R/internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,22 @@
package = "dash",
all_files = FALSE),
class = "html_dependency"),
`polyfill-prod` = structure(list(name = "polyfill",
version = "7.7.0",
src = list(href = "https://unpkg.com/@babel/polyfill@7.7.0",
file = "lib/polyfill@7.7.0"),
meta = NULL,
script = "dist/polyfill.min.js",
stylesheet = NULL,
head = NULL,
attachment = NULL,
package = "dash",
all_files = FALSE),
class = "html_dependency"),
`dash-renderer-dev` = structure(list(name = "dash-renderer",
version = "1.0.0",
src = list(href = "https://unpkg.com/dash-renderer@1.0.0",
file = "lib/dash-renderer@1.0.0"),
version = "1.2.2",
src = list(href = "https://unpkg.com/dash-renderer@1.2.2",
file = "lib/dash-renderer@1.2.2"),
meta = NULL,
script = "dash-renderer/dash_renderer.dev.js",
stylesheet = NULL,
Expand All @@ -36,9 +48,9 @@
all_files = FALSE),
class = "html_dependency"),
`dash-renderer-map-dev` = structure(list(name = "dash-renderer",
version = "1.0.0",
src = list(href = "https://unpkg.com/dash-renderer@1.0.0",
file = "lib/dash-renderer@1.0.0"),
version = "1.2.2",
src = list(href = "https://unpkg.com/dash-renderer@1.2.2",
file = "lib/dash-renderer@1.2.2"),
meta = NULL,
script = "dash-renderer/dash_renderer.dev.js.map",
stylesheet = NULL,
Expand All @@ -48,9 +60,9 @@
all_files = FALSE),
class = "html_dependency"),
`dash-renderer-prod` = structure(list(name = "dash-renderer",
version = "1.0.0",
src = list(href = "https://unpkg.com/dash-renderer@1.0.0",
file = "lib/dash-renderer@1.0.0"),
version = "1.2.2",
src = list(href = "https://unpkg.com/dash-renderer@1.2.2",
file = "lib/dash-renderer@1.2.2"),
meta = NULL,
script = "dash-renderer/dash_renderer.min.js",
stylesheet = NULL,
Expand All @@ -60,9 +72,9 @@
all_files = FALSE),
class = "html_dependency"),
`dash-renderer-map-prod` = structure(list(name = "dash-renderer",
version = "1.0.0",
src = list(href = "https://unpkg.com/dash-renderer@1.0.0",
file = "lib/dash-renderer@1.0.0"),
version = "1.2.2",
src = list(href = "https://unpkg.com/dash-renderer@1.2.2",
file = "lib/dash-renderer@1.2.2"),
meta = NULL,
script = "dash-renderer/dash_renderer.min.js.map",
stylesheet = NULL,
Expand Down
8 changes: 4 additions & 4 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ stackTraceToHTML <- function(call_stack,
if(is.null(call_stack)) {
return(NULL)
}
header <- " ### Dash for R Traceback (most recent/innermost call last) ###"
header <- " ### Dash for R Traceback (most recent/innermost call last) ###\n"

formattedStack <- c(paste0(
" ",
Expand All @@ -724,19 +724,19 @@ stackTraceToHTML <- function(call_stack,
call_stack,
" ",
lapply(call_stack, attr, "lineref"),
collapse="<br>"
collapse="\n"
)
)

template <- "<!DOCTYPE HTML><html><body><pre><h3>%s</h3><br>Error: %s: %s<br>%s</pre></body></html>"
template <- "%s\nError: %s: %s\n%s"
response <- sprintf(template,
header,
throwing_call,
error_message,
formattedStack)

# properly format anonymous tags if present in call stack
response <- gsub("<anonymous>", "&lt;anonymous&gt;", response)
#response <- gsub("<anonymous>", "&lt;anonymous&gt;", response)

return(response)
}
Expand Down

This file was deleted.

33 changes: 0 additions & 33 deletions inst/lib/dash-renderer@1.0.0/dash-renderer/dash_renderer.min.js

This file was deleted.

This file was deleted.

Loading

0 comments on commit 93345e6

Please sign in to comment.