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

Add polyfill for older browsers to stop frontend erroring on use of flatMap #1824

Merged
merged 2 commits into from Aug 20, 2021

Conversation

darrenvong
Copy link
Member

I was seeing a few c.data.pages.flatMap is not a function errors on Sentry and noticed that they are all from users from using older versions of Safari... this polyfill should hopefully fix it. It only gets applied to browsers who don't support the function already using the browserslist config

Closes #1823

Frontend checklist

  • Formatted my code with yarn format && yarn lint --fix
  • There are no warnings from yarn lint
  • There are no console warnings when running the app
  • Added any new components to storybook
  • Added tests where relevant
  • All tests pass
  • Clicked around my changes running locally and it works
  • Checked Desktop, Mobile and Tablet screen sizes

@darrenvong darrenvong added web release notes: pending Add to stuff that should be included in release notes labels Aug 15, 2021
@darrenvong darrenvong requested a review from a team August 15, 2021 23:28
@darrenvong darrenvong changed the title Add polyfill for older browsers to stop app crashing on use of flatMap Add polyfill for older browsers to stop frontend erroring on use of flatMap Aug 15, 2021
@lucaslcode
Copy link
Member

I don't think this solves the issue without a modification to our package.json. npx browserslist ">0.2%, not dead, not op_mini all" gives safari 13.1 as the earliest version.

@darrenvong
Copy link
Member Author

Good point. Changing it to >0.1% seems to cover ios_saf 9.3 which I think is different from Safari on MacOS, and considering the Sentry error came from ios Safari 10, I think that should do the trick. Maybe any browsers that are used by less than 0.1% of people is not worth supporting after? 🤷

@darrenvong darrenvong merged commit 7c7cbd5 into develop Aug 20, 2021
@darrenvong darrenvong deleted the frontend/bugfix/polyfill-for-older-browsers branch August 20, 2021 17:26
@aapeliv aapeliv added release notes: done Was mentioned in release notes and removed release notes: pending Add to stuff that should be included in release notes labels Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: done Was mentioned in release notes web
Projects
None yet
3 participants