Skip to content

Conversation

@octogonz
Copy link
Collaborator

@octogonz octogonz commented Feb 5, 2019

This PR should fix a number of InternalError bugs that people have been reporting when AE7 processes external imports.

Changes:

  • Redesign the analyzer so that when an external symbol is reexported by the working package, the local object (AstImport) and external object (AstSymbol) are kept separate

  • Fix a number of bugs where external symbols were misinterpreted as being part of the local project

  • Eliminate a number of errors involving unusual language constructs, by avoiding analysis of external symbols unless it's really necessary

  • Simplify the AstSymbol.nominalAnalysis concept and associated code

  • Improve .d.ts rollup trimming to handle reexported symbols correctly

… the issue where external packages are incorrectly collected
…ss citizen like AstSymbol (whereas in the past it was tracked via an AstSymbol.astImport property)

- Introduced AstEntity as an abstraction of AstImport and AstSymbol
- Replaced AstSymbol.imported with AstSymbol.isExternal, which now accurately tracks whether a symbol is external to the working package
- The analyzer now generally stops traversing symbol aliases when it reaches an AstImport, which should eliminate an entire category of bugs resulting from overanalysis of external packages
--> this should also improve perf
@msftclas
Copy link

msftclas commented Feb 5, 2019

CLA assistant check
All CLA requirements met.

@octogonz
Copy link
Collaborator Author

octogonz commented Feb 5, 2019

@natalieethell FYI this is the PR I've been working on to address issue #1054

…equivalence relation (which is based on names, not symbols)
…nce this PR eliminates the logic that consulted the AstModule

--> This avoids a number of bugs where legacy *.d.ts files contained difficult to handle constructs
…y being included in public/api-extractor-test-04.d.ts
@octogonz octogonz changed the title [api-extractor] Improve handling of external packages (not ready for review yet) [api-extractor] Improve handling of external packages Feb 8, 2019
@octogonz
Copy link
Collaborator Author

octogonz commented Feb 8, 2019

@natalieethell @iclanton this PR is finally ready for review.

Now's a good time to try running it on any repro branches that were encountering errors.

@octogonz octogonz changed the title [api-extractor] Improve handling of external packages [api-extractor] Improve how external packages are analyzed Feb 8, 2019
Copy link
Member

@iclanton iclanton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

…-reexport-bugs

# Conflicts:
#	build-tests/api-extractor-test-04/package.json
@octogonz octogonz merged commit a31d421 into master Feb 11, 2019
@octogonz octogonz deleted the octogonz/ae-reexport-bugs branch February 11, 2019 08:39
@octogonz
Copy link
Collaborator Author

Published as API Extractor 7.0.16 beta.

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.

4 participants