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

[api-extractor] Rename ApiItem.canonicalReference to ApiItem.containerKey #1405

Merged
merged 7 commits into from
Jul 20, 2019

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.

2 participants