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

Allow InputBinding.receiveMessage to be async #3930

Merged
merged 5 commits into from
Oct 30, 2023
Merged

Conversation

wch
Copy link
Collaborator

@wch wch commented Oct 28, 2023

This is motivated by rstudio/bslib#872.
It allows an input binding's receiveMessage() method to be synchronous or asynchronous, similar to OutputBinding.renderValue().

@wch wch force-pushed the async-receivemessage branch from 241291c to 52d4d9d Compare October 28, 2023 21:42
@wch wch requested a review from cpsievert October 29, 2023 00:09
@wch wch marked this pull request as ready for review October 29, 2023 00:09
@wch
Copy link
Collaborator Author

wch commented Oct 29, 2023

It might make sense to take this PR and #3929, which makes renderContent synchronous again, and adds back renderContentAsync.

Although this PR solves the specific issue we have with bslib (when paired with rstudio/bslib#874), there are potentially cases where people have written JS code which calls renderContent and then immediately tries to do something with the new content. Changing renderContent to async could break that code. Although those cases could generally be easily fixed to work with async, it would still be a breaking change. And since we have renderHtml/renderHtmlAsync and renderDependencies/renderDependenciesAsync, it would make sense to also have renderContent/renderContentAsync.

@cpsievert
Copy link
Collaborator

It might make sense to take this PR and #3929

Yea, I still think we should take #3929

@wch wch merged commit 6a09fda into main Oct 30, 2023
@wch wch deleted the async-receivemessage branch October 30, 2023 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants