-
Notifications
You must be signed in to change notification settings - Fork 3
Update got to the latest version 🚀 #59
base: master
Are you sure you want to change the base?
Conversation
Update to this version instead 🚀 Release Notes for v11.0.1Fixed two regressions: Improved TypeScript types for errors inherited from |
|
|
|
|
🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! 💜 🚚💨 💚 Find out how to migrate to Snyk at greenkeeper.io
|
|
🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! 💜 🚚💨 💚 Find out how to migrate to Snyk at greenkeeper.io
|
|
🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! 💜 🚚💨 💚 Find out how to migrate to Snyk at greenkeeper.io
|
|
🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! 💜 🚚💨 💚 Find out how to migrate to Snyk at greenkeeper.io
|
|
🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! 💜 🚚💨 💚 Find out how to migrate to Snyk at greenkeeper.io
|
☝️ Important announcement: Greenkeeper will be saying goodbye 👋 and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io
The dependency got was updated from
10.7.0to11.0.0.This version is not covered by your current version range.
If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.
Publisher: sindresorhus
License: MIT
Release Notes for v11.0.0
Introducing Got 11! 🎉 The last major version was announced in December last year ❄️, by the time huge amount of bugs got fixed. Also, there are many improvements, for example HTTP2 support is finally live! 🌐
If you find Got useful, you might want to sponsor the Got maintainers.
Want to see how it's done under the hood? Feel free to review the Got Rewrite: v10.7.0...master
Breaking changes
Removed Electron support
Due to the inconsistencies beetwen the Electron's
netmodule and the Node.jshttpmodule, we have decided to officaly drop Electron support. Therefore, theuseElectronNetoption has been removed.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: {...} }// Just remove the underscore from the beginning:
{
+ pagination: {...}
}
API
options.encodingbehavior has been reverted back to the one in Got 9.In other words, it's meant only for the Got promise.
To set the encoding for streams, simply call
stream.setEncoding(encoding).GotErrorhas been renamed toRequestErrorfor better readabilityand to comply with the documentation.
agentoption now accepts only an object withhttp,httpsandhttp2properties.While the
httpandhttpsproperties accept nativehttp(s).Agentinstances,the
http2property 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 of CacheableLookup. It cannot be a Map-like instance anymore. The underlyingcacheable-lookuppackage has received many improvements, for example it has been given ahostsfile 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 types
Some of the types have been renamed to improve the readability:
ResponseObjectResponseDefaultsInstanceDefaultsDefaultOptionsDefaultsDefaultRetryOptionsRequiredRetryOptionsGotOptionsOptionsGotRequestMethodGotRequestFunctionEnhancements
HTTP2 support is here! Excited? Yay! Unfortunately it's off by default to make the migration more smooth. 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)as-promise.ts(#932)inithook tobeforeErrorhook (#929)cacheable-lookup(#1058)+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)Commits
The new version differs by 33 commits.
1f6ac4511.0.0202e1b4Minor tweaksb864dd2Fix a readme typo (#1161)6f621fdRemove moot commentsaf0b147Add arequestproperty to errorsc56c33aFix linting03f9db7Fix linting2abacffFix replacing the HTTP cache99d70dfFix shortcut methods giving wrong resulte97cf7eFix the async iterator9eb8407Follow-up commit407d597Make sure it's compatible with [email protected]bddf707Fix a typo in a comment4fd1006Fix shortcuts not throwing ParseErrors5d69522Fix the retry logicThere are 33 commits in total.
See the full diff
FAQ and help
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper bot 🌴