mirror of
https://github.com/zkitter/json-rpc-engine.git
synced 2026-01-10 07:37:54 -05:00
This PR updates various repository features for module template compliance. This repository should be fully compliant as of this PR, except for tests, which will be addressed in a follow-up. Notable changes include: - Updates the ESLint config and related dependencies - Adds `@lavamoat/allow-scripts` and the `setup` package script - Migrates from CircleCI to GitHub Actions - Bumps the minimum Node version to 14
4.0 KiB
4.0 KiB
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
Added
isJsonRpcSuccessandisJsonRpcFailuretype guard utilities (#91)- JSON-RPC ID validation utility and type guard, via
getJsonRpcIdValidator(#91)
Changed
- (BREAKING) Return a
nullinstead ofundefinedresponseidfor malformed request objects (#91)- This is very unlikely to be breaking in practice, but the behavior could have been relied on.
6.1.0 - 2020-11-20
Added
- Add
PendingJsonRpcResponseinterface for use in middleware (#75)
Changed
- Use
async/awaitandtry/catchinstead of Promise methods everywhere (#74)- Consumers may notice improved stack traces on certain platforms.
6.0.0 - 2020-11-19
Added
- Add docstrings for public
JsonRpcEnginemethods (#70)
Changed
- (BREAKING) Refactor exports (#69)
- All exports are now named, and available via the package entry point.
- All default exports have been removed.
- (BREAKING) Convert
asMiddlewareto instance method (#69)- The
asMiddlewareexport has been removed.
- The
- (BREAKING) Add runtime typechecks to
JsonRpcEngine.handle(), and error responses if they fail (#70)- Requests will now error if:
- The request is not a plain object, or if the
methodproperty is not astring. Empty strings are allowed. - A
nextmiddleware callback is called with a truthy, non-function parameter.
- The request is not a plain object, or if the
- Requests will now error if:
- Migrate to TypeScript (#69)
- Hopefully improve stack traces by removing uses of
Promise.thenand.catchinternally (#70) - Make some internal
JsonRpcEnginemethodsstatic(#71)
5.4.0 - 2020-11-07
Changed
5.3.0 - 2020-07-30
Changed
- Response object errors no longer include a
stackproperty
5.2.0 - 2020-07-24
Added
- Promise signatures for
engine.handle(#55)- So, in addition to
engine.handle(request, callback), you can do e.g.await engine.handle(request).
- So, in addition to
Changed
- Remove
asyncandpromise-to-callbackdependencies- These dependencies were used internally for middleware flow control.
They have been replaced with Promises and native
async/await, which means that some operations are no longer eagerly executed. This change may affect consumers that depend on the eager execution of middleware during request processing, outside of middleware functions and request handlers.- In general, it is a bad practice to work with state that depends on middleware execution, while the middleware are executing.
- These dependencies were used internally for middleware flow control.
They have been replaced with Promises and native