posit-dev / posit-dev/positron

Ark: Switch to using a real reqwest `Client` rather than ad hoc `get()` requests

Open
#4,130 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement lang: r
Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 11h
Merged PRs (30d)
206

Description

See this NOTE on reqwest::get()

Screenshot 2024-07-23 at 2 53 37 PM

We don't make a massive amount of help calls, but we do perform repeated calls for a single help request (to get katex, R.css, etc) so we should probably switch to an external Client. It will probably make it a little faster.

I imagine it can be owned by HelpProxy, and maybe we can give out a clone of it to AppState to be used within proxy_request(). A Client is a wrapper around an Arc<> so its cheap to clone https://docs.rs/reqwest/latest/reqwest/struct.Client.html

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading HelpProxy, AppState, and proxy_request(), then review the reqwest::Client documentation linked in the issue. Trace the repeated help calls for katex and R.css and determine where one client can be owned and cheaply cloned. Done means those calls use a shared external Client rather than ad hoc reqwest::get() requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.