Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from using custom HTTP client caching to
make-fetch-happen
.
This is a similar treatment as to what was applied to `@apollo/gateway` in #3783. This replaces a local HTTP cache implementation which continues to grow in complexity with an off-the-shelf Fetch API client with many valuable bells and whistles. In particular, it uses `make-fetch-happen`, which is a relatively full-featured Node.js based implementation which is used by `npm` itself and leverages `minipass-fetch` under the hood. This leverages the same cache implementation used in `@apollo/gateway` and duplicates that cache logic. It's entirely possible we would be well-served to use the `cache.js` example that's included in the source of `make-fetch-happen` and leverages `cacache`, but as of this message, it doesn't include the TypeScript types and this implementation seems to work. This does remove a test which was previously valuable but should no longer be necessary. Specifically, sine we now have an HTTP implementation that handles caching and retries itself, we do handle intermediary retries within that layer. We still test the polling (i.e, the literal existence of an interval which re-fires) in other tests, but it was too tricky to try to re-jigger this test with the abstraction. I think this is a good thing to not need to worry about, but we can consider re-adding it in the event of regressions. Ref: https://npm.im/make-fetch-happen Ref: https://npm.im/minipass-fetch Ref: https://npm.im/cacache Ref: https://github.com/npm/make-fetch-happen/blob/b04c4c16/cache.js
- Loading branch information