Releases: precor/web-api-bridge
Updated to core-js 3
Fixed logging bug in listener function
- If the listener was active then console.log() had potential to keep a reference to the object and log it at some time in the future which messed up the logging of the request so the request needed to be copied instead of reused.
- Typescript support was also updated and Flow support was dropped.
- Code was cleaned up with prettier
Reduced node package size and updated webapp-library example
The examples folder and a couple of other details were missed in the .nmpignore file leading to an unnecessarily large package. The webapp-library example was updated to use v2.1.1, other new packages and changed in a way that would allow for better scaling the 'setCallback()' implementation across apis.
Update to pass on promise rejects as Error objects instead of response objects
When the parent app rejected a promise api, via reject() or throw, it typically throws an Error. Prior to this release the web-api-bridge would pass the reject message property as an error property in the response object that was passed to the child. With this release the promise is rejected as an error with a message that corresponds to the reject Error from the parent.
API search change
Breaks compatibility in rare circumstances by finding the first instance of a function in a list of apis instead of the last. Functions are also now considered non-existent if their property is falsy vs explicitly undefined. These changes make the code cleaner and allow an implementation to reserve unused functions by setting their value to null
, a technique illustrated in the newly added webapp-library
example.