bem / bem-core

BEM Core Library
https://ru.bem.info/technologies/classic/i-bem/
Other
276 stars 95 forks source link

i-bem-dom: move to i-bem.js #1123

Closed aristov closed 8 years ago

aristov commented 9 years ago

We have i-bem.vanilla.js that provides DOM-independent BEM framework.

Since we have the modular system, we don't need to use the i-bem module for creating BEM-entities without DOM representation. All common helpers can be defined as simple ym-modules. We never use clear i-bem module in client-side code, only it's DOM-specific redefinition.

We use the *.js extension for files with DOM-specific JavaScript.

So there is no need to create a separate entity. We just should redefine i-bem.vanilla.js by i-bem.js. We won't lose an ability to use i-bem module in any environment without DOM - just build *.vanilla.js files without *.js.

This approach is more clear from any POV. If we do so, we don't more need to clarify why the framework's name is i-bem, but i-bem-dom module is used everywhere.

As for the file extensions, then we should gradually go towards a world where *.js will replace *.vanilla.js and all that we now write in *.js/*.browser.js should be moved to *.dom.js. If some day we'll find ourselves at that point, we'll get still more clear pattern: i-bem.js is common BEM-framework and i-bem.dom.js is for the DOM-specific things.

From discussions on working meetings with @veged @dfilatov @narqo.

aristov commented 9 years ago

cc @veged @dfilatov @narqo

dfilatov commented 9 years ago

AFAIR we discussed this approach but @veged objected.

What's more, to my mind we should join i-bem and i-bem-dom :)