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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.3.x ES5 build broken for spread operator on set #15673

Closed
readme42 opened this issue Sep 25, 2019 · 4 comments · Fixed by #15675
Closed

8.3.x ES5 build broken for spread operator on set #15673

readme42 opened this issue Sep 25, 2019 · 4 comments · Fixed by #15675

Comments

@readme42
Copy link

readme42 commented Sep 25, 2019

🐞 Bug report

Command (mark with an x)

- [x] build

Is this a regression?

No, its broken since the optimized creation of es5 out of es2015 builds were introduced in 8.3. In 8.2.x, when both builds were created on their own, everything was fine.

Description

Since updating angular/cli to 8.3.x it turns our that our ES5 builds are broken - exceptions are thrown during runtime.

What I found out so far:

ES2015 builds are fine.
ES5 builds, created with NG_BUILD_DIFFERENTIAL_FULL=true are fine.
ES5 builds, created without NG_BUILD_DIFFERENTIAL_FULL=true are broken.

It turns out, that the following line creates undefined in es5 builds whereas it creates an array of strings in es2015 builds:


// Make demand ids in day unique
cardDataByDay[ key ] = [ ...new Set(cardDataByDay[ key ]) ];

Happens in any browser in which you load the es5 build.

🔬 Minimal Reproduction / 🔥 Exception or Error

As its quite some effort due to the size to extract it and you maybe already
know what and where to fix it, I will create a test repo when you really need it.
Just drop a comment in this case.

Edit: You can find the repo here: https://github.com/readme42/repro-angular-cli83-es5-15673

🌍 Your Environment

Angular Version:


Angular CLI: 8.3.5
Node: 12.6.0
OS: darwin x64
Angular: 8.2.7
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.2
@angular-devkit/build-angular     0.803.2
@angular-devkit/build-optimizer   0.803.2
@angular-devkit/build-webpack     0.803.2
@angular-devkit/core              8.3.2
@angular-devkit/schematics        8.3.5
@angular/cdk                      8.2.1
@angular/cli                      8.3.5
@angular/material                 8.2.1
@ngtools/webpack                  8.3.2
@schematics/angular               8.3.5
@schematics/update                0.803.5
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.39.2
@alan-agius4
Copy link
Collaborator

@readme42, can you please provide the full code snippet that is needed to generate the error?

Thanks.

@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Sep 25, 2019
@readme42
Copy link
Author

@alan-agius4 sure - will deliver in the next hours.

@readme42
Copy link
Author

readme42 commented Sep 25, 2019

@alan-agius4 Here we go.

You can find the repo here: https://github.com/readme42/repro-angular-cli83-es5-15673

Just clone it and run npm start

The ES2015 build shows:

 {
  "shouldContain1234": [
    1,
    2,
    3,
    4
  ],
  "shouldContain567": [
    5,
    6,
    7
  ]
} 

Ths ES5 build shows:

 {
  "shouldContain1234": [
    {}
  ],
  "shouldContain567": [
    {}
  ]
} 

clydin added a commit to clydin/angular-cli that referenced this issue Sep 25, 2019
…pliance

This ensures that the ES5 bundles operate consistently with the ES2015+ bundles.

Fixes angular#15673
@ngbot ngbot bot added this to the Backlog milestone Sep 25, 2019
clydin added a commit to clydin/angular-cli that referenced this issue Sep 26, 2019
…pliance

This ensures that the ES5 bundles operate consistently with the ES2015+ bundles.

Fixes angular#15673
clydin added a commit to clydin/angular-cli that referenced this issue Sep 26, 2019
…pliance

This ensures that the ES5 bundles operate consistently with the ES2015+ bundles.

Fixes angular#15673
clydin added a commit to clydin/angular-cli that referenced this issue Sep 27, 2019
…pliance

This ensures that the ES5 bundles operate consistently with the ES2015+ bundles.

Fixes angular#15673
vikerman pushed a commit that referenced this issue Sep 30, 2019
…pliance

This ensures that the ES5 bundles operate consistently with the ES2015+ bundles.

Fixes #15673
vikerman pushed a commit that referenced this issue Oct 3, 2019
…pliance

This ensures that the ES5 bundles operate consistently with the ES2015+ bundles.

Fixes #15673
gkalpak added a commit to gkalpak/angular that referenced this issue Oct 4, 2019
The payload size increase in the ES5 bundles is (at least partially)
expected, due to fixing some down-leveling corner cases.

Related CLI issue: angular/angular-cli#15673
gkalpak added a commit to gkalpak/angular that referenced this issue Oct 4, 2019
The payload size increase in the ES5 bundles is (at least partially)
expected, due to fixing some down-leveling corner cases.

Related CLI issue: angular/angular-cli#15673
gkalpak added a commit to gkalpak/angular that referenced this issue Oct 7, 2019
The payload size increase in the ES5 bundles is (at least partially)
expected, due to fixing some down-leveling corner cases.

Related CLI issue: angular/angular-cli#15673
gkalpak added a commit to gkalpak/angular that referenced this issue Oct 9, 2019
The payload size increase in the ES5 bundles is (at least partially)
expected, due to fixing some down-leveling corner cases.

Related CLI issue: angular/angular-cli#15673
mhevery pushed a commit to angular/angular that referenced this issue Oct 10, 2019
The payload size increase in the ES5 bundles is (at least partially)
expected, due to fixing some down-leveling corner cases.

Related CLI issue: angular/angular-cli#15673

PR Close #32980
ODAVING pushed a commit to ODAVING/angular that referenced this issue Oct 18, 2019
The payload size increase in the ES5 bundles is (at least partially)
expected, due to fixing some down-leveling corner cases.

Related CLI issue: angular/angular-cli#15673

PR Close angular#32980
@angular-automatic-lock-bot
Copy link

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 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants