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

fix(ngcc): move adjacent statements after helpers #33689

Closed

Conversation

@petebacondarwin
Copy link
Member

petebacondarwin commented Nov 8, 2019

// FW-1668

This change is a precursor to finding the end of a
class, which needs to search for helpers of many
different names.
Copy link
Member

gkalpak left a comment

LGTM 👍

Could you add some more information in the commit message on why "they must also put these statements after any helper calls"?

@petebacondarwin

This comment has been minimized.

Copy link
Member Author

petebacondarwin commented Nov 11, 2019

Could you add some more information in the commit message on why "they must also put these statements after any helper calls"?

I would if I knew why :-)

Previously the renderers were fixed so that they inserted extra
"adjacent" statements after the last static property of classes.

In order to help the build-optimizer (in Angular CLI) to be able to
tree-shake classes effectively, these statements should also appear
after any helper calls, such as `__decorate()`.

This commit moves the computation of this positioning into the
`NgccReflectionHost` via the `getEndOfClass()` method, which
returns the last statement that is related to the class.

FW-1668
@petebacondarwin petebacondarwin force-pushed the petebacondarwin:ngcc-adjacent-statements branch from 1ea2896 to e57d57a Nov 11, 2019
kara added a commit that referenced this pull request Nov 11, 2019
This change is a precursor to finding the end of a
class, which needs to search for helpers of many
different names.

PR Close #33689
kara added a commit that referenced this pull request Nov 11, 2019
)

Previously the renderers were fixed so that they inserted extra
"adjacent" statements after the last static property of classes.

In order to help the build-optimizer (in Angular CLI) to be able to
tree-shake classes effectively, these statements should also appear
after any helper calls, such as `__decorate()`.

This commit moves the computation of this positioning into the
`NgccReflectionHost` via the `getEndOfClass()` method, which
returns the last statement that is related to the class.

FW-1668

PR Close #33689
@kara kara closed this in 52d1500 Nov 11, 2019
kara added a commit that referenced this pull request Nov 11, 2019
)

Previously the renderers were fixed so that they inserted extra
"adjacent" statements after the last static property of classes.

In order to help the build-optimizer (in Angular CLI) to be able to
tree-shake classes effectively, these statements should also appear
after any helper calls, such as `__decorate()`.

This commit moves the computation of this positioning into the
`NgccReflectionHost` via the `getEndOfClass()` method, which
returns the last statement that is related to the class.

FW-1668

PR Close #33689
@petebacondarwin petebacondarwin deleted the petebacondarwin:ngcc-adjacent-statements branch Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.