Skip to content

Control emitting Ivy class metadata and Angular module scope information - #16694

Merged
kyliau merged 2 commits into
angular:masterfrom
clydin:ngtools-ivy-devmode
Jan 28, 2020
Merged

kyliau merged 2 commits into
angular:masterfrom
clydin:ngtools-ivy-devmode

Conversation

@clydin

@clydin clydin commented Jan 17, 2020

Copy link
Copy Markdown
Member

This change allows the import eliding capabilities of the plugin to more completely remove the effects of the setClassMetadata and setNgModuleScope functions. This provides equivalent behavior to the Decorator removal functionality for View Engine. As a result, Angular components are no longer retained in chunks that do not use the component.

This corrects the factory code location problem discussed in #16146 (comment).

@clydin clydin changed the title WIP: Control emitting Ivy class metadata and Angular module scope information Control emitting Ivy class metadata and Angular module scope information Jan 17, 2020
@clydin clydin added the target: patch This PR is targeted for the next patch release label Jan 23, 2020

@IgorMinar IgorMinar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this still needs tests, but it looks like it's on the right path.

@IgorMinar
IgorMinar requested a review from filipesilva January 27, 2020 14:36
@IgorMinar

Copy link
Copy Markdown
Contributor

@filipesilva can you please also review? thanks

@filipesilva filipesilva left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should have some transformer tests to make sure this does what we think it should do, and an e2e that verifies the symbols aren't there in a prod build.

We already know the app still works because we have e2e that test optimized apps.

@clydin

clydin commented Jan 27, 2020

Copy link
Copy Markdown
Member Author

Tests and optimizations are the remaining open items for this. I was planning on finishing this up today.

@clydin
clydin force-pushed the ngtools-ivy-devmode branch from 051c88f to f029265 Compare January 28, 2020 01:54

@IgorMinar IgorMinar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this looks quite good to me, I left a few more comments.

I also want to address @filipesilva's comments:

and an e2e that verifies the symbols aren't there in a prod build.

yes, if it's typical for us to have e2e tests, can you add one too? Or since this should be the default behavior, we should just extend an existing e2e tests and check for these symbols (assuming that we have an e2e test like this already).

This behaviour begs the question though: are these calls present in js files inside node modules? Should they be removed from there too? What happens to workspace libraries built with Ivy (even though they shouldn't be built with Ivy for production)?

we don't support Ivy code being shipped to npm, so don't worry about it. If someone does it anyway, they'll face all kinds of issues and payload deopts are not going to be high on their list.

@clydin clydin removed the state: WIP label Jan 28, 2020
@IgorMinar
IgorMinar marked this pull request as ready for review January 28, 2020 16:27
@clydin
clydin force-pushed the ngtools-ivy-devmode branch from f029265 to 77fcfdb Compare January 28, 2020 16:41
… module scope

This change allows the import eliding capabilities of the plugin to more completely remove the effects of the `setClassMetadata` and `setNgModuleScope` functions.  This provides equivalent behavior to the Decorator removal functionality for ViewEngine.
@clydin
clydin force-pushed the ngtools-ivy-devmode branch from 77fcfdb to 8ff7440 Compare January 28, 2020 16:48
@clydin clydin added the action: merge The PR is ready for merge by the caretaker label Jan 28, 2020
@kyliau
kyliau merged commit f85c00a into angular:master Jan 28, 2020
@clydin
clydin deleted the ngtools-ivy-devmode branch January 28, 2020 18:48
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 Feb 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants