ngduc / react-setup

A Universal React Setup with i18n: Babel 6, Koa 2, React, React Router, React Transmit, React Bootstrap, React-intl, Mocha, Isparta, Webpack 2, Storybook, InlineCSS/PostCSS, ESLint, HTTPS & HTTP2.
MIT License
175 stars 16 forks source link

Safari: React-Intl warning #17

Open ngduc opened 8 years ago

ngduc commented 8 years ago

Fix this: Safari: React-Intl warning

"Invariant Violation: [React Intl] The Intl APIs must be available in the runtime, and do not appear to be built-in. An Intl polyfill should be loaded. See: http://formatjs.io/guides/runtime-environments/"

ngduc commented 8 years ago

http://formatjs.io/guides/runtime-environments/#polyfill-browsers "The Intl APIs are currently available on all modern browsers except Safari"

"It is recommended that you separate the Intl polyfill from your app's JavaScript code bundle so the polyfill is only loaded in the browsers which need it."

Polyfill can be found here: https://github.com/andyearnshaw/Intl.js

Plan to fix: server can detect if the Client browser is Safari, then include the polyfill as a script tag.