This README is also available in Russian.
bem-core
is a base library for web interface development.
It provides the minimal stack for coding client-side JavaScript and templating.
The easiest way to run a project with bem-core
is to use
the project-stub.
You can use any other way you are familiar with to include the library into the project.
common.blocks
— suited for any devices and browsersdesktop.blocks
— should be used for desktop browserstouch.blocks
— implement some touch-platforms specifics
i-bem
— base block with helpers for JS and HTMLecma
— some ES5 polyfilsstrings
— helpers for JS-stringsobjects
— helpers for JS-objectsfunctions
— helpers for JS-functionsevents
— JS-eventsquerystring
— helpers for work with querystringtick
— global timeridle
— IDLE eventnext-tick
— polyfill fornextTick
/setTimeout(0, ...)
inherit
— OOP helpersjquery
— jQueryclearfix
— CSS clearfix trickidentify
— identify JS-objectscookie
— helpers for work with browser cookiesvow
— Promises/A+ implementationdom
— helpers for work with DOMloader
— loader for JS filesua
— browser features detectionpage
— html/head/body scaffold
- vanilla.js + browser.js
- bemhtml
- bemtree
You can check the changelog at the changelog page.
If you used BEM before, check the migration instructions.
- Get the needed version code (e.g.,
v1
):
$ git clone -b v1 git://github.com/bem/bem-core.git
$ cd bem-core
- Install the dependencies:
$ npm install
You need export PATH=./node_modules/.bin:$PATH
or an alternative way to run locally-installed bem-tools.
- Install all the necessary libraries:
$ bem make libs
- Build examples and tests:
$ bem make sets
- Run development server:
$ bem server
- Create an issue with a proper description.
- Decide which version needs your changes.
- Create a feature-branch with an issue number and a version (
issues/<issue number>@v<version number>
) based on a version branch. For example, for an issue #42 and a version #1:git checkout -b issues/42@v1 v1
. If you need changes for several versions, each of them has to have a feature branch. - Commit changes and
push
. Rebase your branch on a corresponding version branch if it's needed. - Create a pull-request from your feature branch; or several pull-requests if you changed several versions.
- Link your pull request with an issue number any way you like. A comment will work perfectly.
- Wait for your pull request and the issue to be closed ;-)
A default test bundle for ecma_array
:
$ bem make desktop.specs/ecma__array
You can see the results of the tests in the terminal after the building process
finishes.
You can also watch them in a browser loading desktop.specs/ecma__array/spec-js+browser-js+bemhtml/spec-js+browser-js+bemhtml.html
.
Run tests for other BEM entities in the same way. This will work for those which
are equipped with .spec.js
file.
Test are built with a bem-pr library. Check the details about testing infrastructure of the bem-pr.
Our browser support policy is based on statistics we get from Yandex services.
Browsers with more then 2% users get full compliant support, more then 0.5% — partially compliant (which means that data is accessible but not necessary 100% functional). New features testing is not provided by us for browsers with less then 0.5% users.
- Google Chrome 29+
- Firefox 24+
- Yandex 1.7+
- Opera 12.16
- MSIE 10.0
- MSIE 9.0
- MSIE 8.0
- Opera 12.15
- Opera 17.0
- Opera 16.0
- Opera 12.14
- Opera 12.2
- Firefox 23
- iOS 6+
- Android 2.3+
- Opera Mobile 12+
- Windows Phone 7+
- iOS 5
- Android 2.2