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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable-ivy flag produces larger bundle #13922

Open
mohammedzamakhan opened this Issue Mar 14, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@mohammedzamakhan
Copy link

mohammedzamakhan commented Mar 14, 2019

馃悶 Bug report

Command (mark with an x)

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

Is this a regression?

No Idea

Description

I created two new projects, one with enable-ivy and one without, and without adding any change, the ivy project was larger by 60kB compared to non ivy project.

馃敩 Minimal Reproduction

Following is how I created and the build results

With Ivy (305 kB)

> npx -p @angular/cli@8.0.0-beta.5 ng new ivy-project --enable-ivy
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? CSS

> ng build --prod

Date: 2019-03-14T19:09:59.899Z
Hash: fa04754e6fe3253b3565
Time: 23401ms
chunk {0} runtime.26209474bfa8dc87a77c.js (runtime) 1.41 kB [entry] [rendered]
chunk {1} main.5c2b5594965c4d4fca3d.js (main) 306 kB [initial] [rendered]
chunk {2} polyfills.abcb3479eb0ca86ae8d5.js (polyfills) 41 kB [initial] [rendered]
chunk {3} polyfills.es5.99545074c68fda00494c.js (polyfills.es5) 61.9 kB [initial] [rendered]
chunk {4} styles.3ff695c00d717f2d2a11.css (styles) 0 bytes [initial] [rendered]

Without Ivy (240 kB)

> npx -p @angular/cli@8.0.0-beta.5 ng new non-ivy-project
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? CSS

> ng build --prod

Date: 2019-03-14T19:15:16.351Z
Hash: 7ac74b00f6031d2ed8bb
Time: 23603ms
chunk {0} runtime.26209474bfa8dc87a77c.js (runtime) 1.41 kB [entry] [rendered]
chunk {1} main.54a35eb644a6e8e95684.js (main) 240 kB [initial] [rendered]
chunk {2} polyfills.abcb3479eb0ca86ae8d5.js (polyfills) 41 kB [initial] [rendered]
chunk {3} polyfills.es5.99545074c68fda00494c.js (polyfills.es5) 61.9 kB [initial] [rendered]
chunk {4} styles.3ff695c00d717f2d2a11.css (styles) 0 bytes [initial] [rendered]

馃敟 Exception or Error





馃實 Your Environment



Angular CLI: 8.0.0-beta.5
Node: 11.6.0
OS: darwin x64
Angular: 8.0.0-beta.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.14.0-beta.5
@angular-devkit/build-angular     0.14.0-beta.5
@angular-devkit/build-optimizer   0.14.0-beta.5
@angular-devkit/build-webpack     0.14.0-beta.5
@angular-devkit/core              8.0.0-beta.5
@angular-devkit/schematics        8.0.0-beta.5
@angular/cli                      8.0.0-beta.5
@ngtools/webpack                  8.0.0-beta.5
@schematics/angular               8.0.0-beta.5
@schematics/update                0.14.0-beta.5
rxjs                              6.4.0
typescript                        3.2.4
webpack                           4.29.6


Anything else relevant?

@alan-agius4

This comment has been minimized.

Copy link
Collaborator

alan-agius4 commented Mar 15, 2019

The size savings from Ivy are in the generated JS files for your templates. Given some size of HTML templates, the prior compiler created much larger JS output size compared with Ivy.

If you don't have some critical mass of HTML templates, you won't see that size improvement.

Note that there is also a known issue with the framework code itself currently being larger under Ivy than before. We plan to fix this before 8.0 final ships.

See: angular/angular#28077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.