bem / bem-core

BEM Core Library
https://ru.bem.info/technologies/classic/i-bem/
Other
276 stars 95 forks source link

Move `ecma` to separate repo and attach ES5-shims for IE < 9 only #230

Closed dfilatov closed 10 years ago

dfilatov commented 11 years ago

cc @veged Add external conditional commented link to es5 polyfills. Deploy ES5 polyfils to Yandex CDN (http://api.yandex.ru/jslibs/).

If you are planning to support IE8, you need to attach es5-shims by yourself. There is example of bemjson:

[
    '<!--[if lt IE 9]>',
    { elem : 'js', url : '//yandex.st/es5-shims/0.0.1/es5-shims.min.js' },
    '<![endif]-->'
]

If you are planning to use Function.prototype.bind and support Android 2.x, you need to attach es5-shims by yourself or use jQuery.proxy. There is example of bemjson:

{
    elem : 'js',
    content : 'navigator.userAgent.match(/Android\s2\./) && document.write(\'<script src="//yandex.st/es5-shims/0.0.1/es5-shims.min.js"></script>\')'
},
dfilatov commented 10 years ago

Repo for shim: https://github.com/bem/es5-shims

dfilatov commented 10 years ago

We need to add some notes about support IE8: If you are planning to use ie8, you need to attach es5-shims by yourself. There is example of bemjson:

[
    '<!--[if lt IE 9]>',
    { elem : 'js', url : '//yandex.st/es5-shims/0.0.1/es5-shims.min.js' },
    '<![endif]-->'
]
narqo commented 10 years ago

Another way for plug es5-shims is to use it as BEM-library thought bower and manually link i-bem \w ecma__* on the project's level