Update code to ensure IE11 compatibility #406
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug:
Fixes #403
As mentioned in the issue, this library breaks in IE11 due to missing polyfills. You could just document the polyfill requirements for this library, but since IE 11 is still over 2% of browser usage and this is a library, it'd be a good idea to remove code that's incompatible with IE11.
Unfortunately, some babel plugins also add code that's incompatible by default. The main culprit here is the use of the spread operator to clone a NodeList to an array. Babel uses a helper for the spread operator, and that helper uses
Array.from
. Therefore, using the spread operator to clone an array isn't something that can be done here any more.Notes:
Babel documentation on the plugins I'm using and dependencies I added.
Changes:
object-assign
ponyfill and use it instead ofObject.assign
[...dayNodes].indexOf(...)
code with something equivalent, but more IE friendly.cc: @gpbl