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

Move away from isomorphic-webcrypto #5

Closed
TimoGlastra opened this issue Jan 30, 2024 · 6 comments
Closed

Move away from isomorphic-webcrypto #5

TimoGlastra opened this issue Jan 30, 2024 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@TimoGlastra
Copy link

It still depends on Expo unimodules, which has been deprecated for years and breaks React Native apps using Expo. We have to resort to quite cumbersome hacks to be able to build an Expo app using this library.

Sphereon has created a fork that removes this dependency, would it be possible to use this fork instead of isomorphic-webcrypto?

See https://github.com/Sphereon-Opensource/isomorphic-webcrypto

cc @nklomp

@kayaelle kayaelle moved this to Backlog in DCC Engineering Jan 30, 2024
@kayaelle kayaelle added the question Further information is requested label Jan 30, 2024
@kayaelle kayaelle moved this from Backlog to To Do (Current sprint) in DCC Engineering Jan 30, 2024
@dmitrizagidulin dmitrizagidulin moved this from To Do (Current sprint) to Backlog in DCC Engineering Feb 7, 2024
@dmitrizagidulin
Copy link
Member

@TimoGlastra - Thanks for the heads up. Now that we know there's a Sphereon fork, we'll switch to that.

@dmitrizagidulin
Copy link
Member

@TimoGlastra @nklomp - We've switched to the Sphereon fork, now published to npm as @digitalcredentials/jsonld-signatures@10.0.0.
Closing this issue for now, but feel free to reopen if it doesn't work or something else comes up.

@TimoGlastra
Copy link
Author

Cool thanks! Are you intending to keep this branch alive for a while? https://github.com/digitalcredentials/jsonld.js/tree/v10.x

I want to upgrade, but then have to depend on this branch as well, I assume

@TimoGlastra
Copy link
Author

TimoGlastra commented Feb 8, 2024

Ah it seems the digitalcredentials/[email protected] mention in package.json does not work with Yarn 3. Do you think it'll be possible to publish this still for now a @digitalcredentials/jsonld on NPM until a new version of jsonld.js is released from DB that includes the required changes?

Update: it fails because when installing pack is called, which will call prepack which will call build. And that needs the devDependencies. But if you add a dependency, the dev dependencies are not installed. I think this can be resolved by making the v10.x branch include the already built files, and remove the prepack/build command

@dmitrizagidulin
Copy link
Member

@TimoGlastra ah, yeah, lemme see what I can do.

@dmitrizagidulin
Copy link
Member

@TimoGlastra @nklomp - hey, would it be possible to enable Issues on https://github.com/Sphereon-Opensource/isomorphic-webcrypto ?
(I'm testing running the sphereon fork on React Native, and am running into a couple errors)

error: Error: Unable to resolve module crypto from ~/code/DCC/learner-credential-wallet/node_modules/asmcrypto.js/asmcrypto.all.js: crypto could not be found within the project or in these directories:
  node_modules
  4247 | function getRandomValues(buf) {
  4248 |     if (typeof process !== 'undefined') {
> 4249 |         var nodeCrypto = require('crypto');
       |                                   ^
  4250 |         var bytes = nodeCrypto.randomBytes(buf.length);
  4251 |         buf.set(bytes);
  4252 |         return;
    at ModuleResolver.resolveDependency (~/code/DCC/learner-credential-wallet/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:158:15)
    at DependencyGraph.resolveDependency (~/code/DCC/learner-credential-wallet/node_modules/metro/src/node-haste/DependencyGraph.js:231:43)
    at Object.resolve (~/code/DCC/learner-credential-wallet/node_modules/metro/src/lib/transformHelpers.js:129:24)
    at resolve (~/code/DCC/learner-credential-wallet/node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:33)
    at ~/code/DCC/learner-credential-wallet/node_modules/metro/src/DeltaBundler/traverseDependencies.js:412:26
    at Array.reduce (<anonymous>)
    at resolveDependencies (~/code/DCC/learner-credential-wallet/node_modules/metro/src/DeltaBundler/traverseDependencies.js:411:33)
    at processModule (~/code/DCC/learner-credential-wallet/node_modules/metro/src/DeltaBundler/traverseDependencies.js:140:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async addDependency (~/code/DCC/learner-credential-wallet/node_modules/metro/src/DeltaBundler/traverseDependencies.js:230:18)

@alexfigtree alexfigtree moved this from Backlog to Ready for Review in DCC Engineering Feb 21, 2024
@alexfigtree alexfigtree moved this from Ready for PR Review to Done (Deployed) in DCC Engineering Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Status: Done (Deployed)
Development

No branches or pull requests

3 participants