[api-extractor] Rename ApiItem.canonicalReference to ApiItem.containerKey #1405
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.
As part of the work to support hyperlinks for types that appear in the documentation (PR #1337) we need to introduce a new API for building canonical references using the new notation that @rbuckton prototyped in microsoft/tsdoc#172.
However, api-extractor-model already has a set of legacy APIs that used the name "canonicalReference" to describe subcomponents of the TSDoc declaration reference notation. This PR renames those APIs as follows:
ApiItem.canonicalReference
-->.containerKey
ApiItemContainerMixin.tryGetMember()
-->.tryGetMemberByKey()
Api___.getCanonicalReference()
-->.getContainerKey()
ApiItemContainerMixin.tryGetMember()
-->.tryGetMemberByKey()
The new name "containerKey" reflects that this is a very special-purpose string, whose only purpose is as a lookup key for the
ApiItemContainerMixin.tryGetMemberByKey()
API.The container key APIs are not believed to be used by any code outside of API Extractor; they are so obscure that I'm considering this a "minor" SemVer change.
This PR also temporarily removes the
canonicalReference
field from the .api.json file format. We will reintroduce it in the next PR using the new notation. Because this data field was for informational purposes only (i.e. ignored by the deserializer) it is not a breaking change for the file format. TheApiJsonSchemaVersion
version bump is merely for bookkeeping purposes.