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 Object.fromEntries polyfill to support iOS Safari 11 #316

Merged
merged 1 commit into from Aug 19, 2020
Merged

Conversation

MrOrz
Copy link
Member

@MrOrz MrOrz commented Aug 15, 2020

According to #313 we should support Safari >= 10.3; however, currently our usage of Object.fromEntries breaks iOS safari.

This PR:

  • Removes unused babel preset (they are already included in Next.js 9.3)
  • Adds core-js/features/object/from-entries to _app.js
    • putting polyfill in _app is the suggested way of adding custom polyfills in official doc
    • nomodule trick can't be used because iOS 11 supports nomodule (don't load nomodule scripts) but still does not support Object.fromEntries and needs to be polyfilled.

Fixes #313 .

iOS 10, iPhone 7

image

iOS 11, iPhone 6

image

@MrOrz MrOrz self-assigned this Aug 15, 2020
@MrOrz MrOrz merged commit 7d0edb9 into dev Aug 19, 2020
@MrOrz MrOrz deleted the ios-safari branch September 12, 2020 04:21
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.

iOS compatibility issue
2 participants