fix(versioning): Preserve optionality changed from its declaration - #11968
Draft
Timothee Guerin (timotheeguerin) wants to merge 2 commits into
Draft
Timothee Guerin (timotheeguerin) wants to merge 2 commits into
Timothee Guerin (timotheeguerin) wants to merge 2 commits into
Conversation
commit: |
Contributor
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
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.
An optionality transformation can leave copied properties carrying versioning history that no longer describes them. This causes
OptionalProperties<T>to reject@madeRequiredproperties, and spreading the result can make those properties required again in version snapshots.This is the simple declaration-comparison alternative for #11592, independent of the structural-override prototype in #11969. These are alternatives, not stacked changes.
Versioning compares
property.optionalwithproperty.node.optional. When they differ, it skips optionality diagnostics and preserves the transformed optionality when computing snapshots from the original graph. There is no helper-name special case, provenance tracking, extra state, or change to metadata getters.Source.fooretains its version history;Patch.foostays optional in every version. Property addition, removal, rename, and type history remain intact. Invalid optionality annotations on unchanged original declarations still diagnose.Limitations: same-value transforms and transforms that restore the declared optionality are undetectable. New optionality augments on transformed copies are ignored for validation and snapshots too, because this rule cannot distinguish them from inherited annotations. Properties without a model-property declaration node cannot be identified as transformed. This draft intentionally demonstrates a bounded heuristic rather than a general transformation contract.