Skip to content

feat(@angular-devkit/build-optimizer): scrub ɵsetClassMetadata and ɵɵsetNgModuleScope calls#15664

Merged
vikerman merged 4 commits into
angular:masterfrom
filipesilva:bo-ivy-scrub
Sep 25, 2019
Merged

feat(@angular-devkit/build-optimizer): scrub ɵsetClassMetadata and ɵɵsetNgModuleScope calls#15664
vikerman merged 4 commits into
angular:masterfrom
filipesilva:bo-ivy-scrub

Conversation

@filipesilva
Copy link
Copy Markdown
Contributor

No description provided.

@filipesilva filipesilva added the target: major This PR is targeted for the next major release label Sep 24, 2019
@filipesilva filipesilva changed the title scrub ngFactoryDef and ngComponentDef assignments feat(@angular-devkit/build-optimizer): scrub ngFactoryDef and ngComponentDef assignments Sep 24, 2019
@filipesilva
Copy link
Copy Markdown
Contributor Author

filipesilva commented Sep 24, 2019

Note to reviewers: feat(@angular-devkit/build-optimizer): scrub ɵsetClassMetadata and ɵɵsetNgModuleScope calls is the main commit that, the others are smaller changes.

@filipesilva filipesilva changed the title feat(@angular-devkit/build-optimizer): scrub ngFactoryDef and ngComponentDef assignments feat(@angular-devkit/build-optimizer): scrub ɵsetClassMetadata and ɵɵsetNgModuleScope calls Sep 24, 2019
Copy link
Copy Markdown
Contributor

@IgorMinar IgorMinar left a comment

Choose a reason for hiding this comment

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

the rest looks great! thank for quick turnaround.

const exprStmt = node as ts.ExpressionStatement;
if (isDecoratorAssignmentExpression(exprStmt)) {
// Do checks that don't need the typechecker first and bail early.
if (isCtorParamsAssignmentExpression(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.

consider swapping the two checks to optimize for the build speed of Ivy code over the legacy ctorParam format.

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.

Done

@filipesilva
Copy link
Copy Markdown
Contributor Author

@vikerman suggested adding a e2e with lazy loaded chunk and track it on the size tracker to prevent regressions.

@IgorMinar
Copy link
Copy Markdown
Contributor

@filipesilva sgtm. I was going to add a similar e2e test to the angular repo as well. will this e2e test you intend to write be in the cli repo? I assume so. I guess it doesn't hurt to have this one in two places, but if you were to add the test just to the angular/angular repo then that would be fine as well.

@filipesilva
Copy link
Copy Markdown
Contributor Author

filipesilva commented Sep 25, 2019

For comparison, this is a new project with routing, before and after having a lazy route, and before this PR:

  • without lazy routes
-rw-r--r-- 1 kamik 197609 214K Sep 25 13:09 main-es2015.js
-rw-r--r-- 1 kamik 197609 236K Sep 25 13:09 main-es5.js
  • with lazy routes
-rw-r--r-- 1 kamik 197609  788 Sep 25 13:08 lazy-lazy-module-es2015.js
-rw-r--r-- 1 kamik 197609  788 Sep 25 13:08 lazy-lazy-module-es5.js
-rw-r--r-- 1 kamik 197609 301K Sep 25 13:08 main-es2015.js
-rw-r--r-- 1 kamik 197609 325K Sep 25 13:08 main-es5.js
  • with lazy routes, after this PR
-rw-r--r-- 1 kamik 197609  772 Sep 25 14:14 lazy-lazy-module-es2015.js
-rw-r--r-- 1 kamik 197609  772 Sep 25 14:14 lazy-lazy-module-es5.js
-rw-r--r-- 1 kamik 197609 258K Sep 25 14:14 main-es2015.js
-rw-r--r-- 1 kamik 197609 282K Sep 25 14:14 main-es5.js

@filipesilva
Copy link
Copy Markdown
Contributor Author

Note to caretaker: it is expected that the ci/angular: size check increases in size, as now we're tracking a new project with lazy routes, which also includes the router.

@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 Oct 26, 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.

5 participants