V-calendar: Doesn't work in IE11 - The package should be ES5

Created on 30 Nov 2017  路  10Comments  路  Source: nathanreyes/v-calendar

It appears this package is ES6 code which isn't compatible IE 11 and other older browsers.
Can you distribute a compiled ES5 version instead of ES6?

Most helpful comment

Array.prototype.find is not transpiled so it has to be polyfilled for older browsers (IE11). Rather than polyfill it and punish modern browsers I think I will just provide documentation for developers on how to polyfill it so that they can choose which platforms to support.

All 10 comments

I don't really have a way to test IE11 at the moment as I don't have access to a Windows PC, but the project uses Babel to transpile ES6 into ES5 so I don't understand why that would be the cause. Does the website not load at all?

The website doesn't load in IE11 because of a syntax error. As you can see, there is ES6 syntax in the console. To use this package (which I really love by the way 馃挴), I must recompile it with babel.

capture

However, even with a forced babel compilation, the events don't show up on the calendar (it does in all other browsers). Maybe a CSS error since IE11 doesn't support the full flexbox standart.

To bump @francoislevesque answer, i just test my working app in Firefox under IE11

@See screen

image

Edit: The code is transpiled btw

Just add the Array.prototype.find polyfill and it will work in IE11.
You can include this script before loading v-calendar:
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Array.prototype.find" />

@mariusj Babel didn't transpile it ?

Array.prototype.find is not transpiled so it has to be polyfilled for older browsers (IE11). Rather than polyfill it and punish modern browsers I think I will just provide documentation for developers on how to polyfill it so that they can choose which platforms to support.

@nathanreyes Why not implemented it, if browser doesn't support it ?

I could choose to support it, but it would require unnecessary code for all browsers, including modern ones that can support Array.prototype.find natively.

It is more of a matter of whose decision should it be to punish newer browsers. I could include it (and any polyfills needed in the future) and make the decision for everyone, or allow the developer to make that decision to support older browsers. It is a simple script import.

I don't know, I asked this question in the Vue forums and got some feedback that it would be best left to the developer. Also, I would like to keep the package as minimal as possible.

I am open to other opinions though.

Letting the developper make the decision concerning the polyfills is indeed the way to go. The package is correctly distributed in ES5 in lib. I was getting an error in webpack because I was directly importing v-calendar/src/utils/helpers in one of my files.

Thus, I personally consider this issue closed.

I agree. Like I said before I think I will just make sure to carefully document the required polyfill(s) and procedures for requiring them.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sokolovdm picture sokolovdm  路  3Comments

thfontaine picture thfontaine  路  3Comments

maksnester picture maksnester  路  3Comments

redraw picture redraw  路  3Comments

garygreen picture garygreen  路  3Comments