This repository has been archived by the owner on Nov 9, 2023. It is now read-only.
Releases: MetaMask/json-rpc-engine
Releases · MetaMask/json-rpc-engine
7.2.0
7.1.1
7.1.0
7.0.0
Added
Changed
- BREAKING: Require a minimum Node version of 16 (#139)
- BREAKING: Use
@metamask/utils
types (#105)- The JSON-RPC engine and all middleware now use
@metamask/utils
JSON-RPC types
- The JSON-RPC engine and all middleware now use
- (BREAKING) Return a
null
instead ofundefined
responseid
for malformed request objects (#91)- This is very unlikely to be breaking in practice, but the behavior could have been relied on.
- Change package name to
@metamask/json-rpc-engine
(#139) - Use
@metamask/rpc-errors
(#138)
6.1.0
6.0.0
Added
- Add docstrings for public
JsonRpcEngine
methods (#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
asMiddleware
to instance method (#69)- The
asMiddleware
export 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
method
property is not astring
. Empty strings are allowed. - A
next
middleware 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.then
and.catch
internally (#70) - Make some internal
JsonRpcEngine
methodsstatic
(#71)
5.4.0
5.3.0
5.2.0
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
async
andpromise-to-callback
dependencies- These dependencies were used internally for middleware flow control.
They have been replaced with Promises and nativeasync
/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.