-
Notifications
You must be signed in to change notification settings - Fork 35
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
add a password manager app demo #8
Conversation
const [connectedToSnap, setConnectedToSnap] = useState<boolean>(false); | ||
const [userKey, setUserKey] = useState<string | null>(null); | ||
const [userId, setUserId] = useState<string | null>(null); | ||
const [nillion, setNillion] = useState<any>(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do TS types for our wasm types not work here? e.g. I imagine you should be able to use NillionClient
rather than any
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
caught between a rock and a hard place here
I can't get the nillion types to replace any
without
-
causing client errors: if the
import * as nillion from "@nillion/nillion-client-js-browser/nillion_client_js_browser.js";
happens without being async imported, the client complains and errors out -
creating a circular dependency: nillion js lib is imported in the client util https://github.com/NillionNetwork/scaffold-nillion/blob/main/packages/nextjs/utils/nillion/nillionClient.ts#L2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm this isn't great. Those type definitions are being generated so we should make sure they're usable and find a way to use them. I think it's okay to keep it this now until we figure that out tho. cc @wwwehr @navasvarela you may know how to make this work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could the types potentially be a separate import from the js client library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oceans404 There is a TS type descriptor file generated as part of the client's npm, nillion_client_js_browser.d.ts
. This file contains all the type definitions ONLY. I'm not a TS programmer myself but I'd imagine you can import this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@navasvarela thanks Juan, this worked
import type * as NillionTypes from "@nillion/nillion-client-js-browser/nillion_client_js_browser.d.ts";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@navasvarela I noticed there's no nillion type here - just NillionClient
Nice one @oceans404. Been through the flow and all works nicely for me on my machine. My only observation would be the header bar is getting a bit crowded, could we make the names a bit shorter? Think they will all fit nicely then. |
good catch, ill fix the navbar @Davetbutler |
@Davetbutler fixed the navbar titles: |
Description