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

Add tests for elide imports and fix named imports with default imports #13243

Merged
merged 3 commits into from Dec 20, 2018
Merged

Add tests for elide imports and fix named imports with default imports #13243

merged 3 commits into from Dec 20, 2018

Conversation

alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Dec 20, 2018

  • test: add tests for elide imports
    This also adds the option to provide addition files when using createTypescriptContext this is paramount for the elide imports tests as without this certain symbols won't have the full details.

Which will cause tests to be false positive and re-surface issues like #13212

  • fix(@ngtools/webpack): drop only unused default import when used with… …
    … named imports

At the moment when having a default import together with a named import example:

import abc, { def } from './foo';

And the default import becomes unused it will drop the entire node which will caused used named imports to be dropped as well.

  • refactor: use getExportSpecifierLocalTargetSymbol and getShorthandAssignmentValueSymbol to handle symbols lookups

Use typechecker methods to handle special cases for ExportSpecifier and ShorthandPropertyAssignment

@alan-agius4 alan-agius4 changed the title Elide imports Add tests for elide imports and fix named imports with default imports Dec 20, 2018
This also adds the option to provide addition files when using `createTypescriptContext` this is paramount for the elide imports tests as without this certain symbols won't have the full details.

Which will cause tests to be false positive and re-surface issues like #13212
@ngbot
Copy link

ngbot bot commented Dec 20, 2018

Artifact Baseline Current Change
cli/new-production/test-project/main.js 175.29KB 175.29KB +3 bytes

Alan added 2 commits December 20, 2018 12:23
… named imports

At the moment when having a default import together with a named import example:
```
import abc, { def } from './foo';
```

And the default import becomes unused it will drop the entire node which will caused used named imports to be dropped as well.
…AssignmentValueSymbol` to handle symbols lookups

Use typechecker methods to handle special cases for `ExportSpecifier` and `ShorthandPropertyAssignment`
@alan-agius4 alan-agius4 added the target: major This PR is targeted for the next major release label Dec 20, 2018
@angular angular deleted a comment from ngbot bot Dec 20, 2018
Copy link
Member

@clydin clydin left a comment

Choose a reason for hiding this comment

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

nice work. 👍

@hansl hansl merged commit 3bc347c into angular:master Dec 20, 2018
@alan-agius4 alan-agius4 deleted the elide_imports branch December 20, 2018 20:06
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants