-
Notifications
You must be signed in to change notification settings - Fork 31
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 Recipes section #33
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thanks for working on this @Pabl0cks! We definitely need to think about a structure and then apply it to all recipes. The one you are proposing seems a bit verbose to me. A simpler idea:
I don't think we need: "before you begin", "Step 4: Add the component to your Application", "Step 5: Test and Deploy" and "Conclusion" Maybe you could take one of the recipes, duplicate it, and make it this way. We can keep iterating until we find one that we all like. |
Thanks for the feedback @carletex ♥ Agree that a simplified structure/content will be more useful for users. I've just pushed SimplifiedGetCurrentBalanceFromAccount.md with the simplified approach. I've added a couple comments with some sentences I was not sure if keep them or delete them. Let me know how do see this new approach, if you want I can create a 2nd version of it with the implementation guide as VS comments 🙌 |
Tysm @Pabl0cks for tackling and setting this up 🙌 Along the lines of Carlos comment #33 (comment)
Will also try to explore other options, But I think we are almost there 🙌 Here is the code snipped for above image:
|
TYSM for the feedback @technophile-04!! Always so valuable ♥ I've just pushed some changes:
My personal view on both versions:
For not experienced devs I really dont know which approach may be more useful, probably is a bit subjective on how each one tends to solve problems. Experienced devs may just want the recipe code and ignore the rest 😂 |
🚀 🚀 I think is great! |
First of all - this is GREAT!! I agree with @technophile-04, only thing is that I think it's good to have the code snippet collapsable. I like the way it is here: (We can change the H# and have it after the description) Small difference :) If you all think that having the code block open is better we can do that to. What do you think? |
I LOVE it, think it's the way to go. Both the experienced and the new developers will have a great experience with that approach. Will try to implement a first version of this approach for all of the current Recipes 🙌 |
I've just pushed some changes to try to implement the new approach for WriteToContractWriteAsyncButton and WaitTxApprovalReceiptLaunchNextTx to the iterative approach 🙌. Feel like the WaitTxApprovalReceiptLaunchNextTx could be better sliced/explained, but prefer to wait for your review, just in case you don't like that example/recipe. Also was not sure if should add a link to It has also some styles that could be deleted to simplify the example, or we could add more styling to other recipes if you see it better this way.
For now I left them all expanded, since I think they like to save the extra click for the advanced devs, but in some cases where the Recipe's code is too long, I agree it can feel a bit overwhelming to new developers. |
What if we use collapsible and keep it opened by default? (not sure if docusaurus has this option)
Just an idea : what if provide with a Another option might be give them the solidity code and deploy manually but I think this will make recipe a bit long But yeah I think we need to find a way to provide people abi / solidity code because if we don't then the recipe code will give type errors if they copy paste it directly. Regarding But yeah I completely get why we added this recipe 🙌, In case we are planning to keep it maybe we deploy a very simple Here is an bad example contract to demonstrate: // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract TokenBurner {
function burnTokens(address tokenAddress, uint256 amount) external onlyOwner {
IERC20 token = IERC20(tokenAddress);
// Transfer tokens to the zero address (burn)
token.transferFrom(msg.sender, address(0),amount);
}
} We first approve some amount on But yeah let's see what others have to say. Tysm @Pabl0cks, other examples are already looking great I feel 🙌 !! |
Co-authored-by: Shiv Bhonde | shivbhonde.eth <[email protected]>
I like the idea! We can always choose to leave it closed by default in some recipe edge-cases with too much code. Haven't seen a native way to do it, but can be easily done adding a style in the |
I like this idea 🙌 We could add for example an
I think you're right and then there is probably no sense for the WaitTxApprovalReceiptLaunchNextTx recipe. Maybe it would make sense to create an ERC20ApprovePattern recipe using an already deployed sepolia ERC20 token for the example? Or not for now. |
LGTM !!
Yup yup, I already added a basic minimal example Thanks Pablo 🙌 |
Thank you so much @Pabl0cks - The recipes addition is looking very good!! And thanks a lot @technophile-04 for the comments on the TokenBurner contract example. Tbh i didn't exactly know that part, so learning on the way. So I don't have a strong example or preference. I can say that I do like the example of ERC20ApprovePattern, its simple and demonstrates the point. |
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.
Tysm @Pabl0cks !! and others for great suggestions 🙌 ! Looking really nice !!
Discussed with Carlos and removed wait for transaction receipt and send next transaction
for now since it required a different contract and created #47 for discussion.
Merging this, I think we have left this todo from #25 :
- Read a uint from a contract and display it in a nice way (maybe with & without params)
Let's tackle it another PR since this already got too long and looks great for the initial iteration 🙌
Great work all <3 |
This is great, thank you so much!!! 🤩🤩🤩 |
Working on this PR to add Recipes section to Docs. It's my first time documenting this kind of code examples, so perhaps my approach is totally wrong, would love candid feedback if so 😊
Tried to give all recipes the same structure:
Recipes created:
Would love a initial technical overview to check if the code examples, explanations, doc naming and titles make sense.
Any feedback that you have would be appreciated ♥🙌