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

fix(forms): change Array.reduce usage to Array.forEach #35349

Closed
wants to merge 1 commit into from

Conversation

kara
Copy link
Contributor

@kara kara commented Feb 11, 2020

There is currently a bug in Chrome 80 that makes Array.reduce
not work according to spec. The functionality in forms that
retrieves controls from FormGroups and FormArrays (form.get)
relied on Array.reduce, so the Chrome bug broke forms for
many users.

This commit refactors our forms code to rely on Array.forEach
instead of Array.reduce to fix forms while we are waiting
for the Chrome fix to go live.

See https://bugs.chromium.org/p/chromium/issues/detail?id=1049982.

@kara kara added area: forms target: patch This PR is targeted for the next patch release labels Feb 11, 2020
@ngbot ngbot bot added this to the needsTriage milestone Feb 11, 2020
@kara kara added the action: review The PR is still awaiting reviews from at least one requested reviewer label Feb 11, 2020
@kara kara requested a review from IgorMinar February 11, 2020 23:20
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thanks for the fix!

There is currently a bug in Chrome 80 that makes Array.reduce
not work according to spec. The functionality in forms that
retrieves controls from FormGroups and FormArrays (`form.get`)
relied on Array.reduce, so the Chrome bug broke forms for
many users.

This commit refactors our forms code to rely on Array.forEach
instead of Array.reduce to fix forms while we are waiting
for the Chrome fix to go live.

See https://bugs.chromium.org/p/chromium/issues/detail?id=1049982.
@kara kara removed the request for review from IgorMinar February 12, 2020 00:12
@kara kara added action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 12, 2020
@kara
Copy link
Contributor Author

kara commented Feb 12, 2020

presubmit

@kara kara added the action: merge The PR is ready for merge by the caretaker label Feb 12, 2020
@kara kara closed this in eef047b Feb 12, 2020
kara added a commit that referenced this pull request Feb 12, 2020
There is currently a bug in Chrome 80 that makes Array.reduce
not work according to spec. The functionality in forms that
retrieves controls from FormGroups and FormArrays (`form.get`)
relied on Array.reduce, so the Chrome bug broke forms for
many users.

This commit refactors our forms code to rely on Array.forEach
instead of Array.reduce to fix forms while we are waiting
for the Chrome fix to go live.

See https://bugs.chromium.org/p/chromium/issues/detail?id=1049982.

PR Close #35349
@samvloeberghs
Copy link
Contributor

samvloeberghs commented Feb 12, 2020

is this retrofitted somehow in for example ng v6/7-v8 (if necessary?)? @kara

sonukapoor pushed a commit to sonukapoor/angular that referenced this pull request Feb 13, 2020
There is currently a bug in Chrome 80 that makes Array.reduce
not work according to spec. The functionality in forms that
retrieves controls from FormGroups and FormArrays (`form.get`)
relied on Array.reduce, so the Chrome bug broke forms for
many users.

This commit refactors our forms code to rely on Array.forEach
instead of Array.reduce to fix forms while we are waiting
for the Chrome fix to go live.

See https://bugs.chromium.org/p/chromium/issues/detail?id=1049982.

PR Close angular#35349
@maartentibau
Copy link
Contributor

is this retrofitted somehow in for example ng v6/7-v8 (if necessary?)? @kara

Same here

@mstislavm
Copy link

mstislavm commented Feb 13, 2020

will there be a fix for Angular 7?

@kara
Copy link
Contributor Author

kara commented Feb 13, 2020

This PR fixes the problem for version 9. For earlier versions, it's possible to fix the problem by patching in a polyfill - see #35219 (comment).

sonukapoor pushed a commit to sonukapoor/angular that referenced this pull request Feb 17, 2020
There is currently a bug in Chrome 80 that makes Array.reduce
not work according to spec. The functionality in forms that
retrieves controls from FormGroups and FormArrays (`form.get`)
relied on Array.reduce, so the Chrome bug broke forms for
many users.

This commit refactors our forms code to rely on Array.forEach
instead of Array.reduce to fix forms while we are waiting
for the Chrome fix to go live.

See https://bugs.chromium.org/p/chromium/issues/detail?id=1049982.

PR Close angular#35349
@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 Mar 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker action: presubmit The PR is in need of a google3 presubmit area: forms cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants