-
Notifications
You must be signed in to change notification settings - Fork 3
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: clean & add comments to initialize.js #10
Open
chadoh
wants to merge
3
commits into
stellar:main
Choose a base branch
from
AhaLabs:feat/comment-initializejs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chadoh
force-pushed
the
feat/comment-initializejs
branch
from
August 28, 2024 18:02
ba7e8fa
to
0ab3274
Compare
From looking at https://developers.stellar.org/docs/build/guides/dapps/soroban-contract-init-template, my guess is that people do not find the existing `initialize.js` script easy to understand. I've followed the lead of @CaptainPrinz here and changed the name of `exe` to `run`, and then I added lots of comments to each function. I also removed the `SOROBAN_NETWORK` variable, as I think it makes this somewhat more confusing instead of more clear. This means removing the `network.${process.env.SOROBAN_NETWORK}` shortcut, but maybe that's ok? I also moved around things in the `.gitignore`, just so all the specific-to-this-template stuff would be at the bottom. A new frontend-template guide I am writing is going to mention and link to this stuff.
chadoh
force-pushed
the
feat/comment-initializejs
branch
from
August 28, 2024 18:05
0ab3274
to
f99af17
Compare
These are provided by the main `stellar contract init` script, and should not be part of the frontend template.
chadoh
added a commit
to AhaLabs/stellar-docs
that referenced
this pull request
Aug 29, 2024
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`).
briwylde08
added a commit
to stellar/stellar-docs
that referenced
this pull request
Sep 20, 2024
* feat: more holistic frontend-template deep-dive 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`). * link frontend template guide from dapp guide and add "Wrapping up" section to end of frontend template guide * stylistic improvements Co-authored-by: Bri <[email protected]> --------- Co-authored-by: Bri <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From looking at https://developers.stellar.org/docs/build/guides/dapps/soroban-contract-init-template, my guess is that people do not find the existing
initialize.js
script easy to understand.I've followed the lead of @CaptainPrinz here and changed the name of
exe
torun
, and then I added lots of comments to each function.I also removed the
SOROBAN_NETWORK
variable, as I think it makes this somewhat more confusing instead of more clear. This means removing thenetwork.${process.env.SOROBAN_NETWORK}
shortcut, but maybe that's ok?I also moved around things in the
.gitignore
, just so all the specific-to-this-template stuff would be at the bottom. A new frontend-template guide I am writing is going to mention and link to this stuff.Also:
soroban
CLICargo.*
files