Long time no see! The latest Got version (v11.8.2) was released just in February ❄️
We have been working hard on squashing bugs and improving overall experience.
While working with streams, we encountered more Node.js bugs that needed workarounds.
In order to keep our code clean, we had to drop Node.js v12 as the code would get more messy.
We strongly recommend that you update Node.js to v14 LTS.
HTTP/2 support
Every Node.js release, the native http2 module gets more stable.
Unfortunately there are still some issues on the Node.js side, so we decided to keep HTTP/2 disabled for now.
We may enable it by default in Got v13. It is still possible to turn it on via the http2 option.
To run HTTP/2 requests, it is required to use Node.js v15.10 or above.
Bug fixes
Woah, we possibly couldn't make a release if we didn't fix some bugs!
Do not throw on custom stack traces (#1491) 49c16ee
Remove automatic content-length on ReadStream (#1510) 472b8ef
Got exports an Option class that is specifically designed to parse and validate Got options.
It is made of setters and getters that provide fast normalization and more consistent behavior.
When passing an option does not exist, Got will throw an error. In order to retrieve the options before the error, use error.options.
The init hook now accepts a second argument: self, which points to an Options instance.
In order to define your own options, you have to move them to options.context in an init hook or store them in options.context directly.
The init hooks are ran only when passing an options object explicitly.
- await got('https://example.com'); // this will *not* trigger the init hooks+ await got('https://example.com', {}); // this *will** trigger init hooks
options.merge() replaced got.mergeOptions and Request.normalizeArguments
The options argument has been removed, however it's still accessible via error.options. All modifications on error.options will be reflected in the next requests (no behavior change, same as with Got 11).
The beforeRedirect hook's first argument (options) is now a cloned instance of the Request options.
This was done to make retrieving the original options possible: plainResponse.request.options.
await got('http://szmarczak.com', {
hooks: {
beforeRedirect: [
(options, response) => {
- console.log(options === response.request.options); //=> true [invalid! our original options were overriden]+ console.log(options === response.request.options); //=> false [we can access the original options now]
}
]
}
})
The redirect event now takes two arguments in this order: updatedOptions and plainResponse.
When passing a url option when paginating, it now needs to be an absolute URL - the prefixUrl option is always reset from now on. The same when retrying in an afterResponse hook.
- return {url: '/location'};+ return {url: new URL('/location', response.request.options.url)};
There was confusion around the prefixUrl option. It was counterintuitive if used with the Pagination API. For example, it worked fine if the server replied with a relative URL, but if it was an absolute URL then the prefixUrl would end up duplicated. In order to fix this, Got now requires an absolute URL - no prefixUrl will be applied.
got.extend(…) will throw when passing some options that don't accept undefined - undefined no longer retains the old value, as setting undefined explicitly may reset the option
Documentation
We have redesigned the documentation so it's easier to navigate and find exactly what you are looking for. We hope you like it ❤️
You don't seem to have any Continuous Integration service set up!
Without a service that will test the Depfu branches and pull requests, we can't inform you if incoming updates actually work with your app. We think that this degrades the
service we're trying to provide down to a point where it is more or less meaningless.
This is fine if you just want to give Depfu a quick try. If you want to really let Depfu help you keep your app up-to-date, we recommend setting up a CI system:
* [Circle CI](https://circleci.com), [Semaphore ](https://semaphoreci.com) and [Travis-CI](https://travis-ci.com) are all excellent options.
* If you use something like Jenkins, make sure that you're using the Github integration correctly so that it reports status data back to Github.
* If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with `depfu/`.
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.
All Depfu comment commands
@depfu rebase
Rebases against your default branch and redoes this update
@depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@depfu close
Closes this PR and deletes the branch
@depfu reopen
Restores the branch and reopens this PR (if it's closed)
@depfu pause
Ignores all future updates for this dependency and closes this PR
@depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)
Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.
What changed?
✳️ got (11.8.3 → 12.0.2) · Repo
Release Notes
12.0.2
12.0.1
12.0.0
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
👉 No CI detected
You don't seem to have any Continuous Integration service set up!
Without a service that will test the Depfu branches and pull requests, we can't inform you if incoming updates actually work with your app. We think that this degrades the service we're trying to provide down to a point where it is more or less meaningless.
This is fine if you just want to give Depfu a quick try. If you want to really let Depfu help you keep your app up-to-date, we recommend setting up a CI system:
* [Circle CI](https://circleci.com), [Semaphore ](https://semaphoreci.com) and [Travis-CI](https://travis-ci.com) are all excellent options. * If you use something like Jenkins, make sure that you're using the Github integration correctly so that it reports status data back to Github. * If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with `depfu/`.Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with
@depfu rebase
.All Depfu comment commands