Skip to content
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

Advanced Storage Docs #5715

Merged
merged 19 commits into from Mar 13, 2024
Merged

Advanced Storage Docs #5715

merged 19 commits into from Mar 13, 2024

Conversation

bitzoic
Copy link
Member

@bitzoic bitzoic commented Mar 11, 2024

Description

There have been a number of questions on the forum regarding storage and the section needed and update. The following changes have been made:

  • Simplified basic storage examples
  • Added examples that include structs
  • Added basic examples that include StorageMap
  • Added basic examples that include StorageVec
  • Added basic examples that include StorageString
  • Added basic examples that include StorageBytes
  • Added advanced nested examples using StorageVec and StorageMap
  • Added advanced nested examples using StorageString and StorageMap
  • Added advanced nested examples using StorageBytes and StorageVec
  • Added table of contents Removed due to CI errors not accepting TOB format
  • Fixed inline docs on StorageString
  • Fixed inline docs on StorageBytes
  • Fixed inline docs on StorageKey

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@bitzoic bitzoic added The Sway Book Everything to do with the Sway Book documentation dev-experience Anything to do with the developer experience labels Mar 11, 2024
@bitzoic bitzoic requested review from a team March 11, 2024 06:44
@bitzoic bitzoic self-assigned this Mar 11, 2024
@IGI-111
Copy link
Contributor

IGI-111 commented Mar 11, 2024

I just want to say for the record that we will make big changes to storage to make it more intuitive in the near future, so much of this will likely have to be updated.

Still valuable to document the current behavior, of course.

Copy link
Member

@sarahschwartz sarahschwartz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you! What do you think about making pages in the common collections chapter for storagebytes, storagestring, and a nested collections page so the contract storage page isn't quite so long?

Having a table of contents at the top of the contract storage page would also be nice.

Copy link
Contributor

@K1-R1 K1-R1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, happy to approve once above comments are addressed

@bitzoic
Copy link
Member Author

bitzoic commented Mar 12, 2024

I just want to say for the record that we will make big changes to storage to make it more intuitive in the near future, so much of this will likely have to be updated.

Still valuable to document the current behavior, of course.

Yes I am aware. The changes here also update the outline and format of the documentation which should be carried over to any updates to storage made

@bitzoic
Copy link
Member Author

bitzoic commented Mar 12, 2024

This is great, thank you! What do you think about making pages in the common collections chapter for storagebytes, storagestring, and a nested collections page so the contract storage page isn't quite so long?

Having a table of contents at the top of the contract storage page would also be nice.

StorageBytes and StorageString are very basic, the only additional function one can call besides the examples already provided is clear(). Not sure if this warrants a full page.

Common Collections is missing a lot of data types, such as String, Bytes. We may want to split this into storage and heap types. For now I've created an "Advanced Storage" page under the "Advanced" section.

Unfortunately, a table of contents isn't compatible with CI. I had one added and there are a number of resulting errors. Updates to CI would need to be made in another PR.

@bitzoic bitzoic requested review from sarahschwartz, K1-R1 and a team March 12, 2024 02:15
@K1-R1 K1-R1 requested a review from a team March 12, 2024 15:53
@bitzoic bitzoic merged commit aa23d5e into master Mar 13, 2024
38 checks passed
@bitzoic bitzoic deleted the bitzoic-advanced-storage-docs branch March 13, 2024 02:09
@bitzoic bitzoic mentioned this pull request Apr 4, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-experience Anything to do with the developer experience documentation The Sway Book Everything to do with the Sway Book
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants