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

rollback browserlist to Safari v14 #904

Merged
merged 1 commit into from
May 4, 2023
Merged

Conversation

bkorobeinikov
Copy link
Contributor

@bkorobeinikov bkorobeinikov commented May 4, 2023

Safari 15 cannot handle this syntax when code is minified

import once from 'lodash/once';

class Hello {
  world = once(() => {
    return "hello world";
  });
}

the file that fails to be executed in Safari v15 is src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.js

the bug was made in the #881

@wegry
Copy link
Contributor

wegry commented May 4, 2023

Did you try against #901?

@wegry
Copy link
Contributor

wegry commented May 4, 2023

The issue this is alleviating looks like it's possibly around terser generating incorrect code around class fields with closures assigned to them for Safari 15. It could also just be a Safari 15 bug as well.

import {once} from 'lodash';

class Foo {
  classFieldMethod = once(() => console.log())  
}

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields

The strange thing from @bkorobeinikov offline is that the ReferenceError caused by the standards compliant version doesn't seem to be reproducible when the Safari console is open.

Copy link
Contributor

@wegry wegry left a comment

Choose a reason for hiding this comment

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

Rolling back'll give us some breathing room for a fix.

We do have CSS that depends on Safari 15 in newer code, so in practice, this change doesn't mean that we actually support Safari 14 again.

@bkorobeinikov bkorobeinikov merged commit 27cc6b2 into main May 4, 2023
@bkorobeinikov bkorobeinikov deleted the fix-safari-15-support branch May 4, 2023 18:15
@wegry wegry mentioned this pull request May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants