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.0
Release Notes
sindresorhus/got
v11.0.1
Compare Source
Fixed two regressions:
HTTPError
s have unspecified response body (#1162)Improved TypeScript types for errors inherited from
RequestError
v11.0.0
Compare 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.net
Due to the inconsistencies between the Electron's
net
module and the Node.jshttp
module, we have decided to officially drop support for it. Therefore, theuseElectronNet
option has been removed.You'll still be able to use Got in the Electron main process and in the renderer process through the
electron.remote
module 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!
API
options.encoding
behavior 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)
.GotError
has been renamed toRequestError
for better readability and to comply with the documentation.agent
option now accepts only an object withhttp
,https
andhttp2
properties.While the
http
andhttps
properties accept nativehttp(s).Agent
instances, thehttp2
property must be an instance ofhttp2wrapper.Agent
or be undefined.dnsCache
option is now set to a default instance ofCacheableLookup
. It cannot be aMap
-like instance anymore. The underlyingcacheable-lookup
package has received many improvements, for example, it has receivedhosts
file support! Additionally, thecacheAdapter
option 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.init
hooks will be converted to instances ofRequestError
.RequestError
s provide much more useful information, for example, you can access the Got options (througherror.options
), which is very useful when debugging.init
hook may not have aurl
property. To modify the request URL you should use abeforeRequest
hook instead.Note that this example shows a simple use case. In more complicated algorithms, you need to split the
init
hook into anotherinit
hook and abeforeRequest
hook.error.request
property is no longer aClientRequest
instance. 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:
ResponseObject
Response
Defaults
InstanceDefaults
DefaultOptions
Defaults
DefaultRetryOptions
RequiredRetryOptions
GotOptions
Options
GotRequestMethod
GotRequestFunction
HTTP2 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.
merge
function is slow (#1016)error.code
instead oferror.message
to compare errors (#981)init
hook tobeforeError
hook (#929)+
in query strings (#1113)got.stream(...)
(#1129)error.request
a Got stream (af0b147
).Known bugs
timings
may indicate that the request was successful although it failed.downloadProgress
object may show incorrect data.Bug fixes
beforeRequest
hooks aren't called on redirects (#994)stream.pipeline(got.stream(...), ...)
(#1026)cache
along with thebody
option (#1021)got.mergeOptions(...)
doesn't mergeURLSearchParams
instances (#1011)authorization
header is leaking (#1090)resolveBodyOnly
option (#1140)beforeRetry
hooks are missingoptions.context
(#1141)promise.json()
doesn't throwParseError
(#1069)[email protected]
(#1131)cache
option 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.