Skip to content

fix(@angular-devkit/build-optimizer): don't wrap classes which static… - #15201

Merged
vikerman merged 1 commit into
angular:masterfrom
alan-agius4:bo-wrap-classes-no-static
Jul 30, 2019
Merged

vikerman merged 1 commit into
angular:masterfrom
alan-agius4:bo-wrap-classes-no-static

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

… properties have been removed

At the moment the wrap-enums transfomers is being run prior to scrub-file and this is resulting classes which all static properties have been dropped to be wrapped in IIFE.

… properties have been removed

At the moment the `wrap-enums` transfomers is being run prior to `scrub-file` and this is resulting classes which all static properties have been dropped to be wrapped in IIFE.

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

I'm not sure this is correct... some of the patterns we identify in other transformers might not be identified correctly after this.

Can you check on AIO please? If this change is fine then it's size might go down slightly. Also try on AIO after removing all lazy imports (like https://github.com/angular/angular/blob/master/aio/src/app/custom-elements/element-registry.ts) to force module concatenation to put all angular code in the same bundle.

@alan-agius4

Copy link
Copy Markdown
Collaborator Author
  Before After
runtime-es2015.99abadbdba59ae29d1a4.js 2.98 2.98
defaultcode-code-example-module-ngfactorycode-code-tabs-module-ngfactory-es2015 51.4 51.3
announcement-bar-announcement-bar-module-ngfactory-es2015 2.56 2.56
api-api-list-module-ngfactory-es2015 8.1 8.1
assets-js-prettify-js-es2015 14.6 14.6
code-code-example-module-ngfactory-es2015 3.04 3.04
code-code-tabs-module-ngfactory-es2015 35.2 35
contributor-contributor-list-module-ngfactory-es2015 7.21 7.21
live-example-live-example-module-ngfactory-es2015 5.1 5.1
main-es2015 440 439
pollyfills-es2015 51.7 51.7
resource-resource-list-module-ngfactory-es2015 4.57 4.57
search-file-not-found-search-module-ngfactory-es2015 1.52 1.52
toc-toc-module-ngfactory-es2015 6.2 6.2
     
defaultcode-code-example-module-ngfactorycode-code-tabs-module-ngfactory-es5 57.2 57.2
runtime-es5 2.97 2.97
announcement-bar-announcement-bar-module-ngfactory-es5 2.7 2.7
api-api-list-module-ngfactory-es5 8.68 8.68
assets-js-prettify-js-es5 14.6 14.6
code-code-example-module-ngfactory-es5 3.47 3.47
code-code-tabs-module-ngfactory-es5 37.9 37.9
contributor-contributor-list-module-ngfactory-es5 7.41 7.41
live-example-live-example-module-ngfactory-es5 5.37 5.37
main-es5.21d0b9920181adb17b7f.js 499 499
polyfills-es5 128 128
resource-resource-list-module-ngfactory-es5 4.73 4.73
search-file-not-found-search-module-ngfactory-es5 1.58 1.58
toc-toc-module-ngfactory-es5 6.53 6.53
  1414.32 1413.02

@alan-agius4

Copy link
Copy Markdown
Collaborator Author

Without lazy loading

  Before After
main-es2015 514 513
main-es5 582 582
  1096 1095

@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Jul 30, 2019
@filipesilva

Copy link
Copy Markdown
Contributor

Everything looks good then. Whatever necessity we had for ordering those transforms does not seem to apply anymore. @clydin can you think of any problem with the order?

@filipesilva
filipesilva requested a review from clydin July 30, 2019 10:03
@alan-agius4
alan-agius4 requested a review from filipesilva July 30, 2019 17:42
@vikerman
vikerman merged commit 20b16a2 into angular:master Jul 30, 2019
@alan-agius4
alan-agius4 deleted the bo-wrap-classes-no-static branch July 31, 2019 04:27
@filipesilva

Copy link
Copy Markdown
Contributor

I guess #15314 is why we had the previous order? The scrub file transformer would scoop stuff in, and then the tslint helpers wouldn't get the pure comment.

@alan-agius4

Copy link
Copy Markdown
Collaborator Author

@filipesilva yes indeed

@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 Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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