Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Polyfills can be used for pre-JS5 browsers. But can you polyfill "let" and "class" syntax keyword?

No, but you can compile ES6 code using it to ES5 code.




Is the only solution to transpile ES6 to ES5 until 2025 or whenever IE11, Safari 7 and all current Smart TVs and Cars and what not have their end-of-life and simply vanish? Let's remember the problems with Internet Explorer 6 and its long actual lifetime. At the moment IE8 (WinXP), IE11 (Win8) as well as various other browsers will never receive an update on their platforms.


I'm pretty sure that at some point someone will create a library to test for ES6 compatibility when the JS code loads, I envision something like:

    if ES6 {
        use "mycode_js6.js";
    }
    else {
        use "mycode_js6_to_js5.js";
    }
or something similar.


> Is the only solution to transpile ES6 to ES5 until 2025 or whenever IE11, Safari 7 and all current Smart TVs and Cars and what not have their end-of-life and simply vanish?

Well, it depends who your target audience is. If users with old browsers don't matter, you don't need to transpile.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: