-
Notifications
You must be signed in to change notification settings - Fork 137
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
feat: more holistic frontend-template deep-dive #952
Conversation
This replaces `soroban-contract-init-template`. The old document was mostly focused on helping someone author the `initialize.js` script. The new one advises people to copy-paste the one from the official template, without explaining every detail of what it does. However, the old page here made me think that a lot of people probably didn't find the `initialize.js` script particularly readable, so I've also improved it and added many comments: - stellar/soroban-template-astro#10 Having a more readable, well-commented script means we can avoid such detailed explanation here. Which is good, because there's lots of other details the old guide didn't get to! As you can see in this new guide, it now leads you through searching for templates on GitHub, then explains how they work at a high-level. It has you build your own, and explains gotchas along the way, like that you should not commit the `Cargo.toml` file or hard-code a reliance on specific contracts (other than `hello_world`).
+ > | ||
+ <label> | ||
+ Who you gonna call? | ||
+ <input name="toWhom" value="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.
I wanted to make this say "ghost busters!" but we need to wait for a fix to the CLI to make that possible
After this is released, I can update this guide to say "ghost busters!"
Preview is available here: |
|
||
By printing the `helloWorldContract` object, you'll find the hello method which coincides with the hello function defined in the smart contract. Calling this method will invoke its equivalent in the smart contract. | ||
And projects that use yours will want to commit the `Cargo.*` files and `contracts`, but your _template_ should not include them. That can cause problems with project initialization later. Nor should it gitignore them, because your `.gitignore` will be part of projects started with your template! It would cause problems and confusion, if people didn't realize that some of their most important files were gitignored! |
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 think we should allow people to add these files to their templates, and just skip importing them into the created project:
Once we implement that, I'll circle back and update this guide.
|
||
We start off by creating `initialize.js` files in our frontend project directory. | ||
In GitHub, in the main search bar, search for `"soroban-template-"`. With the quotes. Here's a direct link to the search results: [github.com/search?q=%22soroban-template-%22](https://github.com/search?q=%22soroban-template-%22) |
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.
@ElliotFriend right now we can't search well for the templates, because I put the astro
in the middle. This means you need to search for soroban-*-template
, without quotes, and you get a fair bit of noise. My bad! Would you be able to change the name of https://github.com/stellar/soroban-astro-template to soroban-template-astro
?
@CaptainPrinz could you also change the name of https://github.com/CaptainPrinz/soroban-react-template to soroban-template-react
?
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.
@ElliotFriend! Just a quick tag for 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.
@ElliotFriend ... Would you be able to change the name of https://github.com/stellar/soroban-astro-template to
soroban-template-astro
?
On it!
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.
@chadoh @briwylde08 rename is complete 👍🏻 https://github.com/stellar/soroban-template-astro
and add "Wrapping up" section to end of frontend template guide
Co-authored-by: Bri <[email protected]>
Preview is available here: |
1 similar comment
Preview is available here: |
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.
Happy to get this merged when the open question to Elliot has been resolved.
Looks like this may have happened. All good to merge @ElliotFriend? |
Yes, we're looking good from my end. Let's merge it!! |
It's. Happening. |
This replaces
soroban-contract-init-template
. This is Step 1 in an effort to address:The goal is to create a DevRel initiative around creating frontend templates, maybe including bounties for creating and maintaining them. But first, we need a solid guide to help people create them. That's what this does.
The old document was mostly focused on helping someone author the
initialize.js
script. The new one advises people to copy-paste the one from the official template, without explaining every detail of what it does. However, the old page here made me think that a lot of people probably didn't find theinitialize.js
script particularly readable, so I've also improved it and added many comments:Having a more readable, well-commented script means we can avoid such detailed explanation here.
Which is good, because there's lots of other details the old guide didn't get to!
As you can see in this new guide, it now leads you through searching for templates on GitHub, then explains how they work at a high-level. It has you build your own, and explains gotchas along the way, like that you should not commit the
Cargo.toml
file or hard-code a reliance on specific contracts (other thanhello_world
).Direct preview link
I suggest reading the preview link, not the diff here, since this was a full rewrite and git is bad at showing those: https://developers-pr952.previews.kube001.services.stellar-ops.com/docs/build/guides/dapps/soroban-contract-init-template