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

Optional Chaining used in latest 7.2.0 release #1191

Closed
zakisaad opened this issue Oct 13, 2021 · 1 comment · Fixed by #1183
Closed

Optional Chaining used in latest 7.2.0 release #1191

zakisaad opened this issue Oct 13, 2021 · 1 comment · Fixed by #1183
Assignees
Labels
Bug report Indicates that issue has been marked as a possible bug

Comments

@zakisaad
Copy link

Describe the bug

Optional chaining (?. operator) has been used in client-side Javascript. Support on modern browsers is OK (https://caniuse.com/mdn-javascript_operators_optional_chaining), however not ideal to have customer-facing code using this without transpiling taking place first. Affected file:

https://github.com/Adyen/adyen-magento2/blob/19ed495c365312ea363915763020a6a1259fb98e/view/frontend/web/js/view/checkout/summary/agreements-assigner-mixin.js

This has actually broken our JS bundler setup, causing our site to clog up due to massive request load. The requirejs optimiser does not yet support optional chaining on the mainline release:

https://github.com/requirejs/r.js

requirejs/r.js#1003

We've had to patch out the use of optional chaining to get the bundler to work on our M2 codebase.

To Reproduce
Attempt to optimise JS/use JS on older browser

Expected behavior
Backwards-compatible JS does not cause problems

Magento version
2.3.7-p1

Plugin version
7.2.0

@zakisaad zakisaad added the Bug report Indicates that issue has been marked as a possible bug label Oct 13, 2021
@acampos1916 acampos1916 linked a pull request Oct 14, 2021 that will close this issue
@acampos1916 acampos1916 self-assigned this Oct 14, 2021
@acampos1916
Copy link
Member

Thanks @zakisaad, this has already been replaced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug report Indicates that issue has been marked as a possible bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants