Skip to content

Conversation

@octogonz
Copy link
Collaborator

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. The ApiJsonSchemaVersion version bump is merely for bookkeeping purposes.

octogonz added 7 commits July 19, 2019 19:23
- ApiItem.canonicalReference --> .containerKey
- ApiItemContainerMixin.tryGetMember() --> .tryGetMemberByKey()
- Api___.getCanonicalReference() --> .getContainerKey()
…file format; bump ApiJsonSchemaVersion to 1002
@octogonz octogonz merged commit 83dfeda into master Jul 20, 2019
@octogonz octogonz deleted the octogonz/ae-container-key branch July 20, 2019 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants