Skip to content

Commit 9962bcd

Browse files
vegedclaude
andcommitted
docs: add v5.0.0 CHANGELOG, MIGRATION guide, update CI for v5 branch
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c2f3686 commit 9962bcd

File tree

3 files changed

+155
-1
lines changed

3 files changed

+155
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [master, v*]
66
pull_request:
7-
branches: [master]
7+
branches: [master, v5]
88

99
jobs:
1010
lint:

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
11
# Changelog
22

3+
## 5.0.0
4+
5+
### Breaking changes
6+
7+
- **ESM-only**: The entire codebase has been migrated from the `ym` module system (`modules.define`/`modules.require`) to native ES modules (`import`/`export`). The `ym` runtime dependency has been removed.
8+
- **Vite build system**: ENB and all 17+ associated packages have been replaced with [Vite](https://vite.dev/). A custom `vite-plugin-bem-levels` plugin handles BEM level scanning, `bem:*` virtual module resolution, and redefinition chain barrel generation.
9+
- **jQuery 4.0**: The `jquery` peer dependency has been upgraded from `^3.x` to `^4.0.0`. Notable API change: `$.unique()` has been removed — use `$.uniqueSort()` instead.
10+
- **Node.js 20+**: The minimum supported Node.js version is now 20 (was 8).
11+
- **Native Promises**: `vow` has been removed. All code now uses native `Promise`.
12+
- **Native test runner**: Server-side tests now use `node:test` and `node:assert` instead of `mocha`/`chai`.
13+
- **Playwright**: Browser tests now use [Playwright](https://playwright.dev/) instead of `mocha-phantomjs` (PhantomJS is dead).
14+
- **ESLint 10**: Linting has been migrated from `jshint`/`jscs` to ESLint 10 with flat config (`eslint.config.js`).
15+
- **GitHub Actions CI**: Travis CI has been replaced with GitHub Actions.
16+
- **Husky + lint-staged**: `git-hooks` has been replaced with `husky` and `lint-staged`.
17+
18+
### Notable changes
19+
20+
- All `.vanilla.js` and `.js` source files have been converted to ES modules with `import`/`export` syntax.
21+
- Module redefinition chains (e.g., `jquery` with pointer event extensions) are now handled via auto-generated barrel files by `vite-plugin-bem-levels`.
22+
- The `i18n` block retains its API but uses native ES modules internally.
23+
- Browser spec tests (28 spec files, 500+ test cases) run via Vite dev server + Playwright.
24+
- Vite produces platform-specific builds (`desktop`, `touch`) with jQuery as an external dependency.
25+
26+
### Removed packages
27+
28+
- **Build**: `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+
- **Linting**: `jscs`, `jscs-bem`, `jshint`, `jshint-groups`
30+
- **Testing**: `mocha-phantomjs`, `istanbul`, `chai-as-promised`
31+
- **Other**: `ym`, `vow`, `bower`, `git-hooks`, `gitbook-api`, `bem-naming`, `bem-walk`
32+
33+
### Removed config files
34+
35+
- `.enb/` directory (ENB build config)
36+
- `.jshintrc`, `.jscs.json`, `.jshint-groups.js` (linting configs)
37+
- `.bowerrc`, `bower.json` (Bower configs)
38+
- `.travis.yml` (Travis CI config)
39+
- `.githooks/` directory (git-hooks config)
40+
341
## 4.3.1
442

543
### Bug fixes

MIGRATION.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,121 @@
11
# Migration
22

3+
## 5.0.0
4+
5+
### ym → ES modules
6+
7+
The `ym` module system (`modules.define`/`modules.require`) has been replaced with native ES modules.
8+
9+
Before:
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+
After:
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+
All `bem:*` imports are resolved at build time by `vite-plugin-bem-levels` to the actual file paths, respecting platform-specific level priorities.
29+
30+
### Module redefinitions
31+
32+
Module redefinitions that previously used `modules.define` with a callback receiving the previous module value are now handled via barrel files generated by the Vite plugin.
33+
34+
Before (ym redefinition):
35+
36+
```js
37+
modules.define('jquery', function(provide, $) {
38+
$.event.special.pointerclick = { /* ... */ };
39+
provide($);
40+
});
41+
```
42+
43+
After (side-effect import in barrel):
44+
45+
```js
46+
// The barrel file auto-generated by 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+
The `jquery` peer dependency is now `^4.0.0`.
55+
56+
Key breaking changes in jQuery 4:
57+
- `$.unique()` has been removed. Use `$.uniqueSort()`.
58+
- Several deprecated methods have been removed. See [jQuery 4.0 upgrade guide](https://jquery.com/upgrade-guide/4.0/).
59+
60+
### vow → native Promise
61+
62+
The `vow` dependency has been removed. All asynchronous code now uses native `Promise`.
63+
64+
Before:
65+
66+
```js
67+
var vow = require('vow');
68+
var promise = vow.resolve(value);
69+
```
70+
71+
After:
72+
73+
```js
74+
const promise = Promise.resolve(value);
75+
```
76+
77+
### Build system: ENB → Vite
78+
79+
The entire ENB toolchain has been replaced with Vite.
80+
81+
Before:
82+
83+
```bash
84+
./node_modules/.bin/enb make
85+
```
86+
87+
After:
88+
89+
```bash
90+
npm run build # both platforms
91+
npm run build:desktop # desktop only
92+
npm run build:touch # touch only
93+
```
94+
95+
The Vite config is in `build/vite.config.js`. The custom `vite-plugin-bem-levels` plugin in `build/plugins/` handles BEM level scanning and module resolution.
96+
97+
### Node.js 20+
98+
99+
The minimum supported Node.js version is now 20 (was 8). Update your `.nvmrc` or CI configuration accordingly.
100+
101+
### Linting: jshint/jscs → ESLint 10
102+
103+
Replace any custom `.jshintrc` or `.jscs.json` rules with ESLint flat config (`eslint.config.js`).
104+
105+
### Testing
106+
107+
- **Server-side tests**: `mocha`/`chai` have been replaced with `node:test`/`node:assert`.
108+
- **Browser tests**: `mocha-phantomjs` has been replaced with Playwright. Run with `npm run test:browser`.
109+
- **All tests**: `npm run test:all` runs both server-side and browser tests.
110+
111+
### CI/CD: Travis → GitHub Actions
112+
113+
Replace `.travis.yml` with `.github/workflows/ci.yml`. The new CI runs lint, test, test:browser, and build jobs.
114+
115+
### Git hooks: git-hooks → husky
116+
117+
Replace `.githooks/` with husky configuration. The `prepare` script in `package.json` sets up husky automatically on `npm install`.
118+
3119
## 4.0.0
4120

5121
### Changes in the `i-bem` block

0 commit comments

Comments
 (0)