tannerntannern / ts-mixer

A small TypeScript library that provides tolerable Mixin functionality.
MIT License
384 stars 27 forks source link

Doesnt work in IE11 #41

Closed AlexanderKositsyn closed 3 years ago

AlexanderKositsyn commented 3 years ago

Ts-mixer doesnt work in IE11. IE11 doesnt support ES6 syntax. Any workaround or fix?

tannerntannern commented 3 years ago

Can you provide more details about how to reproduce? This doesn't give me much to go on. At one point ts-mixer was definitely ES5 compatible, but it might require polyfills and/or specific TS compilation settings.

smff commented 3 years ago

So, i have the same problem too. I use "ts-mixer": "^6.0.0". If you look at dist of ts-mixer in node_modules, you will see ES6:

Снимок экрана 2021-08-03 в 19 40 00

This ES6 goes to IE11 on build.

We have a workaround in webpack configuration:

Снимок экрана 2021-08-03 в 19 41 48

But I'm not sure that is a right way to solve the problem, looks like you forgot to add ES5 dist to build or we use your library in the wrong way

tannerntannern commented 3 years ago

I think the solution will involve transpilation settings of some kind, such the webpack/babel config you listed above, or tsconfig.json settings like "target": "es5". It's highly dependent on your specific project. Sorry I can't give more specific advice.

For what it's worth, I can't personally guarantee ES5 compatibility since all my tests run compiling to ES6. But in the README, I detail specific features that require ES6, so theoretically everything could work with the right transpilation settings, but as I mentioned, it's very specific to your project.

hakimio commented 3 years ago

It seems es6 is the target since at least ts-mixer version 5. Anyway, I agree with @tannerntannern: if you need IE11 support (even its popularity dropped to all time low of around 1% of worldwide desktop browser market share), you should transpile it to ES5 yourself.