Skip to content

Commit

Permalink
chore(node): try @2060.io/ffi-napi fork as alternative to original ff…
Browse files Browse the repository at this point in the history
…i-napi (#255)
erka authored Apr 27, 2024
1 parent 969c177 commit f562a7d
Showing 5 changed files with 44 additions and 51 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/lint-sdks.yml
Original file line number Diff line number Diff line change
@@ -31,15 +31,18 @@ jobs:
lint-typescript:
name: Lint Typescript
strategy:
matrix:
node-version: ['20', '21']
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v4

- name: Install Node
- name: Install Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: ${{ matrix.node-version }}

- name: Lint Typescript source
working-directory: flipt-client-node
10 changes: 0 additions & 10 deletions flipt-client-node/README.md
Original file line number Diff line number Diff line change
@@ -59,16 +59,6 @@ fliptEvaluationClient.close();

## Potential Issues

### Node v21+

If you are using Node v21 or higher, you'll likely run into issues with the `ffi-napi` library. This is due to the fact that `ffi-napi` does not seem to be compatible with Node v21+.

See: [node-ffi-napi #267](https://github.com/node-ffi-napi/node-ffi-napi/issues/267)

To work around this issue you'll need to downgrade to Node v20 or lower. :(

We plan to look into alternative ffi libraries for node in the future. See [#200](https://github.com/flipt-io/flipt-client-sdks/issues/200)

### Vitest

If you are using this library in combination with [vitest](https://github.com/vitest-dev/vitest), you may run into segmentation fault issues. This is due to the fact that `vitest` does not work nicely with `ffi-napi` by default.
70 changes: 35 additions & 35 deletions flipt-client-node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions flipt-client-node/package.json
Original file line number Diff line number Diff line change
@@ -19,8 +19,8 @@
},
"dependencies": {
"@types/ffi": "^0.2.7",
"ffi-napi": "^4.0.3",
"ref-napi": "^3.0.3"
"@2060.io/ffi-napi": "^4.0.3",
"@2060.io/ref-napi": "^3.0.3"
},
"devDependencies": {
"@types/ffi-napi": "^4.0.10",
4 changes: 2 additions & 2 deletions flipt-client-node/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as ffi from 'ffi-napi';
import { Pointer, allocCString } from 'ref-napi';
import * as ffi from '@2060.io/ffi-napi';
import { Pointer, allocCString } from '@2060.io/ref-napi';
import * as os from 'os';
import {
AuthenticationStrategy,

0 comments on commit f562a7d

Please sign in to comment.