Polymer / shop

The Shop app
https://shop.polymer-project.org/
986 stars 491 forks source link

Extremly slow on ie11 #222

Closed quetzalsly closed 5 years ago

quetzalsly commented 5 years ago

Hi, I am using this code as a base for a small online shop and ideally I would like to support as many browsers as possible.

My package .json contains:

"browserslist": [
    ">= 0.2%",
    "not dead",
    "not ie <= 10",
    "not op_mini all",
    "ie 11",
    "chrome 41"
  ],

The chrome 41 is to be compatable with googlebot without using prpl-server. I have started testing on ie11 and everything is completly unusable because it's so slow.

http://lit-element-dot-polymer-shop.appspot.com is what I test with. polykart.store does not load at all.

It's such a shame because I love the look of this store, it is designed so well and is fast on chrome, I really want to use it but then I would have to drop ie11 which is like 2-5% global usage, that's potential customers lost.

Do you have any idea why it's so slow?

quetzalsly commented 5 years ago

I just have to update this issue because I found out about something: https://shop.polymer-project.org actually runs perfectly on ie11 from what I can see. I assume that is polymer 2.0? so what ended up being slow must be lit-element? Would be really good to sort this issue out. (Also the images are messed up on lit-element version in ie11).

frankiefu commented 5 years ago

Thanks for the report.

This is due to a bug in localStorage on IE11. Basically storage event fires only when localStorage is modified in another window. Shop relies on that behavior in cart.js. But in IE11 the event fires even when the modification is in the same window. This causes an infinite loop in shop.

We will have a patch up soon.

quetzalsly commented 5 years ago

I just manually applied the fix and it works great now thanks so much! Please close this whenever you want.