Skip to content

Commit 4acaec5

Browse files
vegedclaude
andcommitted
docs: update READMEs for v5, add Russian changelog/migration
- Replace Travis CI / david-dm badges with GitHub Actions badge - Update development instructions (Vite, Playwright, node:test) - Remove vow from block list, update browser support - Add 5.0.0 sections to CHANGELOG.ru.md and MIGRATION.ru.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9962bcd commit 4acaec5

File tree

4 files changed

+214
-206
lines changed

4 files changed

+214
-206
lines changed

CHANGELOG.ru.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
11
# История изменений
22

3+
## 5.0.0
4+
5+
### Несовместимые изменения
6+
7+
- **Только ESM**: Вся кодовая база мигрирована с модульной системы `ym` (`modules.define`/`modules.require`) на нативные ES-модули (`import`/`export`). Зависимость `ym` удалена.
8+
- **Сборка через Vite**: ENB и все 17+ связанных пакетов заменены на [Vite](https://vite.dev/). Кастомный плагин `vite-plugin-bem-levels` обеспечивает сканирование BEM-уровней, разрешение виртуальных модулей `bem:*` и генерацию barrel-файлов для цепочек переопределений.
9+
- **jQuery 4.0**: Peer-зависимость `jquery` обновлена с `^3.x` до `^4.0.0`. Основное изменение API: `$.unique()` удалён — используйте `$.uniqueSort()`.
10+
- **Node.js 20+**: Минимальная поддерживаемая версия Node.js — 20 (было 8).
11+
- **Нативные промисы**: `vow` удалён. Весь код использует нативный `Promise`.
12+
- **Нативный тест-раннер**: Серверные тесты используют `node:test` и `node:assert` вместо `mocha`/`chai`.
13+
- **Playwright**: Браузерные тесты используют [Playwright](https://playwright.dev/) вместо `mocha-phantomjs` (PhantomJS мёртв).
14+
- **ESLint 10**: Линтинг мигрирован с `jshint`/`jscs` на ESLint 10 с flat-конфигурацией (`eslint.config.js`).
15+
- **GitHub Actions CI**: Travis CI заменён на GitHub Actions.
16+
- **Husky + lint-staged**: `git-hooks` заменён на `husky` и `lint-staged`.
17+
18+
### Крупные изменения
19+
20+
- Все `.vanilla.js` и `.js` файлы конвертированы в ES-модули с синтаксисом `import`/`export`.
21+
- Цепочки переопределений модулей (напр., `jquery` с расширениями pointer-событий) обрабатываются автоматически сгенерированными barrel-файлами через `vite-plugin-bem-levels`.
22+
- Блок `i18n` сохраняет свой API, но использует нативные ES-модули внутри.
23+
- Браузерные спек-тесты (28 файлов, 500+ тестов) запускаются через Vite dev server + Playwright.
24+
- Vite генерирует платформенно-специфичные сборки (`desktop`, `touch`) с jQuery как внешней зависимостью.
25+
26+
### Удалённые пакеты
27+
28+
- **Сборка**: `enb`, `enb-bem-techs`, `enb-magic-factory`, `enb-magic-platform`, `enb-bemxjst`, `enb-bemxjst-6x`, `enb-bemxjst-7x`, `enb-bemxjst-i18n`, `enb-bh`, `enb-bh-i18n`, `enb-borschik`, `enb-css`, `enb-js`, `enb-bem-docs`, `enb-bem-examples`, `enb-bem-specs`, `enb-bem-tmpl-specs`, `enb-bem-i18n`, `borschik`
29+
- **Линтинг**: `jscs`, `jscs-bem`, `jshint`, `jshint-groups`
30+
- **Тестирование**: `mocha-phantomjs`, `istanbul`, `chai-as-promised`
31+
- **Прочие**: `ym`, `vow`, `bower`, `git-hooks`, `gitbook-api`, `bem-naming`, `bem-walk`
32+
33+
### Удалённые конфигурационные файлы
34+
35+
- `.enb/` (конфигурация сборки ENB)
36+
- `.jshintrc`, `.jscs.json`, `.jshint-groups.js` (конфигурация линтинга)
37+
- `.bowerrc`, `bower.json` (конфигурация Bower)
38+
- `.travis.yml` (конфигурация Travis CI)
39+
- `.githooks/` (конфигурация git-hooks)
40+
341
## 4.3.1
442

543
### В релиз вошли следующие исправления ошибок

MIGRATION.ru.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,121 @@
11
# Миграция
22

3+
## 5.0.0
4+
5+
### ym → ES-модули
6+
7+
Модульная система `ym` (`modules.define`/`modules.require`) заменена на нативные ES-модули.
8+
9+
Было:
10+
11+
```js
12+
modules.define('my-block', ['i-bem-dom', 'events'], function(provide, bemDom, events) {
13+
14+
provide(bemDom.declBlock(this.name, { /* ... */ }));
15+
16+
});
17+
```
18+
19+
Стало:
20+
21+
```js
22+
import bemDom from 'bem:i-bem-dom';
23+
import events from 'bem:events';
24+
25+
export default bemDom.declBlock('my-block', { /* ... */ });
26+
```
27+
28+
Все `bem:*` импорты разрешаются на этапе сборки плагином `vite-plugin-bem-levels` в реальные пути файлов с учётом приоритетов уровней для конкретной платформы.
29+
30+
### Переопределения модулей
31+
32+
Переопределения модулей, которые ранее использовали `modules.define` с колбэком, получающим предыдущее значение модуля, теперь обрабатываются через barrel-файлы, генерируемые Vite-плагином.
33+
34+
Было (переопределение ym):
35+
36+
```js
37+
modules.define('jquery', function(provide, $) {
38+
$.event.special.pointerclick = { /* ... */ };
39+
provide($);
40+
});
41+
```
42+
43+
Стало (side-effect импорт в barrel-файле):
44+
45+
```js
46+
// Barrel-файл автоматически сгенерирован vite-plugin-bem-levels:
47+
import $ from '../../common.blocks/jquery/jquery.js';
48+
import '../../common.blocks/jquery/__event/_type/jquery__event_type_pointerclick.js';
49+
export default $;
50+
```
51+
52+
### jQuery 3 → 4
53+
54+
Peer-зависимость `jquery` теперь `^4.0.0`.
55+
56+
Основные несовместимые изменения в jQuery 4:
57+
- `$.unique()` удалён. Используйте `$.uniqueSort()`.
58+
- Ряд устаревших методов удалён. См. [руководство по обновлению jQuery 4.0](https://jquery.com/upgrade-guide/4.0/).
59+
60+
### vow → нативный Promise
61+
62+
Зависимость `vow` удалена. Весь асинхронный код теперь использует нативный `Promise`.
63+
64+
Было:
65+
66+
```js
67+
var vow = require('vow');
68+
var promise = vow.resolve(value);
69+
```
70+
71+
Стало:
72+
73+
```js
74+
const promise = Promise.resolve(value);
75+
```
76+
77+
### Система сборки: ENB → Vite
78+
79+
Весь инструментарий ENB заменён на Vite.
80+
81+
Было:
82+
83+
```bash
84+
./node_modules/.bin/enb make
85+
```
86+
87+
Стало:
88+
89+
```bash
90+
npm run build # обе платформы
91+
npm run build:desktop # только desktop
92+
npm run build:touch # только touch
93+
```
94+
95+
Конфигурация Vite находится в `build/vite.config.js`. Кастомный плагин `vite-plugin-bem-levels` в `build/plugins/` обеспечивает сканирование BEM-уровней и разрешение модулей.
96+
97+
### Node.js 20+
98+
99+
Минимальная поддерживаемая версия Node.js — 20 (было 8). Обновите `.nvmrc` или конфигурацию CI.
100+
101+
### Линтинг: jshint/jscs → ESLint 10
102+
103+
Замените кастомные `.jshintrc` или `.jscs.json` правила на flat-конфигурацию ESLint (`eslint.config.js`).
104+
105+
### Тестирование
106+
107+
- **Серверные тесты**: `mocha`/`chai` заменены на `node:test`/`node:assert`.
108+
- **Браузерные тесты**: `mocha-phantomjs` заменён на Playwright. Запуск: `npm run test:browser`.
109+
- **Все тесты**: `npm run test:all` запускает серверные и браузерные тесты.
110+
111+
### CI/CD: Travis → GitHub Actions
112+
113+
Замените `.travis.yml` на `.github/workflows/ci.yml`. Новый CI запускает задачи lint, test, test:browser и build.
114+
115+
### Git-хуки: git-hooks → husky
116+
117+
Замените `.githooks/` на конфигурацию husky. Скрипт `prepare` в `package.json` автоматически настраивает husky при `npm install`.
118+
3119
## 4.0.0
4120

5121
### Изменения в блоке `i-bem`

README.md

Lines changed: 32 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# bem-core library [![Build Status](https://travis-ci.org/bem/bem-core.svg?branch=v2)](https://travis-ci.org/bem/bem-core) [![GitHub Release](https://img.shields.io/github/release/bem/bem-core.svg)](https://github.com/bem/bem-core/releases) [![devDependency Status](https://david-dm.org/bem/bem-core/dev-status.svg)](https://david-dm.org/bem/bem-core#info=devDependencies)
1+
# bem-core library [![CI](https://github.com/bem/bem-core/actions/workflows/ci.yml/badge.svg?branch=v5)](https://github.com/bem/bem-core/actions/workflows/ci.yml) [![GitHub Release](https://img.shields.io/github/release/bem/bem-core.svg)](https://github.com/bem/bem-core/releases)
22

3-
Documentation on `bem-core` in a much more informative way is also available at [bem.info](https://en.bem.info/libs/bem-core/). It is also available [in Russian](https://ru.bem.info/libs/bem-core/).
3+
Documentation on `bem-core` is also available at [bem.info](https://en.bem.info/libs/bem-core/). It is also available [in Russian](https://ru.bem.info/libs/bem-core/).
44

55
## What is this?
66

@@ -9,11 +9,17 @@ It provides the minimal stack for coding client-side JavaScript and templating.
99

1010
## Use
1111

12-
The easiest way to run a project with `bem-core` is to use
13-
the [project-stub](https://github.com/bem/project-stub).
12+
Install as an npm dependency:
1413

15-
You can use any other way you are familiar with to include the library into
16-
the project.
14+
```shell
15+
npm install bem-core@5
16+
```
17+
18+
jQuery 4 is a peer dependency — install it alongside:
19+
20+
```shell
21+
npm install jquery@^4.0.0
22+
```
1723

1824
## Inside
1925

@@ -30,7 +36,7 @@ the project.
3036
- `objects` — helpers for JS-objects
3137
- `functions` — helpers for JS-functions
3238
- `events` — JS-events
33-
- `querystring` — helpers for work with querystring
39+
- `uri` — helpers for work with URIs and querystrings
3440
- `tick` — global timer
3541
- `idle` — IDLE event
3642
- `next-tick` — polyfill for `nextTick`/`setTimeout(0, ...)`
@@ -39,7 +45,6 @@ the project.
3945
- `clearfix` — CSS clearfix trick
4046
- `identify` — identify JS-objects
4147
- `cookie` — helpers for work with browser cookies
42-
- `vow` — Promises/A+ implementation
4348
- `dom` — helpers for work with DOM
4449
- `loader` — loader for JS files
4550
- `ua` — browser features detection
@@ -58,125 +63,54 @@ The autogenerated JSDoc API can be found on bem.info. E.g. JSDoc for `i-bem` is
5863

5964
## Changelog
6065

61-
You can check the changelog at the [Changelog](https://bem.info/libs/bem-core/changelog/) page.
66+
See [CHANGELOG.md](CHANGELOG.md).
6267

6368
## Migration
6469

65-
If you used BEM before, check the [migration instructions](https://bem.info/libs/bem-core/migration/).
70+
If you are upgrading from v4, see [MIGRATION.md](MIGRATION.md).
6671

6772
## Development
6873

6974
### Working copy
7075

71-
1. Get the needed version code (e.g., `v4`):
76+
1. Get the source code:
7277
```shell
73-
$ git clone -b v4 git://github.com/bem/bem-core.git
74-
$ cd bem-core
78+
git clone -b v5 git://github.com/bem/bem-core.git
79+
cd bem-core
7580
```
7681

77-
2. Install the dependencies:
82+
2. Install the dependencies (requires Node.js 20+):
7883
```shell
79-
$ npm install
84+
npm install
8085
```
8186

82-
You need `export PATH=./node_modules/.bin:$PATH`
83-
or an alternative way to run locally-installed `npm` dependencies.
84-
85-
3. Install all necessary libraries:
87+
3. Run linting:
8688
```shell
87-
$ npm run deps
89+
npm run lint
8890
```
8991

90-
4. Build and run tests (specs):
92+
4. Run tests:
9193
```shell
92-
$ npm test
94+
npm test # server-side tests (node:test)
95+
npm run test:browser # browser tests (Playwright)
96+
npm run test:all # both
9397
```
9498

95-
5. Run development server:
99+
5. Build:
96100
```shell
97-
$ npm start
101+
npm run build # desktop + touch platforms
98102
```
99103

100104
### How to contribute
101105

102106
Please refer to [How to contribute](/CONTRIBUTING.md) guide.
103107

104-
### Modular testing
105-
106-
A default test bundle for `functions__debounce`:
107-
```shell
108-
$ magic make desktop.specs/functions__debounce
109-
```
110-
111-
You can see the results of the tests in the terminal after the building process finishes.
112-
113-
You can also watch them in a browser loading `desktop.specs/functions__debounce/spec-js+browser-js+bemhtml/spec-js+browser-js+bemhtml.html`.
114-
115-
Run tests for other BEM entities in the same way. This will work for those which are equipped with `.spec.js` file.
116-
117-
### Code coverage
118-
119-
To build code coverage report add `ISTANBUL_COVERAGE=yes` environment variable to the tests run command:
120-
```shell
121-
$ ISTANBUL_COVERAGE=yes magic make desktop.specs && istanbul report html
122-
```
123-
124-
You can run modular testing with coverage as well by using more concrete build target as was described above.
125-
```
126-
$ ISTANBUL_COVERAGE=yes magic make desktop.specs/functions__debounce && istanbul report html
127-
```
128-
129-
After tests finish, you can view coverage HTML report by opening `coverage/index.html` in your favorite
130-
browser.
131-
132-
The whole code coverage statistics can be found on the [bem-core profile page](https://coveralls.io/r/bem/bem-core) on
133-
[Coveralls](https://coveralls.io).
134-
135-
Tests are built with a [enb-bem-specs](https://github.com/enb-bem/enb-bem-specs/) library.
136-
Check the [details](https://ru.bem.info/tools/bem/enb-bem-specs/) (available in Russian only).
137-
138108
## Supported browsers
139109

140-
Our browser support policy is based on statistics we get from [Yandex](https://company.yandex.com) services.
141-
142-
Browsers with more than 2% users get full compliant support, more than 0.5% — partially compliant
143-
(which means that data is accessible but not necessary 100% functional). New features testing
144-
is not provided by us for  browsers with less than 0.5% users.
145-
146-
### Desktop
147-
148-
#### Fully compliant
149-
150-
- Google Chrome 29+
151-
- Firefox 24+
152-
- Yandex 1.7+
153-
- Opera 12.16
154-
- MSIE 10.0
155-
- MSIE 9.0
156-
- MSIE 8.0
157-
- Opera 12.15
158-
159-
#### Partially compliant
160-
161-
- Opera 17.0
162-
- Opera 16.0
163-
- Opera 12.14
164-
- Opera 12.2
165-
- Firefox 23
166-
167-
### Touch
168-
169-
#### Fully compliant
170-
171-
- iOS 6+
172-
- Android 2.3+
173-
- Opera Mobile 12+
174-
- Windows Phone 7+
175-
176-
#### Partially compliant
177-
178-
- iOS 5
179-
- Android 2.2
110+
- Google Chrome (latest)
111+
- Firefox (latest)
112+
- Safari (latest)
113+
- Edge (latest)
180114

181115
## License
182116
Code and documentation copyright 2012 YANDEX LLC. Code released under the [Mozilla Public License 2.0](LICENSE.txt).

0 commit comments

Comments
 (0)