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

Improve DX when working with WASM dependencies #299

Merged
merged 7 commits into from
Oct 5, 2023

Conversation

piotr-roslaniec
Copy link
Contributor

@piotr-roslaniec piotr-roslaniec commented Sep 21, 2023

Type of PR:

  • Feature
  • Refactor

Required reviews:

  • 2

What this does:

Issues fixed/closed:

Why it's needed:

  • Removes dependency on WASM-aware bundler for nucypher-ts users

Notes for reviewers:

@codecov-commenter
Copy link

codecov-commenter commented Sep 22, 2023

Codecov Report

Merging #299 (15ea563) into monorepo (142eb98) will increase coverage by 0.43%.
Report is 1 commits behind head on monorepo.
The diff coverage is 100.00%.

@@             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              
Files Coverage Δ
packages/shared/src/index.ts 100.00% <100.00%> (ø)
packages/shared/src/strategy/pre-strategy.ts 30.47% <100.00%> (+1.00%) ⬆️

... and 4 files with indirect coverage changes

Copy link
Member

@manumonti manumonti left a comment

Choose a reason for hiding this comment

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

LGTM overall, just a few thoughts

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
Copy link
Member

Choose a reason for hiding this comment

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

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?


Open [http://localhost:3000](http://localhost:3000) with your browser to see the
result.

Copy link
Member

Choose a reason for hiding this comment

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

Should we add a note about Metamask (if it is being used) should have Mumbai as the network selected ?

Copy link
Member

@KPrasch KPrasch left a comment

Choose a reason for hiding this comment

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

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 () => {
Copy link
Member

Choose a reason for hiding this comment

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

This is an internal function, right? Name is not very descriptive, but if it's only a local thing, it's fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's only used in this example as a helper method

@@ -4,6 +4,7 @@
"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'",
Copy link
Member

Choose a reason for hiding this comment

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

We should track this

Copy link
Member

Choose a reason for hiding this comment

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

Opened #307

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tracked here: #308

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Beat me to it

Copy link
Member

Choose a reason for hiding this comment

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

😆

@piotr-roslaniec piotr-roslaniec merged commit c34bccf into nucypher:monorepo Oct 5, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

5 participants