Skip to content

Use babel polyfills and support more browsers

Nick Sellen requested to merge add-babel-polyfills into master

What does this MR do?

We didn't have polyfills enabled before, so older browsers would fail if we used fancier built-in things.

For example Object.assign() is missing in ie mobile 11 and caused an error, see https://sentry.io/foodsaving-worldwide/foodsharingde-beta-frontend/issues/511109506/.

Instead of importing babel-polyfill, we can use the new useBuiltins: usage option in babel 7 (see https://github.com/babel/babel/tree/master/packages/babel-preset-env#usebuiltins-usage) to add just the ones we need.

To specify the browsers to include we have a browserslist config in package.json now. You can try out the queries to see which browsers it'll match using http://browserl.ist/.

How confident are you it won't break things if deployed?

Should improve things that are currently broken.

Links to related issues

https://sentry.io/foodsaving-worldwide/foodsharingde-beta-frontend/issues/511109506/

Checklist

  • added a test, or explain why one is not needed/possible... we don't have testing setup to run different browsers...
  • no unrelated changes
  • asked someone for a code review
  • joined #foodsharing-beta channel at https://slackin.yunity.org
  • added an entry to CHANGELOG.md (description, merge request link, username(s))
Edited by Nick Sellen

Merge request reports