Improve DX when working with WASM dependencies#299
Improve DX when working with WASM dependencies#299piotr-roslaniec merged 7 commits intonucypher:monorepofrom
Conversation
9a44cd9 to
8be6ed4
Compare
Codecov Report
@@ Coverage Diff @@
## monorepo #299 +/- ##
============================================
+ Coverage 65.23% 65.67% +0.43%
============================================
Files 48 48
Lines 5218 5223 +5
Branches 35 28 -7
============================================
+ Hits 3404 3430 +26
+ Misses 1808 1787 -21
Partials 6 6
|
examples/nextjs/README.md
Outdated
| This is a [Next.js](https://nextjs.org/) project bootstrapped with | ||
| [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). | ||
|
|
||
| ## Getting Started |
There was a problem hiding this comment.
Before running the dev server, it is necessary to install the packages, right? I tried with npm install, but I got an error:
% npm i
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:*
But it worked with pnpm: pnpm install
Should we add pnpm install to this section?
examples/nextjs/README.md
Outdated
|
|
||
| Open [http://localhost:3000](http://localhost:3000) with your browser to see the | ||
| result. | ||
|
|
There was a problem hiding this comment.
Should we add a note about Metamask (if it is being used) should have Mumbai as the network selected ?
51f2439 to
15ea563
Compare
There was a problem hiding this comment.
I do think await initialize() is an improvement, although I do wish that the error raised when executing nucypher-core functions without calling it was more informative. Is it possible to catch and re-raise? In any case good documentation will mitigate appropriately in my opinion. Appoved!
🤠
| const [bob, setBob] = useState<Bob | undefined>(); | ||
| const [policy, setPolicy] = useState<EnactedPolicy>(); | ||
|
|
||
| const initNucypher = async () => { |
There was a problem hiding this comment.
This is an internal function, right? Name is not very descriptive, but if it's only a local thing, it's fine.
There was a problem hiding this comment.
Yes, it's only used in this example as a helper method
| "license": "GPL-3.0-only", | ||
| "author": "Piotr Roslaniec <p.roslaniec@gmail.com>", | ||
| "scripts": { | ||
| "postinstall": "pnpm build || true && echo 'Ignoring build errors on setup until we publish the first version'", |
There was a problem hiding this comment.
Beat me to it
Type of PR:
Required reviews:
What this does:
@nucypher/nucypher-coreNPM package nucypher-core#83nucypher-tsuser will have to call theawait initialize()method imported fromnucypher-tsIssues fixed/closed:
@nucypher/nucypher-coreNPM package nucypher-core#83Why it's needed:
nucypher-tsusersNotes for reviewers:
nucypher-tsversion because of how the integration works now.@nucypher/nucypher-corepackageawait initialize()an improvement from having to configure bundler? You can learn more about the trade-offs in the related PR: Inline WASM in@nucypher/nucypher-coreNPM package nucypher-core#83./examplesto compare and contrast this change with the previous DX