fix(deps): update dependency got to v11 #1731
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^10.0.0->^11.0.0^10.0.0->^11.0.0Release Notes
sindresorhus/got
v11.0.1Compare Source
Fixed two regressions:
HTTPErrors have unspecified response body (#1162)Improved TypeScript types for errors inherited from
RequestErrorv11.0.0Compare Source
Introducing Got 11! 🎉 The last major version was in December last year. ❄️ Since then, a huge amount of bugs has been fixed. There are also many new features, for example, HTTP2 support is finally live! 🌐
If you find Got useful, you might want to sponsor the Got maintainers.
Breaking changes
Removed support for
electron.netDue to the inconsistencies between the Electron's
netmodule and the Node.jshttpmodule, we have decided to officially drop support for it. Therefore, theuseElectronNetoption has been removed.You'll still be able to use Got in the Electron main process and in the renderer process through the
electron.remotemodule or if you use Node.js shims.The Pagination API is now stable
We haven't seen any bugs yet, so please give it a try!
If you want to leave some feedback, you can do it here. Any suggestion is greatly appreciated!
{ - _pagination: {...} + pagination: {...} }API
options.encodingbehavior has been reverted back to the Got 9 behavior.In other words, the options is only meant for the Got promise API.
To set the encoding for streams, simply call
stream.setEncoding(encoding).GotErrorhas been renamed toRequestErrorfor better readability and to comply with the documentation.agentoption now accepts only an object withhttp,httpsandhttp2properties.While the
httpandhttpsproperties accept nativehttp(s).Agentinstances, thehttp2property must be an instance ofhttp2wrapper.Agentor be undefined.{ - agent: new https.Agent({keepAlive: true}) } { + agent: { + http: new http.Agent({keepAlive: true}), + https: new https.Agent({keepAlive: true}), + http2: new http2wrapper.Agent() + } }dnsCacheoption is now set to a default instance ofCacheableLookup. It cannot be aMap-like instance anymore. The underlyingcacheable-lookuppackage has received many improvements, for example, it has receivedhostsfile support! Additionally, thecacheAdapteroption has been renamed tocache. Note that it's no longer passed to Keyv, so you need to pass a Keyv instance it if you want to save the data for later.{ - dnsCache: new CacheableLookup({ - cacheAdapter: new Map() - }) } { + dnsCache: new CacheableLookup({ + cache: new Keyv({ + cacheAdapter: new Map() + }) + }) } // Default: { dnsCache: new CacheableLookup() }inithooks will be converted to instances ofRequestError.RequestErrors provide much more useful information, for example, you can access the Got options (througherror.options), which is very useful when debugging.inithook may not have aurlproperty. To modify the request URL you should use abeforeRequesthook instead.{ hooks: { - init: [ + beforeRequest: [ options => { options.url = 'https://sindresorhus.com'; } ] } }Note that this example shows a simple use case. In more complicated algorithms, you need to split the
inithook into anotherinithook and abeforeRequesthook.error.requestproperty is no longer aClientRequestinstance. Instead, it gives a Got stream, which provides a set of useful properties.Renamed TypeScript types
Some of the TypeScript types have been renamed to improve the readability:
ResponseObjectResponseDefaultsInstanceDefaultsDefaultOptionsDefaultsDefaultRetryOptionsRequiredRetryOptionsGotOptionsOptionsGotRequestMethodGotRequestFunctionHTTP2 support is here! Excited? Yay! Unfortunately, it's off by default to make the migration smoother. Many Got users have set up their own Agents and we didn't want to break them. But fear no more, it will come enabled by default in Got 12.
mergefunction is slow (#1016)error.codeinstead oferror.messageto compare errors (#981)inithook tobeforeErrorhook (#929)+in query strings (#1113)got.stream(...)(#1129)error.requesta Got stream (af0b147).Known bugs
timingsmay indicate that the request was successful although it failed.downloadProgressobject may show incorrect data.Bug fixes
beforeRequesthooks aren't called on redirects (#994)stream.pipeline(got.stream(...), ...)(#1026)cachealong with thebodyoption (#1021)got.mergeOptions(...)doesn't mergeURLSearchParamsinstances (#1011)authorizationheader is leaking (#1090)resolveBodyOnlyoption (#1140)beforeRetryhooks are missingoptions.context(#1141)promise.json()doesn't throwParseError(#1069)[email protected](#1131)cacheoption in a Got instance (#1098)cache(#1128)All changes
Renovate configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻️ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by WhiteSource Renovate. View repository job log here.