fanout/reconnecting-eventsource

Does the library include EventSource polyfill?

Closed this issue · 1 comments

Sorry, this is not really an issue, rather a question.
As you most probably know, EventSource is not supported by Internet Explorer and Edge. So usually you put an according polyfill to make it work with those browsers.
Does this library have a polyfill inside? Or do I still need to add a polyfill manually in my code?

We do not include such polyfills in our packages.

Our thought as a library author is to not include polyfills in a library. This is because we believe the functionality that a polyfill provides is in the purview of the browser or platform. If you need certain system requirements to run a program you should provide it... and if providing a polyfill can fulfill that requirement then you should do that as a user.

This also keeps the package at its smallest size. Different package consumers need to support different requirements. Some projects would use a package solely on the server for example, and there is no sense in packaging in browser polyfills.

Hope that helps.