The Advent of N-API
API CHANGES:
- In QML, use
eventEmit(...)instead ofcb.call(...). qml.invoke(name, key, args)now takesargsas anArrayand passes positional arguments into the QML function. Also the key+args.length bundle is now a signature, so you should pass EXACTLY the number of arguments function expects.- Class
Method, is now a callable, basically its instances arenow functions, and should be called as functions. Replacemethod.call(...)withmethod(...). qml.invoke(name, key, [...])andmethod.call(...)now expect JS values and convert them (to JSON strings) automatically.qml.invoke(name, key, [...])andmethod.call(...)now return values, as returned by QML.
Designed to work with Addon Tools 5. Moved GYP build step to subfolder.
Installation flow was changed.
Before: download sources, compile, remove unnecessary intermediates.
Now: download N-API binary from a Github/other release.