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.
- When composing your RPC handler you can optionally pass an dependencies to be exposed to all RPC methods. See the README section on "Dependency Injection" for more details. This support is optional and existing usage will continue to function.
buffer-rpc
can now receive calls in the form ofendpoint/:methodName
to allow for clearer debugging and tracing (e.g., in Chrome DevTools and DataDog). The previous method of passing the name to the RPC endpoint as one of the JSON body parameters is still supported but the method name in the URI takes precedence.
To upgrade your application do the following:
- In your server, upgrade
@bufferapp/buffer-rpc
to version1.0.0
. - If your front-end app uses
@bufferapp/async-data-fetch
then upgrade that to version2.0.0
. - If your front-end uses the RPC Client directly, then upgrade
@bufferapp/micro-rpc-client
to version1.0.0
. - In your express server, change the route handler for your RPCs to support the new
:method
wildcard. For example, from this:
// ❌
app.post('/rpc', checkToken, rpcHandler, errorMiddleware);
To this:
// ✅
app.post('/rpc/:method?', checkToken, rpcHandler, errorMiddleware);
- If you have a
checkToken
method as in the one above, you'll also need to update that. From this:
// ...
module.exports = (req, res, next) => {
const { name } = req.body;
To this:
// ...
module.exports = (req, res, next) => {
const name = req.params.method ? req.params.method : req.body.name;
- Integration tests for micro-rpc-client error handling
- README update
- Error handler middleware
- Optional custom error code
- Initial public release