GithubHelp home page GithubHelp logo

bem / bem-core Goto Github PK

View Code? Open in Web Editor NEW
275.0 52.0 94.0 4.37 MB

BEM Core Library

Home Page: https://ru.bem.info/technologies/classic/i-bem/

License: Other

JavaScript 97.33% Shell 0.29% CSS 0.18% HTML 2.21%
bem javascript components frontend framework

bem-core's Introduction

bem-core library Build Status GitHub Release devDependency Status

Documentation on bem-core in a much more informative way is also available at bem.info. It is also available in Russian.

What is this?

bem-core is a base library for web interface development. It provides the minimal stack for coding client-side JavaScript and templating.

Use

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.

Inside

Levels

  • common.blocks — suited for any devices and browsers
  • desktop.blocks — should be used for desktop browsers
  • touch.blocks — implement some touch-platforms specifics

Blocks

  • i-bem — base block with helpers for JS and HTML
  • strings — helpers for JS-strings
  • objects — helpers for JS-objects
  • functions — helpers for JS-functions
  • events — JS-events
  • querystring — helpers for work with querystring
  • tick — global timer
  • idle — IDLE event
  • next-tick — polyfill for nextTick/setTimeout(0, ...)
  • inherit — OOP helpers
  • jquery — jQuery
  • clearfix — CSS clearfix trick
  • identify — identify JS-objects
  • cookie — helpers for work with browser cookies
  • vow — Promises/A+ implementation
  • dom — helpers for work with DOM
  • loader — loader for JS files
  • ua — browser features detection
  • keyboard — keyboard helpers
  • page — html/head/body scaffold

Technologies

  • vanilla.js + browser.js
  • bemhtml
  • bemtree

API

The autogenerated JSDoc API can be found on bem.info. E.g. JSDoc for i-bem is here https://en.bem.info/platform/libs/bem-core/current/desktop/i-bem/#jsdoc

Changelog

You can check the changelog at the Changelog page.

Migration

If you used BEM before, check the migration instructions.

Development

Working copy

  1. Get the needed version code (e.g., v4):

    $ git clone -b v4 git://github.com/bem/bem-core.git
    $ cd bem-core
  2. Install the dependencies:

    $ npm install

    You need export PATH=./node_modules/.bin:$PATH or an alternative way to run locally-installed npm dependencies.

  3. Install all necessary libraries:

    $ npm run deps
  4. Build and run tests (specs):

    $ npm test
  5. Run development server:

    $ npm start

How to contribute

Please refer to How to contribute guide.

Modular testing

A default test bundle for functions__debounce:

$ magic make desktop.specs/functions__debounce

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/functions__debounce/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.

Code coverage

To build code coverage report add ISTANBUL_COVERAGE=yes environment variable to the tests run command:

$ ISTANBUL_COVERAGE=yes magic make desktop.specs && istanbul report html

You can run modular testing with coverage as well by using more concrete build target as was described above.

$ ISTANBUL_COVERAGE=yes magic make desktop.specs/functions__debounce && istanbul report html

After tests finish, you can view coverage HTML report by opening coverage/index.html in your favorite browser.

The whole code coverage statistics can be found on the bem-core profile page on Coveralls.

Tests are built with a enb-bem-specs library. Check the details (available in Russian only).

Supported browsers

Our browser support policy is based on statistics we get from Yandex services.

Browsers with more than 2% users get full compliant support, more than 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 than 0.5% users.

Desktop

Fully compliant

  • Google Chrome 29+
  • Firefox 24+
  • Yandex 1.7+
  • Opera 12.16
  • MSIE 10.0
  • MSIE 9.0
  • MSIE 8.0
  • Opera 12.15

Partially compliant

  • Opera 17.0
  • Opera 16.0
  • Opera 12.14
  • Opera 12.2
  • Firefox 23

Touch

Fully compliant

  • iOS 6+
  • Android 2.3+
  • Opera Mobile 12+
  • Windows Phone 7+

Partially compliant

  • iOS 5
  • Android 2.2

License

Code and documentation copyright 2012 YANDEX LLC. Code released under the Mozilla Public License 2.0.

bem-core's People

Contributors

apsavin avatar arikon avatar aristov avatar belozer avatar corpix avatar dab avatar dfilatov avatar godfreyd avatar hcodes avatar ilyar avatar indutny avatar innabelaya avatar jk708 avatar lesanra avatar maslinych avatar mdidkivskyi avatar mishanga avatar murdalay avatar mursya avatar qfox avatar rasulksirov avatar rusposevkin avatar salivan avatar sipayrt avatar sladex avatar tadatuta avatar tavriaforever avatar veged avatar vsesh avatar yeti-or avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bem-core's Issues

bem-core roadmap

\cc @veged @arikon

Нужно набросать примерный roadmap на проект (отдельным документом), чтобы было понятно, когда планируется отрывать DEPRECATED-методы и на который потом, можно будет ссылаться для обоснования тех или иных решений.

Replacement for `$.browser`

We need replacement for deprecated $.browser. Variants:

  • port $.browser to bem-core as plugin -- The Easiest One
  • add all this stuff to ua block -- The Right One

Check difference between master and v1

It turned out there's difference between code in v1 and in master (before it was removed).

I recovered documentation (#90) but there's at leat some other differencies in .bem folder:

git st
# On branch issues/81@v1
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   .bem/lib/bemhtml.js
#   modified:   .bem/lib/bemhtml/api.js
#   modified:   .bem/techs/bemhtml.js
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   .bem/lib/ometa/
#   .bem/techs/js-i.js
#   .bem/techs/js.js

I don't understand if it's useful or not, please take a look. Also I'm not sure if everything else was synced at the moment you started work on v1.

Блок `Promise` в core

Я думал вносить i-bem.bemtree.xjst из bem-yana-stub в bem-core, но осознал, что результат вызовава BEMTREE.applyAsync() возвращает Vow-промис.

Внимание, вопрос, в bem-core, все это нужно? Или куда это девать?

\cc @veged @arikon @dfilatov

Модуль data-provider

\cc @dfilatov @veged

Хочу портировать i-request (и соответственно, его _type_ajax) в bem-core. Но меня смущает название. request неоднозначно описывает, зачем этот блок (по крайней мере в технологии node.js).

Предлагаю назвать блок data-provider и реализовать там базовый интерфейс. Потом от него наследовать http-provider (для AJAX и HTTP -запросов в browser.js и node.js соответственно).

Потом можно реализовывать file-provider и пр.

Что скажите?

Модульная система для js

Для решения проблем:

  • Избавление от зависимости от jQuery того кода, который от него в реальности не зависит
  • Избавление от глобальных неймспейсов
  • Реальная асинхронность деклараций модулей
  • Возможность писать одни и те же модули для браузеров и серверных движков
  • Возможность додекларации модулей

начинаем использовать модульную систему https://github.com/ymaps/modules.

Deprecation policy

Add deprecation policy document that will describe how features are maintained, deprecated and deleted.

Start of the discussion #35

Bower package description

We should add bower package description as a part of libraries infrastructure to allow installation of bem libs as a bower packages

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.