docs: automated updates for deprecation#213
Open
jessiemongeon1 wants to merge 3 commits into
Open
Conversation
Automated update based on: Deprecated sui::dynamic_field::exists_ in favor of sui::dynamic_field::exists, deprecated sui::dynamic_field::remove_if_exists in favor of sui::dynamic_field::remove_opt, deprecated sui::dynamic_object_field::exists_ in favor of sui::dynamic_object_field::exists, and added sui::dynamic_object_field::remove_opt
Automated update based on: Deprecates vector::empty and vector::singleton in MoveStdlib
Automated update based on: Deprecated sui::dynamic_field::exists_ in favor of sui::dynamic_field::exists, deprecated sui::dynamic_field::remove_if_exists in favor of sui::dynamic_field::remove_opt, deprecated sui::dynamic_object_field::exists_ in favor of sui::dynamic_object_field::exists, and added sui::dynamic_object_field::remove_opt
This file contains hidden or 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
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.
Summary
Automated documentation updates triggered by recent release notes.
Changes
Triggered by MystenLabs/move-book#26226: [sui-framework] Clean up df/dof
exists_andremove_if_existsbook/programmability/dynamic-object-fields.mdbook/programmability/dynamic-fields.mdTriggered by MystenLabs/move-book#26196: [move-stdlib] purge vector::empty and vector::singleton
book/guides/code-quality-checklist.mdReview details
book/programmability/dynamic-object-fields.mdThe documentation page lists
exists_as one of the available methods for dynamic object fields:This needs to be updated to reflect the deprecation of
exists_in favor ofexists, and the addition ofremove_opt(and deprecation ofremove_if_exists, though that wasn't listed here).Section needing update: The bullet list under "The rest of the methods..." (before the "Additionally, there is an
idmethod..." paragraph).What's wrong:
exists_is now deprecated in favor ofexists. The list should referenceexistsinstead ofexists_.Suggested update: Replace
exists_withexistsin the bullet list:Additionally, since
remove_optis newly added fordynamic_object_fields, it could be added to the list:NO major structural changes are needed, but the
exists_→existsrename should be reflected, andremove_optshould be mentioned as a new method.book/programmability/dynamic-fields.mdThe documentation page needs updating due to the deprecation of
exists_in favor ofexistsandremove_if_existsin favor ofremove_opt.What Needs Updating
1. "Usage" section — prose description
Current text:
Should be updated to reference the new
existsmethod as the preferred API, noting thatexists_is deprecated. For example:2. "Usage" section — code example
Current code (lines in
test_character_and_accessories):assert!(df::exists_(&character.id, b"hat_key")); assert!(df::exists_(&character.id, b"mustache_key")); // ... assert!(!df::exists_(&character.id, b"hat_key")); assert!(!df::exists_(&character.id, b"mustache_key"));Should be updated to use the new non-deprecated name:
assert!(df::exists(&character.id, b"hat_key")); assert!(df::exists(&character.id, b"mustache_key")); // ... assert!(!df::exists(&character.id, b"hat_key")); assert!(!df::exists(&character.id, b"mustache_key"));3. Consider mentioning
remove_optThe
remove_if_exists→remove_optdeprecation is not currently documented anywhere on this page (the old function isn't mentioned either), but if the page aims to be comprehensive about available methods, a brief note aboutremove_opt(remove a field if it exists, returning anOption) in the "Usage" section prose would be appropriate. This is lower priority sinceremove_if_existswasn't previously documented here, but the newremove_optis worth a mention for completeness.book/guides/code-quality-checklist.mdLooking at the PR change (deprecating
vector::emptyandvector::singletonin MoveStdlib) and the documentation page, I need to check if any existing guidance is affected.The relevant section is "Vector Has a Literal. And Associated Functions" under "Function Body: Struct Methods":
This section already marks
vector::empty()as bad practice and recommends the vector literal syntax instead. The deprecation ofvector::empty(andvector::singleton) reinforces the existing guidance.However, the documentation could be slightly strengthened to:
vector::singletonas also deprecated/discouraged (it's not shown in the example at all currently).vector::empty()andvector::singleton()are now formally deprecated.Recommendation: Update the "Vector Has a Literal. And Associated Functions" section to:
vector::singleton(value)to the "bad" example alongsidevector::empty(), showing its replacement withvector[value].vector::emptyandvector::singletonare now deprecated in MoveStdlib, strengthening the case for using vector literals.Suggested update to the bad example:
This is a minor but relevant update — the deprecation directly validates and strengthens the existing "bad" guidance, and adding
vector::singletonto the example closes a gap in coverage.This PR was automatically generated by the Docs Impact Monitor. Please review the changes carefully before merging.
Each file edit was generated by Claude based on the release notes and a review of the existing documentation content.