Skip to content

Conversation

@jpinkney-aws
Copy link
Contributor

Problem

  • Resource fetcher currently only works on node. This causes some implements to use got directly, some use fetch directly, some use httpResourceFetcher depending on their use case

Solution

  • Make HttpResourceFetcher platform independent so it can run on node + web
  • Move the streaming based HttpResourceFetcher to a node specific folder

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jpinkney-aws jpinkney-aws requested a review from a team as a code owner January 16, 2025 15:50
@github-actions
Copy link

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.

import * as http from 'http'
import * as https from 'https'
import * as stream from 'stream'
import got, { RequestError } from 'got'
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need a node-only version? We are trying to eliminate "got" entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IIRC @nkomonen-amazon mentioned that fs streams from fetch weren't compatible with fs streams from node yet. Right now this will limit got to this single file until things are compatible and then I can remove all the other references of got

Copy link
Contributor

Choose a reason for hiding this comment

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

From an old Web quip:


/**
* Legacy HTTP Resource Fetcher used specifically for streaming information.
* If you do not need streaming or want multi platform support use
Copy link
Contributor

@justinmk3 justinmk3 Jan 16, 2025

Choose a reason for hiding this comment

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

this comment may not be wanted if we are planning to use httpResourceFetcher as an abstraction (and later improve it)


// XXX: patched Got module for compatability with older VS Code versions (e.g. Cloud9)
// `got` has also deprecated `urlToOptions`
const patchedGot = got.extend({
Copy link
Contributor

Choose a reason for hiding this comment

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

patchedGot is removed in max's pr #6376

@jpinkney-aws jpinkney-aws merged commit 49fb090 into aws:master Jan 17, 2025
16 of 17 checks passed
@jpinkney-aws jpinkney-aws deleted the resourceFetcher branch January 17, 2025 15:41
karanA-aws pushed a commit to karanA-aws/aws-toolkit-vscode that referenced this pull request Jan 17, 2025
## Problem
- Resource fetcher currently only works on node. This causes some
implements to use got directly, some use fetch directly, some use
httpResourceFetcher depending on their use case

## Solution
- Make HttpResourceFetcher platform independent so it can run on node +
web
- Move the streaming based HttpResourceFetcher to a node specific folder

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
kevluu-aws pushed a commit to kevluu-aws/aws-toolkit-vscode that referenced this pull request Jan 23, 2025
## Problem
- Resource fetcher currently only works on node. This causes some
implements to use got directly, some use fetch directly, some use
httpResourceFetcher depending on their use case

## Solution
- Make HttpResourceFetcher platform independent so it can run on node +
web
- Move the streaming based HttpResourceFetcher to a node specific folder

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
chungjac pushed a commit to chungjac/aws-toolkit-vscode that referenced this pull request Jan 24, 2025
## Problem
- Resource fetcher currently only works on node. This causes some
implements to use got directly, some use fetch directly, some use
httpResourceFetcher depending on their use case

## Solution
- Make HttpResourceFetcher platform independent so it can run on node +
web
- Move the streaming based HttpResourceFetcher to a node specific folder

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
s7ab059789 pushed a commit to s7ab059789/aws-toolkit-vscode that referenced this pull request Feb 19, 2025
## Problem
- Resource fetcher currently only works on node. This causes some
implements to use got directly, some use fetch directly, some use
httpResourceFetcher depending on their use case

## Solution
- Make HttpResourceFetcher platform independent so it can run on node +
web
- Move the streaming based HttpResourceFetcher to a node specific folder

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
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.

3 participants