-
Notifications
You must be signed in to change notification settings - Fork 183
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
Adds search as a future for server-side rendering #1011
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a bullet to NEWS.md
to mention this new feature (also feel free to add your name to DESCRIPTION
as a ctb
contributor). Thanks!
R/shiny.R
Outdated
|
||
toJSON = shinyFun('toJSON') | ||
httpResponse = shinyFun('httpResponse') | ||
|
||
filterFun = function(data, req) { | ||
filterExpr = expression({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually I don't prefer using eval(expression())
because we need to be careful about the evaluating environment. Is it okay to still make a function here, and provide a function call in promises::future_promise()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filterExpr = expression({ | |
filterFun2 = function(data, req) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me
R/shiny.R
Outdated
filterFun = function(data, req) { | ||
if (identical(future, FALSE)) return(eval(filterExpr)) | ||
else return(future_promise(seed = TRUE, { eval(filterExpr) })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filterFun = function(data, req) { | |
if (identical(future, FALSE)) return(eval(filterExpr)) | |
else return(future_promise(seed = TRUE, { eval(filterExpr) })) | |
filterFun = function(data, req) { | |
if (future) promises::future_promise(filterFun2(), seed = TRUE) else filterFun2() |
@@ -56,7 +56,7 @@ DTOutput = dataTableOutput | |||
#' a data object | |||
renderDataTable = function( | |||
expr, server = TRUE, env = parent.frame(), quoted = FALSE, | |||
funcFilter = dataTablesFilter, ... | |||
funcFilter = dataTablesFilter, future = FALSE, ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new argument needs to be documented.
I'll make the changes and document it asap |
Changes made! @yihui |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few minor changes that I'd like to make before merging. Could you allow me to edit the PR? https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork Thanks!
I'll have to create the Pull request again. |
You don't really need to create a new PR. All you need to do is check the box "Allow edits by maintainers" at the bottom of the right sidebar of this page. |
Resolves #1010