Vscode communicate directly with R through http requests? #594
danielbasso
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Given he wrote the session watcher, @renkun-ken is probably the best person for this consideration! I think that we'd also have to consider that plumber would be a dependency of vscode-R, and whether that has any caveats Edit: having said that, I think it's a neat idea and could also smooth liveshare support |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TL;DR: How about using the pumbler package to make vscode communicate directly with R through http requests?
(Maybe a follow up to #440)
#506 made me think about ways to enhance the current
View()
functionality. I think DataTables is fine, even if it's a bit old and based on JQuery; it just need to be better presented (match the theme colors, better formatting on columns, pagination, etc). The only feature I believe is missing, which for me is a big one, is the dynamic loading of the table rows, for big data frames.DataTables, as well as other good table libraries, already has a solution for that: server-side processing, where all the library does is pass a set of parameters to the server, through Ajax http requests, which is responsible for performing all paging and filter processing.
This led me to seek to understand in more depth how vscode interacts with R. The current way, as far as I could understand, is that
session.ts
sourcesinit.R
in some kind of watcher fashion; vscode then will make requests through writing inrequest.log
file; R will write the appropriate results back in other files inside/tmp/'myrsession'
that will the read back by vscode.This is a nice approach for what has been done so far, but I fear that it can became cumbersome for some tasks, like the server-side processing mentioned before.
Wouldn't be interesting to consider to start an actual http server to communicate with R? There is this package, pumbler that already does that in a simple fashion. Just select a port and you can create endpoints; this would allow direct communication between R and vscode through http. Javascript has an amazing support to http requests out of the box. I think that it not only would allow new possibilities, but it would make things easier to implement and maintain.
I would like to know from the more experienced contributors to the project if this is a real possibility or if there is a hard restriction to this idea, making me stick to the ways that things are done right now. I know introducing new dependencies to this extension is unwanted, but the tradeoff could be good.
Beta Was this translation helpful? Give feedback.
All reactions