ueno-llc / starter-kit-universally

Ueno.'s react starter kit
https://ueno-llc.github.io/starter-kit-universally/
MIT License
183 stars 15 forks source link

Ie compatibility mode support #87

Closed uooq closed 6 years ago

uooq commented 6 years ago

When IE is in compatibility mode it uses an IE7 user-agent identifier in get requests, even if it's using IE11 features. This was causing our call to polyfill.io to fail because IE7 support wasn't required or sufficient, but was being requested.

This PR changes the polyfill.io call by waiting until runtime and checking if the browser is IE before constructing the polyfill IO URL. In the case of IE, it uses the IE specific documentMode to construct the URL.

You can see the issues by using IE11 and choosing Tools | Compatibility Mode Settings and browsing to https://starter-kit-universally.herokuapp.com/ BROKEN https://starter-kit-universally-pr-87.herokuapp.com/ FIXED

birkir commented 6 years ago

We should put this to the upstream and get some community feedback. Maybe this can be fixed at polyfill.io.

Relevant https://github.com/ctrlplusb/react-universally/issues/423