fluree / core

Fluree releases and public bug reports
0 stars 0 forks source link

Javascript Build of Fluree `crypto` #84

Open aaj3f opened 5 months ago

aaj3f commented 5 months ago

Description

The requirement is effectively Javascript APIs for updated Fluree crypto functionality (most notably, create-jws). Whether this is effectively done by updating the crypto dependency in db for node and browser targeted builds or whether the crypto library is made available as a standalone module available in JS.

The only argument I have in favor of a standalone crypto module is that the browser- & node-targeted db builds include quite a bit of unnecessary module content for anyone just looking to create keypairs and sign queries/txns (but who don't intend to run a js db).

cap10morgan commented 5 months ago

I think the end result of this will be a standalone fluree.crypto npmjs artifact either way. The contention is over where / how that artifact will be generated. I'm going to take a crack at generating it directly from the fluree.crypto repo, which was my original plan w/ deprecating the other repos.

aaj3f commented 3 months ago

Per discussion today, we've decided to specify that acceptance criteria of this ticket is limited to successful node-targeted and browser-targeted builds with only simple optimizations configured. fluree/core#95 will extend this work at a later time to enable advanced optimizations when building for those targets.

cap10morgan commented 3 months ago

Per discussion today, we've decided to specify that acceptance criteria of this ticket is limited to successful node-targeted and browser-targeted builds with only simple optimizations configured. #95 will extend this work at a later time to enable advanced optimizations when building for those targets.

To clarify: the browser build does (and really must) use advanced optimizations, and seems to be working correctly. Only the Node build is limited to simple optimizations for now.

cap10morgan commented 3 months ago

@aaj3f This has all landed on main. Can you pull, build it (should just be make), and then point something like fluree-client at it (with e.g. yarn add file:/path/to/fluree.crypto) to test before I push another release to npmjs.com? I am no longer able to get the fluree-client test suite to run for some reason.

aaj3f commented 3 months ago

Looking now @cap10morgan !

aaj3f commented 3 months ago

@cap10morgan -- works great! It took me a sec to make sure the tests were getting run both against a jsdom/browser target as well as node, but both of them work great with the new artifacts out of fluree.crypto 👍

cap10morgan commented 3 months ago

I just published @fluree/crypto v1.0.1 on npmjs.com: https://www.npmjs.com/package/@fluree/crypto/v/1.0.1

cap10morgan commented 3 months ago

And v1.0.1 is tagged on GitHub and published to Clojars now too

cap10morgan commented 3 months ago

I republished it as v3.0.0 everywhere b/c we can't unpublish the 3.0.0-alpha1 that was up on npmjs.com already.