-
Notifications
You must be signed in to change notification settings - Fork 239
chore: update node and dependencies #2317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: update node and dependencies #2317
Conversation
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
🦋 Changeset detectedLatest commit: 5d7713b The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice usage of catalog feature (didn't know about it!).
I agree that migrating to ESM module is a must nowadays. Let's schedule it for 0.7!
Node.JS 24 seems tricky. The CI is having issues with the forks of So we can't support Node.JS 24 until we resolve this. @genaris @berendsliedrecht any thoughts on how to resolve this. We're depending on deprecated/forked versions of these libs. Is there another library / approach we can use for Node.JS FFI wrappers that are more modern? |
Claude recommends:
https://claude.ai/share/6a52dd6f-5d53-4aeb-bb8f-ae90d6644102 Both |
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
I reverted the Node 24 additions for now, we can look at that later (and support Node 20 and 22 for now) |
I would have to see if |
I made an example with node-ffi-rs and it works quite well. It will require quite some work again to overhaul everything (anoncreds and askar). import {
DataType,
open,
close,
define,
funcConstructor,
createPointer,
freePointer,
PointerType,
} from "ffi-rs";
open({
library: "libfanta",
path: "../rust/fanta/target/debug/libfanta.dylib",
});
const Adder = {
lhs: DataType.I32,
rhs: DataType.I32,
ffiTypeTag: DataType.StackStruct,
};
const AdderWithFunc = funcConstructor({
paramsType: [DataType.I32, DataType.I32],
retType: DataType.I32,
});
const library = define({
add: {
library: "libfanta",
paramsType: [DataType.I32, DataType.I32],
retType: DataType.I32,
},
add_with_struct: {
library: "libfanta",
paramsType: [Adder],
retType: DataType.I32,
},
add_with_callback: {
library: "libfanta",
paramsType: [DataType.I32, DataType.I32, DataType.External],
retType: DataType.I32,
runInNewThread: true,
},
});
const callback = (lhs: number, rhs: number) => {
const val = lhs + rhs;
freePointer({
paramsType: [AdderWithFunc],
paramsValue: ptr,
pointerType: PointerType.RsPointer,
});
return val;
};
const ptr = createPointer({
paramsType: [AdderWithFunc],
paramsValue: [callback],
});
void (async () => {
console.log(library.add([1, 2]));
console.log(library.add_with_struct([{ lhs: 12, rhs: 88 }]));
console.log(await library.add_with_callback([10, 50, ptr[0]]));
})();
close("libfanta"); #[repr(C)]
pub struct Adder {
lhs: i32,
rhs: i32
}
#[unsafe(no_mangle)]
pub extern "C" fn add(lhs: i32, rhs: i32) -> i32 {
lhs + rhs
}
#[unsafe(no_mangle)]
pub extern "C" fn add_with_struct(s: Adder) -> i32 {
s.lhs + s.rhs
}
#[unsafe(no_mangle)]
pub extern "C" fn add_with_callback(lhs: i32, rhs: i32, s: &unsafe extern "C" fn (lhs: i32, rhs: i32) -> i32) -> i32 {
unsafe { s(lhs, rhs) }
} This is equivalent to I think 99% of the functionality we need. |
Oh very nice!! I think we can get quite far with AI to rewrite the native modules if we have the needed scaffolding and examples and provide it with the current ffi wrapper. We do need to think what to do with indy-vdr as it will give issues. Should we not make it available starting from node 24? So it can be used with node 20/22 only? Should we move it to another repo at some point if we can't make it work with all versions anymore? cc @swcurran |
Yeah I think that that is likely. We sadly don't have the resources to update it.
I think we can mark it as deprecated if no one is willing to pick it up. And also remove it from the release pipeline. |
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
879ed2c
into
openwallet-foundation:main
…ndation#2317)" This reverts commit 879ed2c.
…2317) Signed-off-by: Timo Glastra <timo@animo.id>
…2317) Signed-off-by: Timo Glastra <timo@animo.id> Signed-off-by: Ariel Gentile <gentilester@gmail.com>
This PR:
Not all dependencies are updated, as some require a bit more work (such as epxress 4 to 5), or require ESM (i would still like to transform Credo to ESM only as well, as it seems to be more and more packages are ESM only. Maybe for 0.7).
I also updated pnpm and moved all deps that are used multiple times to the catalog, so we can ensure all packages are in sync.
It seems the pnpm-lock was cleaned up quite a bit, probably due to updating (so all packages are more aligned) and the catalog