3 ms·
I've been doing two targets on my most recent projects... one for ES2017+ (async support in browser), and another for legacy (IE>=9). Which wasn't too bad for
by tracker1 8y ago
I've been doing two targets on my most recent projects... one for ES2017+ (async support in browser), and another for legacy (IE>=9). Which wasn't too bad for some things... for one of the projects, got to be too much, and I now just do a test for async, and if it fails redirect to "/legacy.html"
- syspec 8y agoWhat browsers support generators, but do not support await? The polyfill for async, converts those calls to generator functions - however i'm not aware of any browsers which support generator functions, but DO NOT support async/await
- tracker1 8y agoEvery browser that supports generators is self/auto updating to a version that supports async. (Except maybe Safari)... in any case, that's where I decided to draw the line. If it supports async, it stays on modern.html, otherwise it redirects to legacy.html. There's also the ability to do some server detection for what payload to deliver. It's just async support is the only feature I test for. client test; try { eval('(function() { async _ => _; })();'); } catch (e) { window.location.replace('/legacy.html'); } server test: import * as capabilities from 'browser-capabilities'; export default userAgent => capabilities .browserCapabilities(userAgent) .has('es2017');