-
Notifications
You must be signed in to change notification settings - Fork 751
refactor(core): Make HttpResourceFetcher platform agnostic #6379
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
Conversation
|
| import * as http from 'http' | ||
| import * as https from 'https' | ||
| import * as stream from 'stream' | ||
| import got, { RequestError } from 'got' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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:
- Node.js has their own Stream implementation
- Browser/Web uses a different Streams API (implements the WHATWG Streams Standard)
- Though this is supported in Node 21+ and 'got' could technically update to this API
|
|
||
| /** | ||
| * Legacy HTTP Resource Fetcher used specifically for streaming information. | ||
| * If you do not need streaming or want multi platform support use |
There was a problem hiding this comment.
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({ |
There was a problem hiding this comment.
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
## 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.
## 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.
## 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.
## 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.
Problem
Solution
feature/xbranches will not be squash-merged at release time.