fix(@ngtools/webpack): elide imports for implements keywords#16995
Merged
kyliau merged 1 commit intoangular:masterfrom Feb 19, 2020
alan-agius4:token-express-type
Merged
fix(@ngtools/webpack): elide imports for implements keywords#16995kyliau merged 1 commit intoangular:masterfrom alan-agius4:token-express-type
implements keywords#16995kyliau merged 1 commit intoangular:masterfrom
alan-agius4:token-express-type
Conversation
Contributor
|
Asking @clydin for review instead since he's more familiar with this transformer and I am mostly out of office. |
clydin
reviewed
Feb 17, 2020
Running the `remove-ivy-jit-support-calls` and `remove_decorators` transformers causes the following TS bug microsoft/TypeScript#17552 which is why the `elide-imports` transformer exists in the first place. However, when having a syntax like the below; ```ts import { AccountComponentChild } from '../@types'; export class SignUpComponent implements AccountComponentChild{} ``` The `implements` parts of the class is called a `HeritageClause` with child statements of `ExpressionWithTypeArguments` also the same is for `abstract`. With this change we check the token of the `HeritageClause` and if it's an `ImplementsKeyword` we elide the import. Closes #16907
clydin
approved these changes
Feb 19, 2020
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Running the
remove-ivy-jit-support-callsandremove_decoratorstransformers causes the following TS bug microsoft/TypeScript#17552 which is why theelide-importstransformer exists in the first place.However, when having a syntax like the below;
The
implementsparts of the class is called aHeritageClausewith child statements ofExpressionWithTypeArgumentsalso the same is forabstract. With this change we check the token of theHeritageClauseand if it's anImplementsKeywordwe elide the import.Closes #16907
Ref TOOL-1324