Skip to content
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

refactor: require native shared components implementation #1349

Merged

Conversation

Vickysomtee
Copy link
Contributor

@Vickysomtee Vickysomtee commented Feb 27, 2023

The PR provides the guide to set up indy-vdr optional peer dependencies

Work funded by the Government of Ontario

work funded by the Government of Ontario

Signed-off-by: Victor Anene <[email protected]>
work funded by the Government of Ontario

Signed-off-by: Victor Anene <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Feb 27, 2023

Codecov Report

Merging #1349 (dad8884) into main (5559996) will increase coverage by 0.01%.
The diff coverage is 63.63%.

@@            Coverage Diff             @@
##             main    #1349      +/-   ##
==========================================
+ Coverage   85.31%   85.32%   +0.01%     
==========================================
  Files         787      788       +1     
  Lines       19404    19405       +1     
  Branches     3150     3150              
==========================================
+ Hits        16555    16558       +3     
+ Misses       2842     2840       -2     
  Partials        7        7              
Impacted Files Coverage Δ
packages/indy-vdr/src/IndyVdrModule.ts 92.30% <ø> (+14.52%) ⬆️
packages/indy-vdr/src/IndyVdrModuleConfig.ts 71.42% <0.00%> (-28.58%) ⬇️
packages/askar/src/AskarModuleConfig.ts 60.00% <60.00%> (ø)
packages/askar/src/AskarModule.ts 88.23% <100.00%> (+16.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Vickysomtee Vickysomtee marked this pull request as ready for review February 27, 2023 20:32
@Vickysomtee Vickysomtee requested a review from a team as a code owner February 27, 2023 20:32
Copy link
Contributor

@genaris genaris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few typos in the IndyVdrModuleConfig comments.

packages/indy-vdr/src/IndyVdrModuleConfig.ts Outdated Show resolved Hide resolved
packages/indy-vdr/src/IndyVdrModuleConfig.ts Show resolved Hide resolved
@Vickysomtee Vickysomtee changed the title feat: configure indy-vdr optional peer dependencies feat: add set up for indy-vdr optional peer dependencies Feb 28, 2023
Victor Anene and others added 3 commits February 28, 2023 10:03
Victor Anene and others added 5 commits February 28, 2023 11:17
work funded by the Government of Ontario

Signed-off-by: Victor Anene <[email protected]>
work funded by the Government of Ontario

Signed-off-by: Victor Anene <[email protected]>
work funded by the Government of Ontario

Signed-off-by: Victor Anene <[email protected]>
Victor Anene added 4 commits March 3, 2023 08:05
work funded by the Government of Ontario

Signed-off-by: Victor Anene <[email protected]>
work funded by Government of Ontario

Signed-off-by: Victor Anene <[email protected]>
work funded by Government of Ontario

Signed-off-by: Victor Anene <[email protected]>
demo/package.json Outdated Show resolved Hide resolved
demo/src/BaseAgent.ts Outdated Show resolved Hide resolved
packages/anoncreds/src/AnonCredsModuleConfig.ts Outdated Show resolved Hide resolved
packages/askar/src/AskarModule.ts Outdated Show resolved Hide resolved
packages/askar/src/AskarModule.ts Outdated Show resolved Hide resolved
packages/askar/src/AskarModuleConfig.ts Outdated Show resolved Hide resolved
packages/core/package.json Outdated Show resolved Hide resolved
packages/indy-vdr/src/__tests__/IndyVdrModule.test.ts Outdated Show resolved Hide resolved
packages/anoncreds/package.json Outdated Show resolved Hide resolved
Victor Anene added 2 commits March 7, 2023 19:59
work funded by the Government of Ontario

Signed-off-by: Victor Anene <[email protected]>
work funded by the Government of Ontario

Signed-off-by: Victor Anene <[email protected]>
Copy link
Contributor

@TimoGlastra TimoGlastra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some final comments

packages/askar/src/AskarModule.ts Outdated Show resolved Hide resolved
packages/askar/src/AskarModuleConfig.ts Outdated Show resolved Hide resolved
Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
@TimoGlastra
Copy link
Contributor

TimoGlastra commented Mar 11, 2023

Yeah it has to be something with this branch. All other PRs have no issues with CI

We switched indy-vdr from v9 to v10 in this branch. Let's see if it resolves the issue if we downgrade.

@TimoGlastra TimoGlastra disabled auto-merge March 11, 2023 13:12
@genaris
Copy link
Contributor

genaris commented Mar 11, 2023

Yeah it has to be something with this branch. All other PRs have no issues with CI

We switched indy-vdr from v9 to v10 in this branch. Let's see if it resolves the issue if we downgrade.

D'oh haven't seen this and I upgraded again to v10 in #1373 😞. Anyway, there it worked fine at the first try.

@TimoGlastra
Copy link
Contributor

Yeah seems that downgrading didn't do the trick. So it's something else, which is weird!?!?

Or maybe it's because we're now importing the node.js modules more often, which results in the memory issues?

import '../src/index'

require('@hyperledger/indy-vdr-nodejs')
import '@hyperledger/indy-vdr-nodejs'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These imports in tests' setup.ts are not needed anymore, are they?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are! Some tests don't use the module (e.g. IndyVdrSovDidResolver.test.ts), but do use the binary. It will result in the binary not being registered on the shared package if you run the test (mainly in isolation).

I first started importing the nodejs bindings in these specific files, but I thought why make it more complex than needs to be and just imported it in the setup

@genaris
Copy link
Contributor

genaris commented Mar 11, 2023

Yeah seems that downgrading didn't do the trick. So it's something else, which is weird!?!?

Or maybe it's because we're now importing the node.js modules more often, which results in the memory issues?

This is absolutely possible, as in the wrappers we only provide a method to load libraries but not free resources used by them (which is certainly a bug, unless the runtime is freeing them automatically... which is not usually the case from our recent experience). ffi-napi provides ways to unload libraries, so I'll dig a bit more on it to see how it works and if we can solve it in a relatively easy way.

@TimoGlastra
Copy link
Contributor

Yeah seems that downgrading didn't do the trick. So it's something else, which is weird!?!?
Or maybe it's because we're now importing the node.js modules more often, which results in the memory issues?

This is absolutely possible, as in the wrappers we only provide a method to load libraries but not free resources used by them (which is certainly a bug, unless the runtime is freeing them automatically... which is not usually the case from our recent experience). ffi-napi provides ways to unload libraries, so I'll dig a bit more on it to see how it works and if we can solve it in a relatively easy way.

We should maybe add a check and see if it's already loaded, and if so, don't load it again. I wouldn't expect importing a package multiple times has implications. If you're working in Node.JS you could only work with the Node.JS package, and never add / import the shared package...

@TimoGlastra
Copy link
Contributor

100th time's the charm 🤞

@TimoGlastra TimoGlastra enabled auto-merge (squash) March 18, 2023 15:40
@TimoGlastra TimoGlastra disabled auto-merge March 18, 2023 20:03
@TimoGlastra TimoGlastra linked an issue Mar 18, 2023 that may be closed by this pull request
@TimoGlastra TimoGlastra changed the title feat: add set up for indy-vdr optional peer dependencies refactor: require native shared components implementation Mar 19, 2023
@TimoGlastra TimoGlastra merged commit 343ce6a into openwallet-foundation:main Mar 19, 2023
@TimoGlastra
Copy link
Contributor

Never thought this day would come

@genaris
Copy link
Contributor

genaris commented Mar 19, 2023

Never thought this day would come

The only thing we had to do was to rename it! Let's keep this in mind for the next cursed PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add optional peer dependencies to new shared components modules?
4 participants