Skip to content

v2.0.0

Compare
Choose a tag to compare
@pimterry pimterry released this 03 Jun 09:23
· 116 commits to master since this release

馃挜 Breaking changes:

  • Some unusual content encodings (notably Brotli) are no longer handled automatically when using the (now deprecated) synchronous properties. If you're using body.decodedBuffer, body.text, body.json or body.formData you should switch to the corresponding body.getX() methods instead. These methods decode content asynchronously, improving performance especially with parallel requests, and they support more encodings (including Brotli and Zstandard).
    Gzip, deflate, and unencoded content all still work both sync or async, so nothing will break in these common cases, but moving to the async functions is recommended regardless.
  • Node v10 is no longer officially supported as it's now EOL. It still works right now, but it's no longer tested, and it's likely to stop working without warning in future versions.

Other big changes:

  • For common cases, you can now automatically transform proxied content using transformRequest and transformResponse options, instead of providing your own custom beforeRequest and beforeResponse callbacks. These support completely replacing and/or updating most properties of proxied content, they make your code simpler, and in many cases they're significantly faster. The beforeX options still exist and are fully supported, but they're recommended only for advanced use cases.
  • Chaining mockttp with upstream proxies is now supported, using the proxyConfig option with passthrough rules.