Version 4.0.0-alpha.2
Pre-release
Pre-release
·
639 commits
to master
since this release
Minor
- Transpile and polyfill for Node.js v6.10+ (down from v7.6+) to support AWS Lambda, fixing #33.
- Modular project structure that works better for native ESM.
- Added tests.
- Set up Travis to test using the latest stable Node.js version and the oldest supported in
package.jsonengines(v6.10). - Added a Travis readme badge.
- Improved error handling, fixing #26:
- Custom errors are thrown or emitted with meaningful messages that are exported so consumers can use
instanceofwith them. - Where it makes sense, errors cause relevant HTTP status codes to be set in middleware.
- Misordered multipart fields cause
processRequestto throwMapBeforeOperationsUploadErrorandFilesBeforeMapUploadErrorerrors in middleware. - The
mapfield provided by the client is used to naively check themaxFilesoption is not exceeded for a speedyMaxFilesUploadErrorerror in middleware. The real number of files parsed is checked too, incase the request is malformed. - If files are missing from the request the
scalar Uploadpromises reject with aFileMissingUploadErrorerror. - Already if a file exceeds the
maxFileSizeoption the file is truncated, the stream emits alimitevent andstream.truncated === true. Now anerrorevent is also emitted with aMaxFileSizeUploadError. - Aborting requests from the client causes
scalar Uploadpromises to reject with aUploadPromiseDisconnectUploadErrorerror for file upload streams that have not yet been parsed. For streams being parsed anerrorevent is emitted with anFileStreamDisconnectUploadErrorerror andstream.truncated === true. It is up to consumers to cleanup aborted streams in their resolvers.
- Custom errors are thrown or emitted with meaningful messages that are exported so consumers can use
Patch
- Updated dependencies.
- Smarter Babel config with
.babelrc.js. - Refactor to use fewer Busboy event listeners.