refactor: migrate from ffi-napi to koffi for foreign function calls (CON-304) #203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As described in issue #198, the javascript connector is no longer compatible with newer versions of
Node
due to the ffi-napi package not being compatible.ffi-nap seems no longer being maintained given that the last contribution is from more than two years ago.
An alternative package that provides similar functionallity is koffi. The syntax is very similar to
ffi-napi
and is currently actively being maintained.This MR migrates from
ffi-napi
tokoffi
library, removing the need for the incompatibleffi-napi
package.I have tested these changes with v1.3.0 and v1.2.2 of the RTIConnextDDS-Connector i.c.w. v20.13.1 of Node on Linux. The examples work as expected and all tests in the test suite pass.
I don't have access to your CI pipelines, so would be great if you could run them on other Node versions and other platforms as well.
In terms of API there are two changes:
api
object inside the_ConnectorBinding
, but are direct methods inside the_ConnectorBinding
class1
or0
Please let me know if you are willing to accept this change or what would need to change to get this in.