This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
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.
(now from a branch instead of a fork)
Fabric uses API Extractor to help review API changes and generate docs. @kenotron and I would like to introduce it for FluentUI too, so we can use the API review functionality for converged components (and optionally existing components). It will also be a faster replacement for
react-docgen-typescript
.This PR doesn't actually enable API Extractor or change anything about doc generation, but it introduces the config files and some required formatting and export changes. (I found these issues by running
npx @microsoft/api-extractor run <config>
in each project.)Formatting
API Extractor requires that
@param
and@returns
do not contain type annotations, and requires the parameter name in@param
to be followed by a-
(example:@param foo - description here
). So I added dashes, got rid of all the remaining type annotations, and moved the type info to the function signature itself in cases where it wasn't already there.Exports (and Babel upgrade)
(These more significant changes are grouped in the first commit for easy viewing.)
There were two re-exports which caused problems, because API Extractor doesn't currently support this type of re-export (from
packages/react/src/lib/index.ts
):A workaround is to export a named module instead:
However, namespaces weren't supported by Babel until very recent versions. So I also had to upgrade Babel (and enable namespace support:
['@babel/preset-typescript', { allowNamespaces: true }]
), which then required upgradingreact-hot-loader
to eliminate a very spammy warning introduced by the new Babel version.I'd appreciate help/suggestions for verifying that the Babel upgrade didn't introduce any issues.
(The other problematic export was in
packages/react/src/index.ts
and was much simpler to deal with since it involved exporting values not types.)Microsoft Reviewers: Open in CodeFlow