bem-components icon indicating copy to clipboard operation
bem-components copied to clipboard

Reorganize library structure

Open aristov opened this issue 9 years ago • 2 comments

Current scheme:

common.blocks/
    input/
        __control/
        _type/
        input.tests/
        input.bemhtml
        input.js
desktop.blocks/
    input/
        _autofocus/
        input.js
touch.blocks/
    input/
        __control/
        input.js
design/
    common.blocks/
        input/_theme/
            input_theme_islands.styl
    desktop.blocks/
        input/_theme/
            input_theme_islands.styl

Proposal:

blocks/
    input/
        __control/
        _type/
        input.design/_theme/
            input_theme_islands.styl
        input.desktop/
            _autofocus/
            input.design/_theme/
                input_theme_islands.styl
            input.js
        input.tests/
        input.touch/
            __control/
            input.js
        input.bemhtml
        input.js

Move design and platform-specific redefinitions to the blocks folder. Look the branch for more detailed illustration. We can keep all knowledge about the block in it's folder. This change can help us to keep the codebase more clear and convenient.

aristov avatar Jul 17 '15 10:07 aristov

:-1: for design, :+1: for the rest.

I'm not sure how much harder will be build process of that proposal, but it looks pretty well.

/cc @blond What you think about that?

qfox avatar Jul 17 '15 10:07 qfox

«Кручу-верчу, запутать хочу!» :smiley:

I like this idea, because blocks are more important than levels. Level is part of the implementation of the block.

But I don't understand how to build this.

And yet I do not like that theme is inside a block. Because theme is not part of block implementation. Theme should be unified for all blocks.

blocks/
  input/
    input.desktop/
    input.js
themes/
  islands/
    input/
      input.desktop/
      input.styl

blond avatar Jul 17 '15 11:07 blond