Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

feat(@angular-devkit/build-optimizer): strip Angular decorators in __… - #210

Merged
filipesilva merged 1 commit into
angular:masterfrom
filipesilva:decorate-stripping
Oct 17, 2017
Merged

feat(@angular-devkit/build-optimizer): strip Angular decorators in __…#210
filipesilva merged 1 commit into
angular:masterfrom
filipesilva:decorate-stripping

Conversation

@filipesilva

Copy link
Copy Markdown
Contributor

…decorate call

@filipesilva

Copy link
Copy Markdown
Contributor Author

/cc @danbucholtz

IgorMinar
IgorMinar previously approved these changes Oct 17, 2017

@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.

the rest looks good.

return identifierIsMetadata(id, ngMetadata, checker);
});

return (elements.length > ngDecoratorCalls.length) ? ngDecoratorCalls : [exprStmt];

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 logic is hard to follow. maybe you want to say:

// if all decorators are metadata decorators then return the whole `Class = __decorate([...])'` statement so that it is removed in entirety
return (elements.length === ngDecoratorCalls.length) ? [exprStmt] : ngDecoratorCalls;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants