posit-dev / posit-dev/positron
R: Provide a way to register R RPCs from the R extension
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.3k
- Forks
- 184
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 206
Description
Today, if you want to call R from the R extension, it is easier than it used to be, but still a real chore. You must:
- write the implementation in one of the R files in the
amaltheaproject (e.g.: https://github.com/posit-dev/amalthea/pull/194) - get it reviewed and merged into
main - bump the
amaltheaversion - wait for successful build
- coordinate a merge into
positron
Not only is this a lot of paperwork, it also creates unnecessary coupling between Positron and ark: because the RPC invocation and implementation live in different repositories, it is much easier for them to be out of sync (e.g. parameters or return types mismatched).
I propose that we:
- add a
registerRpcmethod to ark that can be called in https://github.com/posit-dev/positron/blob/main/extensions/positron-r/resources/scripts/startup.R. - define RPCs in the R extension itself rather than in ark's R modules
In this way, we can keep some RPC invocations and implementations in the same repository, and reduce some coupling and paperwork when working on code with feet in both worlds.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed call site in positron-r/resources/scripts/startup.R and inspect how ark currently defines and invokes R RPCs. Determine the registration API and repository boundaries needed to keep definitions and implementations in the R extension; done means an R extension can register and invoke its own RPCs without changes to ark's R modules or a coordinated amalthea release.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100