-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug (header) It doesn't work on IE11; Add polyfill for CustomEvent to support IE11 #186
Comments
I would rather initialize the custom event in a proper way than adding a polyfill just because it's used from one abstract class. let event;
if (typeof window.CustomEvent === 'function') {
event = new CustomEvent('change', detail, bubbles);
} else {
event = document.createEvent('CustomEvent');
event.initCustomEvent('change', bubbles, false, details);
}
this.element.dispatchEvent(event); I would say this might work even in IE9. At least initCustomEvent exists till this version. document.createEvent I'm not sure. There is no real data in caniuse.com nor in mdn. |
If you want to support legacy IE (it's all legacy), you'll have to use |
My dear Morgan. This ES6/7 will be transpiled :D Times for writing var is over :D |
@fragsalat I agree with you |
Just got a feedback from Arindam that few suppliers aren't using our tools because it's not working on IE at all, I think we should ship this polyfill |
With transpiling to ES5 and polyfills for ancient browsers we punish everyone who uses modern browsers. So it's a question of whether we'd like to either:
I don't know how big is the potential win from choosing option no. 2. E.g. how many suppliers are we talking about? How much longer will they use IE11? Sorry for not offering a more specific advice :). |
First of all about which version of ie we're talking here? PS: Can you send me on hangouts the url of the problematic site? |
I agree that we shouldn't punish everyone that use modern browsers with heavy polyfills that they don't need. I am also of the opinion that it would be wasteful to do significant investment into what can only be considered a shrinking user base, we should optimise for the present and the future, not the past. However, browser support doesn't have to be a dichotomy, it can be a scale. We can use https://polyfill.io/ to make the browsers only download the polyfills that they actually need. |
As for transpiling or not, we can support both legacy and modern browsers fairly simply by offering two versions of JavaScript: one for modern browsers, that understand ESM and an ES5.1 version for browsers that don't. <script type="module" src="module.mjs"></script>
<script nomodule src="fallback.js"></script> |
First thing to mention is:
So let‘s rethink effort vs. outcome/benefits here. So this topic might be more important for Alpha and Portal header then here. Besides that, I‘d like to understand more which apps are affect and how many suppliers? Let‘s move this discussion to internal |
Thank you all for your thoughts, just wanted to highlight that Right now ANY application that would use our Fabric Header won't work on IE 11 or less actually, it will be a white page with an error in the console (only works on Edge though) I know we never cared about IE, and it'd require testing to make sure applications are working but having white page is just the worse thing we can do at least we can show a link to download chrome/firefox https://browser-update.org/ I'm mainly concerned to make sure basic functionality is working and not breaking people's application if they decided to use our header, at least the website is visible and not just using Fabric makes it a white page with errors @fokusferit Good that you're not using it in Retail Portal, but as for now Web Re-Order is using Fabric Header and consequently it's a white page with zero usability |
As we started using some tools for external users ex. Suppliers, it usually comes with the price of supporting browsers we don't even use and that's the old monster IE, ex. IE11
Now if you open any of our tools that use Fabric Header it will be a white page, not rendering anything because there's an error in IE11 support of Custom Event so we need a polyfill which is pretty straightforward or as CanIUse say we can initiate the constructor differently
https://caniuse.com/#feat=customevent
The text was updated successfully, but these errors were encountered: