Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

Update got to the latest version 🚀 #13

Merged
merged 1 commit into from Aug 4, 2018

Conversation

greenkeeper[bot]
Copy link
Contributor

@greenkeeper greenkeeper bot commented Aug 4, 2018

Version 9.0.0 of got was just published.

Dependency got
Current Version 8.3.2
Type dependency

The version 9.0.0 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.

It might be worth looking into these changes and trying to get this project onto the latest version of got.

If you have a solid test suite and good coverage, a passing build is a strong indicator that you can take advantage of these changes directly by merging the proposed change into your project. If the build fails or you don’t have such unconditional trust in your tests, this branch is a great starting point for you to work on the update.


Release Notes v9.0.0

Got version 9 is a massive release! Many new awesome features and we have pretty much fixed all the open issues regarding Got bugs on the issue tracker.

Breaking changes

  • Requires Node.js 8.
    You might ask, why not follow the Node.js LTS cycle and target Node.js 6. In short, async/await and WHATWG URL, which enabled us to simplify the codebase and reduce the dependency-tree considerably. Got v8 is a stable release, and you can continue using that if you need to support Node.js 6.
  • The retry functionality was rewritten to improve its reliability and to support retrying on HTTP status codes. Previously, it only retried on some network failures. 98b5664
    The option was renamed from retries to retry and it now accepts either a number of retries or an object with the ability to specify the number of retries, HTTP status codes and methods to retry on, and a function to decide how to retry. See the docs for more.
    Migration:
    - { retries: 4 } → { retry: 4 }
    - { retries: () => { … } } → { retry: { retries: () => { … } } }
  • Renamed the .canceled property to .isCanceled. 00fdeea
  • Dropped support for the body option being an Array when form: true. dfe5b1c
    The built-in new URLSearchParams() API doesn't support this either and it's a weird use-case. If you need support for this, just don't set form: true and handle stringifying yourself.

Improvements

  • Fewer dependencies!
  • The timeout option was rewritten to be more reliable and flexible. You can now set a timeout for every phase of the request if you want, or just for the whole request. That's up to you. da4f236
  • Added got.extend() which lets you easily create instances of Got with some options overridden. bc41a49
  • Added got.create() which is a more advanced and powerful version of got.extend(). With this API, you can create your own niche-specific instance of Got, for example, an HTTP-client for GitHub. bc41a49
  • Added a beforeRequest hook. 107756f
  • Added request and response events to the Promise API. e86aad7
  • The content-length header is now also automatically set if the body option is set to a fs.createReadStream instance. 6e7a455
  • You can now remove the default user-agent header by passing in 'user-agent': null as a header. e473a26
  • The body option can now be any kind of object, not just a plain object. 7a49ce7

Bug fixes

  • Fixed a problem with the cache not working when using the query option. 07a91cc
  • Less unhandled errors (Hopefully none!). f621184
  • Headers are now correctly proxied when you pipe got.stream(). 83bc44c
  • Lots of more bug fixes.

Other

  • 100% code coverage! Doing this caught a couple of bugs, so definitely worth doing even if 100% doesn't mean bug-free.
  • The codebase was significantly refactored for better readability and maintainability. b54b680

Team

Welcome @szmarczak and @brandon93s as maintainers 🎉

Special shoutout to @jstewmon for helping us with many of the above improvements and fixes 🙌

All changes

v8.3.2...v9.0.0

Commits

The new version differs by 74 commits ahead by 74, behind by 2.

  • 3a145c0 9.0.0
  • bf3c463 Fix readme Highlights link to retry option
  • ba0cb0d Unify calculating content-length (#544)
  • 5c3adba Increase coverage (#543)
  • 10d22b7 Increase coverage (#542)
  • 99dbd97 Fix the behaviour of proxying headers
  • 4d92eb6 Ignore JSON option when using got.stream() (#541)
  • 6ba9e68 Fix the description of the next() function
  • bf206ca Don't recommend setting user-agent to undefined
  • 80a02fe Update readme links to Electron-related issues
  • af5c3fd Improve merging options (#539)
  • d369b08 Make got.mergeOptions() behavior more obvious and document its behavior (#538)
  • 6d654fa Drop ESOCKETTIMEDOUT error
  • da7f055 Add timeout for secureConnect event for HTTPS requests (#536)
  • 9d87e9f Document TimeoutError

There are 74 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 🌴

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.333% when pulling 1fdadbc on greenkeeper/got-9.0.0 into fc4b758 on master.

@Kikobeats Kikobeats merged commit eaf6aad into master Aug 4, 2018
@greenkeeper greenkeeper bot deleted the greenkeeper/got-9.0.0 branch August 4, 2018 09:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants