Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch to 'cross-fetch' instead of 'request' (#6)
* Replaces `request` with `cross-fetch`, and isomorphic fetch library - The `RequestOptions` type is a mix of the browser and `node-fetch` options, so that server-side code can set things like the `agent` for keepalive, but it should have no effect in browser code - The `lodash` dependency was removed from the `thrift-server-core` library, because all it was used for was doing "deep merges" on the client, which weren't needed. Instead, a new function to merge together request options was added, with special logic for the `Headers` values (which can't utilize object spread). - The `response.arrayBuffer()` function is used to get an `ArrayBuffer` and convert the binary response into a Node `Buffer`, which is what the generated code expects to use when sending requests through the connection. We'll need to polyfill that with Webpack, but it should be just fine. * Removed all uses of the `url.parse` and `url.format` deprecated functions and replaced them with the WHATWG URL API * Fixed a number of tests and cleaned them up with the right response types
- Loading branch information