Skip to content

Commit f0b0c09

Browse files
author
blond
committed
release(changelog): v1.0.0
1 parent 21ead41 commit f0b0c09

File tree

2 files changed

+387
-0
lines changed

2 files changed

+387
-0
lines changed

CHANGELOG.md

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,199 @@
11
Changelog
22
=========
33

4+
1.0.0
5+
-----
6+
7+
### Modifier Delimiters ([#76])
8+
9+
Added support to separate value of modifier from name of modifier with specified string.
10+
11+
Before one could only specify a string to separate name of a modifier from name of a block or an element. It string used to separate value of modifier from name of modifier.
12+
13+
**Before:**
14+
15+
```js
16+
var myNaming = bemNaming({
17+
mod: '--'
18+
});
19+
20+
var obj = {
21+
block: 'block',
22+
modName: 'mod',
23+
modVal: 'val'
24+
};
25+
26+
myNaming.stringify(obj); // 'block--mod--val'
27+
```
28+
29+
**Now:**
30+
31+
```js
32+
var myNaming = bemNaming({
33+
mod: { name: '--', val: '_' }
34+
});
35+
36+
var obj = {
37+
block: 'block',
38+
modName: 'mod',
39+
modVal: 'val'
40+
};
41+
42+
myNaming.stringify(obj); // 'block--mod_val'
43+
```
44+
45+
Also added the [modValDelim](modValDelim) field.
46+
47+
### Presets ([#81])
48+
49+
Added naming presets:
50+
- `origin` (by default) — Yandex convention (`block__elem_mod_val`).
51+
- `two-dashes`[Harry Roberts convention](harry-roberts-convention) (`block__elem--mod_val`).
52+
53+
It is nessesary not to pass all options every time you use the convention by Harry Roberts.
54+
55+
```js
56+
var bemNaming = require('bem-naming');
57+
58+
// with preset
59+
var myNaming = bemNaming('two-dashes');
60+
```
61+
62+
## Bug fixes
63+
64+
- Functions for custom naming not working without context([#72]).
65+
66+
**Example:**
67+
68+
```js
69+
70+
var bemNaming = require('bem-naming');
71+
72+
var myNaming = bemNaming({ mod: '--' });
73+
74+
['block__elem', 'block--mod'].map(myNaming.parse); // The `parse` function requires context of `myNaming` object.
75+
// To correct work Usage of bind (myNaming.parse.bind(myNaming)) // was necessary.
76+
```
77+
78+
- `this` was used instead of global object. ([#86]).
79+
80+
### Removed deprecated
81+
82+
- The `BEMNaming` filed removed ([#74]).
83+
84+
Use `bemNaming` function to create custom naming:
85+
86+
```js
87+
var bemNaming = require('bemNaming');
88+
89+
var myNaming = bemNaming({ elem: '__', mod: '--' });
90+
```
91+
92+
- The `elemSeparator`, `modSeparator` and `literal` options removed ([#75]).
93+
94+
Use `elem`, `mod` and `wordPattern` instead.
95+
96+
- The `bem-naming.min.js` file removed.
97+
98+
### Other
99+
100+
- The `stringify` method should return `undefined` for invalid objects, but not throw errror ([#71]).
101+
102+
It will be easier to check for an empty string than use `try..catch`.
103+
104+
**Before:**
105+
106+
```js
107+
try {
108+
var str = bemNaming.stringify({ elem: 'elem' });
109+
} catch(e) { /* ... */ }
110+
```
111+
112+
**Now:**
113+
114+
```js
115+
var str = bemNaming.stringify({ elem: 'elem' });
116+
117+
if (str) {
118+
/* ... */
119+
}
120+
```
121+
122+
[custom-naming-convention]: ./README.md#custom-naming-convention
123+
[modValDelim]: ./README.md#modvaldelim
124+
[harry-roberts-convention]: ./README.md#В-стиле-Гарри-Робертса
125+
126+
[#86]: https://github.com/bem/bem-naming/pull/86
127+
[#81]: https://github.com/bem/bem-naming/pull/81
128+
[#76]: https://github.com/bem/bem-naming/pull/76
129+
[#75]: https://github.com/bem/bem-naming/pull/75
130+
[#74]: https://github.com/bem/bem-naming/pull/74
131+
[#72]: https://github.com/bem/bem-naming/pull/72
132+
[#71]: https://github.com/bem/bem-naming/pull/71
133+
134+
### Commits
135+
136+
* [[`4c26980996`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/4c26980996)] - style(browser): add `browser` env for eslint (blond)
137+
* [[`b31f3c068c`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/b31f3c068c)] - fix(global): use `window` and `global` instead of `this` (blond)
138+
* [[`7d5cb11f27`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/7d5cb11f27)] - docs(common-misconceptions): down info about common misconceptions (blond)
139+
* [[`099ee42b2e`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/099ee42b2e)] - docs(naming object): rename BEM-naming to naming object (blond)
140+
* [[`2d7402429f`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/2d7402429f)] - test(unknow preset): add test for unknown preset (blond)
141+
* [[`01e680b4f8`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/01e680b4f8)] - fix(unknow preset): throw error if preset is unknown (blond)
142+
* [[`7273d172b3`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/7273d172b3)] - style(jscs): remove strict options (blond)
143+
* [[`063ccfe877`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/063ccfe877)] - refactor(functionality): get rid of `BemNaming` class (blond)
144+
* [[`509a816737`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/509a816737)] - chore(package): update eslint to version 2.5.1 (greenkeeperio-bot)
145+
* [[`beaabbe447`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/beaabbe447)] - docs(presets): use `two-dashes` preset for convention by Harry Roberts (blond)
146+
* [[`a2e7bd8da4`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/a2e7bd8da4)] - test(presets): use presets (blond)
147+
* [[`b93bd98407`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/b93bd98407)] - feat(presets): add `two-dashes` preset (blond)
148+
* [[`b225514e1c`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/b225514e1c)] - refactor(test): rename `harry-roberts` to `two-dashes` preset (blond)
149+
* [[`4f49550f46`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/4f49550f46)] - docs(toc): add toc to readme (blond)
150+
* [[`02c4094b59`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/02c4094b59)] - docs(install): add info about install (blond)
151+
* [[`5111759236`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/5111759236)] - docs(usage): add info about usage (blond)
152+
* [[`5b7b89770f`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/5b7b89770f)] - docs(view): update view of readme (blond)
153+
* [[`bf30206f03`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/bf30206f03)] - chore(package): update coveralls to version 2.11.9 (greenkeeperio-bot)
154+
* [[`a56e72f76d`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/a56e72f76d)] - docs(harry-roberts): update Convention by Harry Roberts (blond)
155+
* [[`da4497084b`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/da4497084b)] - docs(mod): add docs for mod option as object (blond)
156+
* [[`a05bf68d3c`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/a05bf68d3c)] - docs(modValDelim): add docs about `modValDelim` field (blond)
157+
* [[`a15ee5b7e9`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/a15ee5b7e9)] - docs(nbsp): use normal spaces (blond)
158+
* [[`6627261ccc`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/6627261ccc)] - test(presets): update `harry-roberts` cases (blond)
159+
* [[`d3e1ab464a`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/d3e1ab464a)] - test(modValDelim): add tests for modValDelim field (blond)
160+
* [[`326e375cd3`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/326e375cd3)] - test(options): add tests for options processing (blond)
161+
* [[`4c1c11e186`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/4c1c11e186)] - feat(modVal): support custom modifier separator (blond)
162+
* [[`c47b757340`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/c47b757340)] - test(fields): add tests for delim fields (blond)
163+
* [[`d5f5e92a7a`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/d5f5e92a7a)] - fix(fields): does not delim fields (blond)
164+
* [[`f512b06ee7`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/f512b06ee7)] - fix(jsdoc): fix `BemNaming` jsdoc (blond)
165+
* [[`9c0eab77cb`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/9c0eab77cb)] - fix(BemNaming): simplify initialization (blond)
166+
* [[`8750bc117b`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/8750bc117b)] - fix(options): remove deprecated options (blond)
167+
* [[`6e1a11de84`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/6e1a11de84)] - fix(BEMNaming): remove `BEMNaming` filed (blond)
168+
* [[`0b0f78a0a2`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/0b0f78a0a2)] - refactor(BemNaming): rename `BEMNaming` to `BemNaming` (blond)
169+
* [[`59637a038f`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/59637a038f)] - chore(package): update dependencies (greenkeeperio-bot)
170+
* [[`e08019ba81`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/e08019ba81)] - fix(namespace): should return namespace (blond)
171+
* [[`b0cd36c94b`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/b0cd36c94b)] - fix(stringify): should not throw error (blond)
172+
* [[`87187a46b3`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/87187a46b3)] - chore(cover): add coveralls (blond)
173+
* [[`2c5f0da71c`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/2c5f0da71c)] - chore(bower): update bower.json (blond)
174+
* [[`a29fbda2a0`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/a29fbda2a0)] - refactor(index): move index file (blond)
175+
* [[`f57a8f2a6c`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/f57a8f2a6c)] - refactor(strict): use strict mode (blond)
176+
* [[`a0eb1510ab`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/a0eb1510ab)] - chore(npm): update package.json (blond)
177+
* [[`3c5dbc9982`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/3c5dbc9982)] - test(coverage): fix coverage (blond)
178+
* [[`237f8def13`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/237f8def13)] - chore(npm): remove `.npmignore` file (blond)
179+
* [[`73a494dbf7`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/73a494dbf7)] - chore(test): use ava instead of mocha (blond)
180+
* [[`66fe215fb7`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/66fe215fb7)] - chore(lint): support ES 2015 (blond)
181+
* [[`41a45e5774`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/41a45e5774)] - chore(jscs): update jscs to 2.11.0 (blond)
182+
* [[`2afe2eb855`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/2afe2eb855)] - test(travis): run tests in NodeJS 4 and 5 (blond)
183+
* [[`5310cabc19`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/5310cabc19)] - style(lint): fix code for eslint (blond)
184+
* [[`b3768aed57`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/b3768aed57)] - chore(lint): use eslint instead of jshint (blond)
185+
* [[`58d6d46403`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/58d6d46403)] - chore(editorconfig): update .editorconfig (blond)
186+
* [[`95c474f682`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/95c474f682)] - chore(min): removed bem-naming.min.js (blond)
187+
* [[`562dda5d08`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/562dda5d08)] - docs(badges): updated badges (blond)
188+
* [[`32cc76799c`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/32cc76799c)] - chore(browsers): remove tests in browsers (blond)
189+
* [[`d1d5da419f`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/d1d5da419f)] - Fixed jshint config (andrewblond)
190+
* [[`3cdd0cb2db`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/3cdd0cb2db)] - Updated email (andrewblond)
191+
* [[`54ffa6cdf9`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/54ffa6cdf9)] - Fixed typos (andrewblond)
192+
* [[`cce496b844`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/cce496b844)] - Updated github username (andrewblond)
193+
* [[`de9e767abb`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/de9e767abb)] - Update shields secure http protocol (tavriaforever)
194+
* [[`2332b0da0f`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/2332b0da0f)] - **Docs**: fix spell whithin → within (Ludmila Sverbitckaya (Bot))
195+
* [[`27ad3c4d3f`](https://github.com/Andrew Abramov <[email protected]>/bem-naming/commit/27ad3c4d3f)] - **Docs**: fix spell in README.ru.md (Ludmila Sverbitckaya (Bot))
196+
4197
0.5.1
5198
-----
6199

0 commit comments

Comments
 (0)