theKashey / use-sidecar

Another way to code splitting
MIT License
104 stars 9 forks source link

Requires global Promise polyfill (breaks ie11) #3

Open jessethomson opened 4 years ago

jessethomson commented 4 years ago

Problem

This library assumes there is a global Promise object available. As such, it breaks in IE11.

Expected

Should just work in IE11

Actual

Breaks with 'Promise' is undefined error.

Solution

Include Promise polyfill (or document the need to provide global Promise polyfill in order to use this library)

Example Code (not sure how many other places this is an issue)

https://github.com/theKashey/use-sidecar/blob/7ef7dba8f4ce1d31fb3b8f8ae0bc0e8702f28659/src/medium.ts#L60

theKashey commented 4 years ago

Any code splitting will end up using Promise. I mean webpack(for example) will use it to load stuff once your chunk will have dependencies.

Screen Shot 2020-03-16 at 6 42 50 pm

You just should always have it. Just Always. No extra documentation is needed when the majority of the world is going to drop IE11 support this quarter.