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

ovsx-client: Use get for querying extension data #10325

Merged
merged 1 commit into from
Oct 26, 2021
Merged

Conversation

msujew
Copy link
Member

@msujew msujew commented Oct 26, 2021

What it does

In order to improve cache-ability, a few weeks back osvx implemented the option to query extensions by using get (see eclipse/openvsx#331).

This change aligns Theia to this decision by using get instead of post requests. Additionally allows to generically stitch together url-params. (compared to the previous manual approach)

How to test

  1. Open the Extensions view
  2. When searching extensions, Theia should use get requests (confirm this using your network resources tab in your browsers dev-tools)
  3. Other features of the ovsx client should behave as normal

Review checklist

Reminder for reviewers

@msujew msujew added the vsx-registry Issues related to Open VSX Registry Integration label Oct 26, 2021
@msujew msujew requested a review from vince-fugnitto October 26, 2021 10:13
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me and work well 👍

Should we remove the following as it is currently unused?

const postJson = bent('POST', {
    'Content-Type': 'application/json',
    'Accept': 'application/json'
}, 'json', 200);
protected postJson<P, R>(url: string, payload: P): Promise<R> {
    return postJson(url, JSON.stringify(payload)) as Promise<R>;
}

@msujew msujew force-pushed the msujew/get-query-ovsx branch from 7aee217 to dbe180f Compare October 26, 2021 13:08
@msujew
Copy link
Member Author

msujew commented Oct 26, 2021

Should we remove the following as it is currently unused?

Sure, didn't notice they were unused 👍

Added an appropriate breaking change entry in the changelog.

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍
The next step would be to replace bent with a library that respects requests behind a proxy (#10267).

@msujew msujew merged commit 1811b5e into master Oct 26, 2021
@msujew msujew deleted the msujew/get-query-ovsx branch October 26, 2021 13:53
@github-actions github-actions bot added this to the 1.19.0 milestone Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vsx-registry Issues related to Open VSX Registry Integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants