angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Increased main.js bundle size but less lazy chunks after updating to angular 9.0.0-rc.1

Open wambowams opened this issue 7 years ago β€’ 58 comments

🐞 Bug report

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Description

After updating from Angular 8.2.3 to 9.0.0-rc.1 the bundle size was increased for main module and some of the feature modules: Before it was: bundle_before9

After updating to Angular 9.0.0-rc.1 it is image

πŸ”¬ Minimal Reproduction

running ng build --prod --namedChunks with following configuration:

            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false,
              "commonChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "1mb",
                  "maximumError": "2mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "6kb"
                }
              ],
              "serviceWorker": true,
              "ngswConfigPath": "ngsw-config.json"
            }
          }

🌍 Your Environment


Angular CLI: 9.0.0-rc.1
Node: 10.15.3
OS: win32 x64
Angular: 9.0.0-rc.1
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.0-rc.1
@angular-devkit/build-angular     0.900.0-rc.1
@angular-devkit/build-optimizer   0.900.0-rc.1
@angular-devkit/build-webpack     0.900.0-rc.1
@angular-devkit/core              9.0.0-rc.1
@angular-devkit/schematics        9.0.0-rc.1
@angular/cdk                      8.2.3
@angular/material                 8.2.3
@ngtools/webpack                  9.0.0-rc.1
@schematics/angular               9.0.0-rc.1
@schematics/update                0.900.0-rc.1
rxjs                              6.5.3
typescript                        3.6.4
webpack                           4.41.2

wambowams avatar Nov 11 '19 14:11 wambowams

Any chance of reproduction please?

alan-agius4 avatar Nov 11 '19 15:11 alan-agius4

I will try this afternoon, but its little bit hard as its a customer's project

wambowams avatar Nov 11 '19 15:11 wambowams

@wambowams just to be really sure, can you show the sizes on disk for the dist folder? Sometime in 8 we had a bug where the ng build reported sizes weren't correct.

filipesilva avatar Nov 12 '19 14:11 filipesilva

I hope this comment can help. Faced with increasing main module size(in es2015) from 1.06 to 1.15 MB (and es5 size increased too), but all other modules decreased. Full application size decreased from 3.44 to 2.67 MB. webpack-bundle-analyzer shows that it caused by angular/material. it increased from 127 to 200 kB and increase main module. core and cli is 9 RC1, material and cdk is 9 RC0

p.s. File sizes at disk are increased, checked this.

parys avatar Nov 12 '19 19:11 parys

@parys can you check if you have the same number of files? I wouldn't be surprised if only of the lazy modules had been merged with the main module.

filipesilva avatar Nov 13 '19 11:11 filipesilva

@filipesilva you are right. 86 files (es5 + es2015) in angular 9 rc1 90 files (es5 + es2015) angular 8.2.13 just angular files, skipped css and service-worker files (same count). checked again, my files (src) decreased ~ 40kB animations + platform-browser decreased ~10kB common increased ~24kB. forms increased ~15kB router increased ~5kB core increased ~7kB -50(-40-10) and +52(24+15+5+7) cdk increased ~13kB material increased ~82kb zone.js, hummerjs, rxjs same size so as I see angular/material is guilty of increasing size by 90kB. all angular packages + my main source is around same size. as I see no one module merged to main. It combined between them at lazy load module level.

parys avatar Nov 13 '19 15:11 parys

@parys Thank u for the tip, I have multiple material imports in different lazy loaded modules. @filipesilva I will check the material problem and the disk filesize tomorrow at work

wambowams avatar Nov 13 '19 21:11 wambowams

I have a simmiliar experience

9.0.0-rc.1

chunk {2} polyfills-es2015.c7a30df4bc9d877b298c.js (polyfills) 35.9 kB [initial] [rendered]
chunk {8} 8-es2015.ada4e33bfaa3f31731ae.js () 10.1 kB  [rendered]
chunk {8} 8-es5.ada4e33bfaa3f31731ae.js () 10.7 kB  [rendered]
chunk {9} 9-es2015.709f406ec03c989f0f1f.js () 4.28 kB  [rendered]
chunk {9} 9-es5.709f406ec03c989f0f1f.js () 4.43 kB  [rendered]
chunk {11} 11-es2015.226745742bd2ed46cdb3.js () 1.08 kB  [rendered]
chunk {11} 11-es5.226745742bd2ed46cdb3.js () 1.21 kB  [rendered]
chunk {0} runtime-es2015.b97001bcf5aa06731258.js (runtime) 2.43 kB [entry] [rendered]      
chunk {0} runtime-es5.b97001bcf5aa06731258.js (runtime) 2.43 kB [entry] [rendered]
chunk {7} 7-es2015.6bd84e6ce375884a9572.js () 19.6 kB  [rendered]
chunk {7} 7-es5.6bd84e6ce375884a9572.js () 20.3 kB  [rendered]
chunk {13} 13-es2015.a42b4b1c7354dfe6f2ac.js () 2.41 kB  [rendered]
chunk {13} 13-es5.a42b4b1c7354dfe6f2ac.js () 2.91 kB  [rendered]   
chunk {12} 12-es2015.d5800d5600a902e895f5.js () 5.34 kB  [rendered]
chunk {12} 12-es5.d5800d5600a902e895f5.js () 5.85 kB  [rendered]   
chunk {6} 6-es2015.59e69d5e0f464084389e.js () 5.73 kB  [rendered]  
chunk {6} 6-es5.59e69d5e0f464084389e.js () 6.35 kB  [rendered]     
chunk {10} 10-es2015.e06cb514cf8a21185f7d.js () 55.7 kB  [rendered]
chunk {10} 10-es5.e06cb514cf8a21185f7d.js () 59.1 kB  [rendered]   
chunk {5} 5-es2015.a3e74ebf9abaa7a35ba5.js () 109 kB  [rendered]   
chunk {5} 5-es5.a3e74ebf9abaa7a35ba5.js () 111 kB  [rendered]
chunk {1} main-es2015.afec893c92139b333131.js (main) 1.83 MB [initial] [rendered]
chunk {1} main-es5.afec893c92139b333131.js (main) 2.03 MB [initial] [rendered]
chunk {4} styles.f7c48dea9a89feb2b99e.css (styles) 74.4 kB [initial] [rendered]
chunk {scripts} scripts.03e042f1f102bf0e2ed8.js (scripts) 19.9 kB [entry] [rendered]
Date: 2019-11-14T07:40:19.035Z - Hash: 4d5c0fbe7ba52a60a6cb - Time: 154070ms

exact numbers on disk

image

vs 8

chunk {0} common-es2015.f65f5aa566db4e06d105.js (common) 9.84 kB  [rendered]
chunk {1} runtime-es2015.dc5fd48940e2007b44fd.js (runtime) 4.49 kB [entry] [rendered]
chunk {2} 2-es2015.b66890fe6cb0d0ba93d2.js () 57.8 kB  [rendered]
chunk {3} 3-es2015.623227132f5ef6839c15.js () 20 kB  [rendered]
chunk {4} main-es2015.43343003de40fbc4ec5e.js (main) 2.21 MB [initial] [rendered]
chunk {5} polyfills-es2015.add85f0e35cf86eeff4a.js (polyfills) 63.4 kB [initial] [rendered]
chunk {6} polyfills-es5-es2015.5d4ed357ffea17c6a0dd.js (polyfills-es5) 225 kB [initial] [rendered]
chunk {7} styles.e5e1b71b2548c50cb6c5.css (styles) 72.3 kB [initial] [rendered]
chunk {8} 8-es2015.6bd7263fab8d903b0fb9.js () 254 kB  [rendered]
chunk {9} 9-es2015.478af0fa902e9a4f6539.js () 194 kB  [rendered]
chunk {10} 10-es2015.1be5d5f2474cd46c8288.js () 59.8 kB  [rendered]
chunk {11} 11-es2015.dffb2a20c94c68a0bf1c.js () 28 kB  [rendered]
chunk {12} 12-es2015.321a3b949196c255ca8e.js () 19.4 kB  [rendered]
chunk {13} 13-es2015.0a30a70a9c35bf08dddb.js () 156 kB  [rendered]
chunk {14} 14-es2015.9cf10db117bbba60ae53.js () 9.26 kB  [rendered]
chunk {15} 15-es2015.9482769a0e8d8a81eb5b.js () 27.7 kB  [rendered]
chunk {16} 16-es2015.4dcc1c7a5105ce379783.js () 12.8 kB  [rendered]
chunk {scripts} scripts.03e042f1f102bf0e2ed8.js (scripts) 19.8 kB [entry] [rendered]
Date: 2019-11-12T10:53:35.219Z - Hash: ede763d16e9e87e7cc2b - Time: 200420ms

in 8 the numbers reported are wrong ...

exact numbers disk v8

image

elvirdolic avatar Nov 14 '19 07:11 elvirdolic

@elvirdolic I think something similar happened in your case: version 8 has 13 application js bundles, while version 9 has only 10 application js bundles. The extra size seems to have come from code moving from some of the lazy bundles back into the main chunk.

filipesilva avatar Nov 14 '19 10:11 filipesilva

@filipesilva I checked the file sizes. These are my results: For Version 8.2.13: bundle_before9 With size on the disk:

14.11.2019  14:33            60.658 0-es5.566bec7d8e9f9cda780a.js
14.11.2019  14:34            52.826 1-es2015.e9fd6dadef4caff07749.js
14.11.2019  14:33            19.960 5-es5.36e53960b8db97ac7f91.js
14.11.2019  14:34            19.751 6-es2015.4e348f6d41fafc26f200.js
14.11.2019  14:33             3.006 6-es5.c07b99f036dd7c321da9.js
14.11.2019  14:34             2.865 7-es2015.2bf07606f9c036fbb354.js
14.11.2019  14:33           120.951 7-es5.68d52a09dc28bd20e670.js
14.11.2019  14:34           112.920 8-es2015.3f0e8b4086b9f6ef70cc.js
14.11.2019  14:33            61.407 8-es5.82c8181b7341226961bb.js
14.11.2019  14:34            61.022 9-es2015.70ca7e368f9a76b59964.js
14.11.2019  14:34            21.375 common-es2015.54e83193ca37b87dd09a.js
14.11.2019  14:33            21.375 common-es5.0235b6e6e922441d2689.js
14.11.2019  14:34             1.542 index.html
14.11.2019  14:34           672.175 main-es2015.3ef131ef7dbb2e06e7da.js
14.11.2019  14:33           766.803 main-es5.916e65e01e2ceefdf20d.js
14.11.2019  14:34             1.133 manifest.webmanifest
14.11.2019  14:34           140.542 ngsw-worker.js
14.11.2019  14:34            41.830 ngsw.json
14.11.2019  14:34            37.304 polyfills-es2015.b9d61c8420fecac73ade.js
14.11.2019  14:33           113.605 polyfills-es5.22fcc391de73fbc61a39.js
14.11.2019  14:34             2.338 runtime-es2015.bd8a6f434a70643bf820.js
14.11.2019  14:33             2.335 runtime-es5.89f6f6bdf6a1c8dfa33b.js
14.11.2019  14:34               519 safety-worker.js
14.11.2019  14:34           180.853 styles.a78279866f8ed644cc62.css
14.11.2019  14:34               519 worker-basic.min.js
              25 Datei(en),      2.519.617 Bytes

And for Version 9.0.0-rc.1 bundle_after9 With files sizes:

14.11.2019  14:44           114.857 1-es2015.2eab0115fa339bfffb8d.js
14.11.2019  14:44           123.984 1-es5.2eab0115fa339bfffb8d.js
14.11.2019  14:44             8.158 6-es2015.061ae9b8b08999f9dc7d.js
14.11.2019  14:44             8.695 6-es5.061ae9b8b08999f9dc7d.js
14.11.2019  14:44             2.583 7-es2015.480bd5ab1960564ac076.js
14.11.2019  14:44             3.160 7-es5.480bd5ab1960564ac076.js
14.11.2019  14:45           100.520 8-es2015.b2e7b92e6a7ae57c60ad.js
14.11.2019  14:45           112.264 8-es5.b2e7b92e6a7ae57c60ad.js
14.11.2019  14:44            15.538 9-es2015.874764ed7c67c1148fb4.js
14.11.2019  14:44            16.387 9-es5.874764ed7c67c1148fb4.js
14.11.2019  14:45             1.560 index.html
14.11.2019  14:45           756.609 main-es2015.ba08a7a566bbc3160430.js
14.11.2019  14:45           890.459 main-es5.ba08a7a566bbc3160430.js
02.10.2019  10:25             1.133 manifest.webmanifest
14.11.2019  14:45           141.320 ngsw-worker.js
14.11.2019  14:45            41.662 ngsw.json
14.11.2019  14:44            36.808 polyfills-es2015.d339c9d166f5d5423290.js
14.11.2019  14:45           127.945 polyfills-es5.7a437adb78ef54de54d0.js
14.11.2019  14:44             2.389 runtime-es2015.62474928f6359459e271.js
14.11.2019  14:44             2.386 runtime-es5.62474928f6359459e271.js
14.11.2019  14:45               519 safety-worker.js
14.11.2019  14:44           190.800 styles.2d23fff4184672f07cf1.css
14.11.2019  14:45               519 worker-basic.min.js
              23 Datei(en),      2.700.258 Bytes

There are less files in Version 9.0.0-rc.1, but the overall file size is increased. I didn't update material, so there shouldn't been any restructuring. Here is my package.json:

{
  "name": "frontend",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points",
    "start": "ng serve",
    "build": "ng build",
    "build:stats": "ng build --stats-json --namedChunks=true --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "analyze": "webpack-bundle-analyzer dist/stats-es2015.json"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~9.0.0-rc.1",
    "@angular/cdk": "~8.2.3",
    "@angular/common": "~9.0.0-rc.1",
    "@angular/compiler": "~9.0.0-rc.1",
    "@angular/core": "~9.0.0-rc.1",
    "@angular/forms": "~9.0.0-rc.1",
    "@angular/material": "^8.2.3",
    "@angular/platform-browser": "~9.0.0-rc.1",
    "@angular/platform-browser-dynamic": "~9.0.0-rc.1",
    "@angular/router": "~9.0.0-rc.1",
    "@angular/service-worker": "~9.0.0-rc.1",
    "@auth0/angular-jwt": "^3.0.0",
    "@ngrx/effects": "^8.5.0",
    "@ngrx/entity": "^8.5.0",
    "@ngrx/router-store": "^8.5.0",
    "@ngrx/schematics": "^8.5.0",
    "@ngrx/store": "^8.5.0",
    "@ngrx/store-devtools": "^8.5.0",
    "date-fns": "^2.6.0",
    "hammerjs": "^2.0.8",
    "rxjs": "~6.5.3",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.900.0-rc.1",
    "@angular/cli": "^9.0.0-rc.1",
    "@angular/compiler-cli": "~9.0.0-rc.1",
    "@angular/language-service": "~9.0.0-rc.1",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.6.4"
  }
}

wambowams avatar Nov 14 '19 14:11 wambowams

While 8.2.x of Angular Material and the CDK may not completely break when used with Angular 9.0.0-rc.1, this is not a supported configuration. Please update Angular Material and the CDK to the latest RC (9.0.0-rc.1). There were quite a number of changes to better support Ivy in the 9.0.0-x releases of Angular Material/CDK that did not go into the 8.2.x releases.

It looks like @parys is the only one who has reported an issue with a supported configuration. Is it possible that you can post a GitHub repo with a reproduction?

Splaktar avatar Nov 14 '19 19:11 Splaktar

@Splaktar my setup is based on angular material 9.0.0-x. angular 9.0.0-x and angular-cli 9.0.0-x @filipesilva how is this possible without any code changes, just run material schematics update where the import path of the modules changed.

elvirdolic avatar Nov 14 '19 20:11 elvirdolic

@Splaktar Right now have no time. but you can look at my repo mylfc. in master is the latest stable angular. At brunch poc/angular9 updated here is my app branches https://github.com/parys/MyLFC/tree/master/src/MyLiverpool.Web.WebApiNext/ClientApp https://github.com/parys/MyLFC/tree/poc/angular9/src/MyLiverpool.Web.WebApiNext/ClientApp if it's not working solution for you please notify me and when I will have some time will post repo with only angular apps without dotnet stuff :)

parys avatar Nov 14 '19 20:11 parys

@parys based on the commit, did you use ng update @angular/material @angular/cdk --next to do this update? It doesn't look like the ng update schematics ran.

Can you try running the update schematics manually via ng update @angular/material --migrate-only --from 8 --to 9?

@elvirdolic did you run this manually for your project before posting those size results?

This issue was fixed in PR https://github.com/angular/components/pull/17704 today. We're hoping to get out an rc.2 ASAP so that these migrations can get more testing.

Splaktar avatar Nov 14 '19 22:11 Splaktar

@Splaktar yes i run the schematics manually with β€”migrate-only flag when I realized that it didn’t worked by default. We have a quiet big monorepo running this manually would have take too much time. I experienced that some files were not changed and I changed the import paths manually.

elvirdolic avatar Nov 15 '19 05:11 elvirdolic

@elvirdolic if you have any info on why certain files might have been missed, please open up an issue for that in the Angular Components repo.

Splaktar avatar Nov 15 '19 06:11 Splaktar

@parys thank you for the repro! This are the steps I followed to use it:

 git clone https://github.com/parys/MyLFC/
cd MyLFC/src/MyLiverpool.Web.WebApiNext/ClientApp/
yarn
yarn build --output-path dist/ivy

This got me an Ivy build in dist/ivy.

Then I added "angularCompilerOptions": { "enableIvy": false } to src/tsconfig.app.json and ran yarn build --output-path dist/ve to get a View Engine (non-Ivy) build in dist/ve.

To calculate the total size for es2015 bundles in Ivy and VE I used the following commands:

$ du -ach --max-depth=1 dist/ivy/*-es2015*.js
20K     dist/ivy/10-es2015.66f1eb6cd644d67f15ac.js
40K     dist/ivy/11-es2015.0b25ed23683e63edae11.js
24K     dist/ivy/12-es2015.3a06345c9606b3cb8362.js
20K     dist/ivy/13-es2015.8b5a695de5cd68380ac6.js
36K     dist/ivy/14-es2015.45a5aaca76e3deccec4e.js
12K     dist/ivy/15-es2015.13c04e1a0449697b4370.js
16K     dist/ivy/1-es2015.04de2045cc179e64f670.js 
724K    dist/ivy/20-es2015.d70ba6b906a9303a4044.js
20K     dist/ivy/21-es2015.1ae7bc356bff8b92250c.js
8.0K    dist/ivy/22-es2015.97b04a055b5f962e0309.js
20K     dist/ivy/23-es2015.f48ce3c563c84873e4ce.js
20K     dist/ivy/24-es2015.b58ac4301d3a403ff8c4.js
16K     dist/ivy/25-es2015.f779726ae819aa9739f6.js
36K     dist/ivy/26-es2015.01ae8157f3f380909ea2.js
28K     dist/ivy/27-es2015.a5154c0aee44ea51e928.js
52K     dist/ivy/28-es2015.fa9edb5e0d2684ee21ee.js
52K     dist/ivy/29-es2015.18d6fa26c54cd9313e7c.js
32K     dist/ivy/2-es2015.59540042273d26a17f33.js 
4.0K    dist/ivy/30-es2015.d5b3aae4d15fbad1c629.js
8.0K    dist/ivy/31-es2015.121dfca27ac90849a097.js
8.0K    dist/ivy/32-es2015.51a965f1045bc0e40032.js
8.0K    dist/ivy/33-es2015.e49cdd59d097a7be93ce.js
88K     dist/ivy/34-es2015.b7bb306b334a8dff2b75.js
16K     dist/ivy/35-es2015.a9b5ea4321a9fa57bcdb.js
8.0K    dist/ivy/36-es2015.7ba869149da02b085bf4.js
16K     dist/ivy/37-es2015.ef6457b56281155d3388.js
8.0K    dist/ivy/38-es2015.40bd972c02184a18eef1.js
4.0K    dist/ivy/39-es2015.b047fd864a142314cfd6.js
16K     dist/ivy/3-es2015.cbe344149634737fc684.js 
12K     dist/ivy/40-es2015.8c9381dc0ec0f646cd24.js       
8.0K    dist/ivy/41-es2015.d847d183be44b05fa266.js       
36K     dist/ivy/42-es2015.96223f01291c211cd4ca.js       
12K     dist/ivy/43-es2015.b62260233be0d6f8d472.js       
20K     dist/ivy/44-es2015.1220c9a4e782b623849e.js       
28K     dist/ivy/4-es2015.b842266e2f6893b4dc3c.js        
16K     dist/ivy/5-es2015.084e91003abe78df367e.js        
64K     dist/ivy/6-es2015.472e4ff75cdfb2259d88.js        
20K     dist/ivy/8-es2015.160eead525971e57ec5d.js        
48K     dist/ivy/9-es2015.e1f46ad685ec827665c5.js        
24K     dist/ivy/common-es2015.1cc936be97b3297c7814.js   
1.2M    dist/ivy/main-es2015.d29f2ce5e2c36181e304.js     
1.0K    dist/ivy/polyfills-es2015.f3658a1e714c1192c0ee.js
4.0K    dist/ivy/runtime-es2015.0e22c5d5d399b8826217.js  
2.8M    total
$ du -ach --max-depth=1 dist/ve/*-es2015*.js
16K     dist/ve/11-es2015.436fd4d1bf6c2f0af9f9.js
16K     dist/ve/12-es2015.ea4b19038c80d89e69ce.js
32K     dist/ve/13-es2015.efc10db2fca227bbe236.js
60K     dist/ve/14-es2015.91df8614ec1caae43957.js
40K     dist/ve/15-es2015.2990bb15dfa6ce50f91a.js
20K     dist/ve/16-es2015.e0377ebbf3e47c6176cf.js
24K     dist/ve/17-es2015.5ec1d39a99d8da6bcc2c.js
56K     dist/ve/18-es2015.6bf738114da2a757bfbf.js
48K     dist/ve/19-es2015.4975181c69a937241848.js
12K     dist/ve/1-es2015.e2edbcc2ba94d3eeb590.js
724K    dist/ve/24-es2015.a54325b4608772fa6a63.js
60K     dist/ve/25-es2015.e4b5460568b28b30e4f6.js
56K     dist/ve/26-es2015.b3a858106e8843e08d0a.js
44K     dist/ve/27-es2015.75f511dd04669a4298f5.js
60K     dist/ve/28-es2015.9fbb6faf061afb5906da.js
140K    dist/ve/29-es2015.acbf6174001c8fadef14.js
28K     dist/ve/2-es2015.d988558ff162cb002673.js
12K     dist/ve/30-es2015.31b863d3559f50aacc60.js
144K    dist/ve/31-es2015.3e5f8dea4af5ba9f5e08.js
32K     dist/ve/32-es2015.182bc0c78723ed7d0b05.js
48K     dist/ve/33-es2015.6f3cc3b8b1b9be1ab8a2.js
80K     dist/ve/34-es2015.9ee5d6fb696cc566e922.js
52K     dist/ve/35-es2015.1940a4b6b9de5becc968.js
80K     dist/ve/36-es2015.4e2148a4004807778a4e.js
20K     dist/ve/37-es2015.bb2a2644e78a5ad4b82e.js
12K     dist/ve/38-es2015.9081e5668f1f357b5284.js
16K     dist/ve/39-es2015.17e16102a3aefbc4e3fe.js
4.0K    dist/ve/3-es2015.5e726b861d01ef28e2b0.js
172K    dist/ve/40-es2015.f2a15b2740f8fdc676b7.js
12K     dist/ve/41-es2015.6a33304b86fe61a6c7bf.js
64K     dist/ve/42-es2015.577ec06bbd3d89f34bdb.js
44K     dist/ve/43-es2015.d1a8977b4782c345b13e.js
8.0K    dist/ve/44-es2015.520a10ae0e9eaa3125dd.js
28K     dist/ve/45-es2015.0a07fd9a79e4bc0ebecc.js
12K     dist/ve/46-es2015.a4ab78d3fffea4014f81.js
16K     dist/ve/47-es2015.d6b5df0f892830a121d6.js
44K     dist/ve/48-es2015.2f5b1e959ada640f93e3.js
24K     dist/ve/4-es2015.f151106c7ac588e420d4.js
20K     dist/ve/5-es2015.79b722303bba5036b8ec.js
16K     dist/ve/6-es2015.5302d2088d0cc1cb1b35.js
32K     dist/ve/7-es2015.c83e7bb4e8f7349d9f16.js
12K     dist/ve/8-es2015.5a2be8ff289c8acaad71.js
56K     dist/ve/9-es2015.6b38148134b0713697bc.js
28K     dist/ve/common-es2015.d8f40e56a357ada60df5.js
1.1M    dist/ve/main-es2015.cc5edbff7dd51d002dd6.js
1.0K    dist/ve/polyfills-es2015.b998c65176a95cc7e582.js
4.0K    dist/ve/runtime-es2015.c3b1be294314c03cc5e5.js
3.6M    total

I can verify exactly what you described: Ivy is a total of 2.8M while VE is 3.6M. Ivy did have a slightly bigger (1.2 vs 1.1M) main bundle.

I chalk this one off as a victory for Ivy though. It's a huge size savings!

filipesilva avatar Nov 15 '19 11:11 filipesilva

@elvirdolic well anytime that dependencies are updated, the total application code changes. In version 9 we also switch projects over to using Ivy so that might change things further.

@elvirdolic @wambowams if you can provide me access to the project I can investigate your cases directly. Making a private github project (which is free now) and inviting me to it might be the best way to do it without exposing client projects to the web.

filipesilva avatar Nov 15 '19 11:11 filipesilva

@filipesilva I'm not allowed to share the projects source to anyone outside our company. But thank u for the offer. I will update material and will take more attention to file size over the next releases.

wambowams avatar Nov 15 '19 13:11 wambowams

Also tested in https://github.com/filipesilva/dashboard/tree/fs-test-setup, saw similar results:

git clone https://github.com/filipesilva/dashboard
cd dashboard
git checkout fs-test-setup
ng build --aot --prod --output-path .tmp/frontend-ivy

Then added "angularCompilerOptions": { "enableIvy": true } to ./tsconfig.json and ran ng build --aot --prod --output-path .tmp/frontend-ve.

Results for Ivy:

$ du -ach --max-depth=1 .tmp/frontend-ivy/*-es2015*.js
84K     .tmp/frontend-ivy/10-es2015.6f4faffc959274090f9d.js
4.0K    .tmp/frontend-ivy/11-es2015.36e2a5fbce179fd6bfc9.js       
24K     .tmp/frontend-ivy/12-es2015.9b8e8cbc45fb70045aa6.js       
8.0K    .tmp/frontend-ivy/13-es2015.8639ada61223297036c8.js       
4.0K    .tmp/frontend-ivy/14-es2015.70bfa728e6305f3bf49e.js       
4.0K    .tmp/frontend-ivy/15-es2015.bc088c4a5545dcdcdd78.js       
4.0K    .tmp/frontend-ivy/16-es2015.6e4f169c715a26581157.js       
8.0K    .tmp/frontend-ivy/17-es2015.2a6415476a0b3f4076de.js       
24K     .tmp/frontend-ivy/18-es2015.33c1cd5b43c5e5a4475f.js       
44K     .tmp/frontend-ivy/19-es2015.280da7eef72991032bd1.js       
8.0K    .tmp/frontend-ivy/20-es2015.9f2a79d2e1f6ff5c506b.js       
4.0K    .tmp/frontend-ivy/21-es2015.a07a4e7987898007cc72.js       
4.0K    .tmp/frontend-ivy/22-es2015.26904a217348123894c5.js       
8.0K    .tmp/frontend-ivy/23-es2015.275c85d6360c502f2fa4.js       
8.0K    .tmp/frontend-ivy/24-es2015.a7ce1269de98e2955334.js       
4.0K    .tmp/frontend-ivy/25-es2015.4716298640d1daf5f3a3.js       
8.0K    .tmp/frontend-ivy/26-es2015.dafbd4a668674aa47863.js       
12K     .tmp/frontend-ivy/27-es2015.42f39267584cfb03ca52.js       
8.0K    .tmp/frontend-ivy/28-es2015.d21fec7c8cc95ec2663d.js       
28K     .tmp/frontend-ivy/29-es2015.8bbe941fa856fc584884.js       
8.0K    .tmp/frontend-ivy/30-es2015.67e6fd53db209e6ea7fc.js
4.0K    .tmp/frontend-ivy/31-es2015.61dca86dd294dbaf83a4.js
4.0K    .tmp/frontend-ivy/32-es2015.85b68b349981b420df3b.js
8.0K    .tmp/frontend-ivy/33-es2015.54878e9f4ae10f91bc30.js
8.0K    .tmp/frontend-ivy/34-es2015.e4d2eddedde5e6eecb03.js
8.0K    .tmp/frontend-ivy/35-es2015.55e8d32e09baaba8ec65.js
8.0K    .tmp/frontend-ivy/36-es2015.badfb43e0452e0f43b1a.js
16K     .tmp/frontend-ivy/37-es2015.9bb7c75f9e9a7942e68e.js
912K    .tmp/frontend-ivy/6-es2015.400ab530e682280da428.js
296K    .tmp/frontend-ivy/7-es2015.c3abaeeaf0ea9a989a35.js
4.0K    .tmp/frontend-ivy/8-es2015.2133ac2e9d31e5a424df.js
8.0K    .tmp/frontend-ivy/9-es2015.e3edc7a4b5ac37af2517.js
8.0K    .tmp/frontend-ivy/common-es2015.f0d55a8f5317ef021c24.js
2.8M    .tmp/frontend-ivy/main-es2015.0962b245b0131a5cabfe.js
244K    .tmp/frontend-ivy/polyfills-es2015.6a454b045944ad8d7d8c.js
4.0K    .tmp/frontend-ivy/runtime-es2015.7acb8940f2851ad947b9.js
4.6M    total

Results for VE:

$ du -ach --max-depth=1 .tmp/frontend-ve/*-es2015*.js
36K     .tmp/frontend-ve/0-es2015.e4256bca91e561a798c7.js
24K     .tmp/frontend-ve/10-es2015.e5cc1cc1ac5e89f00d91.js
24K     .tmp/frontend-ve/11-es2015.f069791b41a7d1e72d5d.js
28K     .tmp/frontend-ve/12-es2015.f87dedc9b2fcebd18256.js
24K     .tmp/frontend-ve/13-es2015.691cc2d08c3e226282ae.js
24K     .tmp/frontend-ve/14-es2015.f216a2fd6729f21077fd.js
24K     .tmp/frontend-ve/15-es2015.c3149a6c08a82ccba9f9.js
28K     .tmp/frontend-ve/16-es2015.51946c2f1e72245cba88.js
36K     .tmp/frontend-ve/17-es2015.7db47689cb2447696f72.js
28K     .tmp/frontend-ve/18-es2015.64361d5edfec9245b9d2.js
956K    .tmp/frontend-ve/23-es2015.5929526f56da02d65a16.js
304K    .tmp/frontend-ve/24-es2015.b4a19b70f21c2bcd86b1.js
64K     .tmp/frontend-ve/25-es2015.989224f1711be675ee6b.js
24K     .tmp/frontend-ve/26-es2015.220ed13d3063a7751d97.js
24K     .tmp/frontend-ve/27-es2015.f2624779fbf2cb7dd813.js
24K     .tmp/frontend-ve/28-es2015.47591e91edce9108a6d2.js
28K     .tmp/frontend-ve/29-es2015.06ba400c25ac8ecdee2d.js
28K     .tmp/frontend-ve/2-es2015.9fe152b7d311f1004f99.js
12K     .tmp/frontend-ve/30-es2015.63c7b43e47089586348e.js
16K     .tmp/frontend-ve/31-es2015.1763aaf7613bea58fe3f.js
16K     .tmp/frontend-ve/32-es2015.39ca431400ad57b2f3c5.js
16K     .tmp/frontend-ve/33-es2015.c2ae0a81480dc71b4d54.js
56K     .tmp/frontend-ve/34-es2015.d9bc6baa860029a09fd4.js
52K     .tmp/frontend-ve/35-es2015.db589a866c1b0de7941f.js
48K     .tmp/frontend-ve/36-es2015.28117d37693349967fc4.js
44K     .tmp/frontend-ve/37-es2015.64bce3137e34d1aea5a5.js
36K     .tmp/frontend-ve/38-es2015.1aa7edc62f7129642a74.js
12K     .tmp/frontend-ve/39-es2015.db40c0fb19b09b1b4987.js
32K     .tmp/frontend-ve/3-es2015.c27b3e5b22adf3875951.js
244K    .tmp/frontend-ve/40-es2015.231868e7f3a6408fcf0e.js
8.0K    .tmp/frontend-ve/41-es2015.cb621a79c5f23050fa15.js
16K     .tmp/frontend-ve/42-es2015.15e0f6ab22bbfebb9193.js
24K     .tmp/frontend-ve/43-es2015.e4fa9864b0083db8da9f.js
24K     .tmp/frontend-ve/44-es2015.369f328dbc5f27425237.js
56K     .tmp/frontend-ve/45-es2015.9f70696bd83da69f0a4e.js
12K     .tmp/frontend-ve/46-es2015.d5776ab51b0fe3e26e3d.js
12K     .tmp/frontend-ve/47-es2015.dfd8a4a7ae5e37c2cee6.js
12K     .tmp/frontend-ve/48-es2015.172f4ff8f25f95d5e00c.js
12K     .tmp/frontend-ve/49-es2015.150feab69762047b9c55.js
28K     .tmp/frontend-ve/4-es2015.924d3a80380434584f6b.js
12K     .tmp/frontend-ve/50-es2015.1f2c1910ea031d2bc2fa.js
36K     .tmp/frontend-ve/51-es2015.57b6adadecf6a8869c21.js
16K     .tmp/frontend-ve/52-es2015.b8a4f08177353b549fbf.js
12K     .tmp/frontend-ve/53-es2015.0d760a8a3e46b448ebf6.js
52K     .tmp/frontend-ve/54-es2015.9a07263447328a36ea91.js
20K     .tmp/frontend-ve/5-es2015.e7bad09ebf8e7cd0dbcd.js
24K     .tmp/frontend-ve/6-es2015.0f52b4f6965eee9f304d.js
24K     .tmp/frontend-ve/7-es2015.c09718e920fffb41e0e4.js
24K     .tmp/frontend-ve/9-es2015.2f58b030f7d7d0f790ed.js
104K    .tmp/frontend-ve/common-es2015.41220724183fa89ec8e7.js
2.4M    .tmp/frontend-ve/main-es2015.106c70147daa70fbdc57.js
244K    .tmp/frontend-ve/polyfills-es2015.ba7bef98fffd1787a63b.js
4.0K    .tmp/frontend-ve/runtime-es2015.401816b1200374d9c8f6.js
5.4M    total

Similar thing happens: Ivy is a total of 4.6M while VE is 5.4M. Ivy has a bigger main at 2.8M while VE is only 2.4M.

filipesilva avatar Nov 15 '19 13:11 filipesilva