Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade jQuery by using the R package jquerylib #2197

Merged
merged 1 commit into from
Aug 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ Authors@R: c(
#
# Copyright holders
person(family = "RStudio, PBC", role = "cph"),
person(family = "jQuery Foundation", role = "cph",
comment = "jQuery library"),
person(family = "jQuery contributors", role = c("ctb", "cph"),
comment = "jQuery library; authors listed in inst/rmd/h/jquery-AUTHORS.txt"),
person(family = "jQuery UI contributors", role = c("ctb", "cph"),
comment = "jQuery UI library; authors listed in inst/rmd/h/jqueryui-AUTHORS.txt"),
person("Mark", "Otto", role = "ctb",
Expand Down Expand Up @@ -92,6 +88,7 @@ Imports:
jsonlite,
tinytex (>= 0.31),
xfun (>= 0.21),
jquerylib,
methods,
stringr (>= 1.2.0)
Suggests:
Expand Down
7 changes: 1 addition & 6 deletions R/html_dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ NULL
#' @rdname html-dependencies
#' @export
html_dependency_jquery <- function() {

htmlDependency(
name = "jquery",
version = "1.11.3",
src = pkg_file("rmd/h/jquery"),
script = "jquery.min.js")
jquerylib::jquery_core()
Copy link
Collaborator

@cderv cderv Aug 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yihui What about already pinning version 3 to prevent any undesired future change if/when jquerylib changes its default ?

-jquerylib::jquery_core()
+jquerylib::jquery_core(major_version = 3)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess jquerylib won't change the version here suddenly (Carson will probably notify us), but I can definitely see the value of being a little conservative by pinning the version. To make it easier for ourselves to test future versions of jQuery, we can use an option to specify the version and default it to 3, e.g.,

jquerylib::jquery_core(major_version = getOption('rmarkdown.jquery.version', 3))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I like the option ! I don't have this habits but this is great to have some config flag around for us to use.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess jquerylib won't change the version here suddenly (Carson will probably notify us), but I can definitely see the value of being a little conservative by pinning the version.

And yes I agree. I just see not harm and probably some benefit of being conservative for such things.

}

# Create an HTML dependency for jQuery UI
Expand Down
217 changes: 0 additions & 217 deletions inst/rmd/h/jquery-AUTHORS.txt

This file was deleted.

5 changes: 0 additions & 5 deletions inst/rmd/h/jquery/jquery.min.js

This file was deleted.