-
Notifications
You must be signed in to change notification settings - Fork 39
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
UI tutorial #1072
UI tutorial #1072
Conversation
Deploying documentation with Cloudflare Pages
|
Cloudflare deployment logs are available here |
This is awesome @samsiegart! I might have missed it but I didn't see it reference the current 'Building Client Dapps' (https://docs.agoric.com/guides/getting-started/contract-rpc.html) page. Should it? |
Yea thanks for calling out, just added links in a few places where the context was appropriate |
yarn add -D buffer | ||
``` | ||
|
||
Now, create a new file `src/installSesLockdown.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.
we could probably link to more documentation on what this file is doing. Even if we just link to docs on lockdown. As now its just "make a new file, and copy/paste this". There an opportunity to explain lockdown briefly here. Although it isnt a blocker for the dev. More informational
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.
Tbh I'm just having a hard time succinctly explaining it. Thinking out loud, it prevents the modification of certain intrinsics in the JS environment, and adds support for harden
and assert
etc. But that might lead to more questions than answers, as those things aren't really concerns for most UI devs (unless you're using https://github.com/LavaMoat/LavaMoat). It's really just needed so the agoric libraries work, because they're also used in smart contracts where those things actually matter.
We've talking about having a way to use the agoric libraries without hardening, but there hasn't been any movement on that yet. Maybe just linking to endo here is enough for now.
- Scaffolding a new React App. | ||
- Setting up `AgoricProvider` and connecting to a wallet. | ||
- Reading and rendering purse balances. | ||
- Reading contract data with `chainStorageWatcher`. |
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.
My thought here, and this also was a gotcha for me, but this tutorial is showing how you read data from vstorage in general, as the code is using
[Kind.Data, 'published.agoricNames.instance']
...
[Kind.Data, 'published.agoricNames.brand']
But these aren't storage paths set by the contract. I think the wording can improve here so a brand new dev doesn't think they are reading contract data.
I see an opportunity to even combine/link other resources on how the writing of vstorage works, so they can understand the relationship between how writes work and these storage paths they see in this tutorial.
For this specifically, we could even change this to be
- Reading vstorage data with `chainStorageWatcher`
would love thoughts on this
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.
i also do understand the brand is from the contract, since its minting. Therefore the contract is still reading brand from the asset being minted by the contract, this seems like we can say this more clear. Maybe its just we don't call it contract data here, but more vstorage data... idk.
So maybe, its just some clarity in the tutorial on how those storage paths are where you store data if you want it to be accessible to the outside world.
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.
Yea that's understandable, I wasn't sure if "vstorage" would sound too unfamiliar but I don't think it's a big concern, just changed it from "contract data" to "vstorage" everywhere.
Also added a link to https://docs.agoric.com/guides/zoe/pub-to-storage.html#publishing-to-chainstorage as well
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.
LGTM, and i was able to use it to get through building the UI. Aside from my minor comments on clarity of vstorage writing, and reading here, this looks good team 🚀
@Jovonni I just made some changes as you suggested and added the tutorial pages to the nav bar, mind taking one more look before I merge? Also, I realized the |
fixes #922
Link to tutorial page: https://ui-tutorial.documentation-7tp.pages.dev/guides/ui-tutorial/#ui-tutorial
Reference repo https://github.com/agoric-labs/ui-tutorial
In general I need to add some reference images, better linking to other docs and repos, and better layout/indexing of pages (in addition to prose and other content from code review/feedback)