These are chat archives for bem/talk

14th
Aug 2014
Vladimir Starkov
@iamstarkov
Aug 14 2014 12:11
block A mustdeps block B, block B nodeps block A. Who wins?
Sergey Berezhnoy
@veged
Aug 14 2014 12:49
@matmuchrapna by default -- nodeps
Vladimir Starkov
@iamstarkov
Aug 14 2014 13:39
@veged that's mean final deps will be empty?
Sergey Berezhnoy
@veged
Aug 14 2014 13:41
@matmuchrapna it can depend on concrete code (in case of some priorities) — can you show example?
Vladimir Starkov
@iamstarkov
Aug 14 2014 13:53
desktop.bundles/index/block/A/A.deps.js // ({ mustDeps: [{ block: 'B' }])
desktop.bundles/index/block/B/B.deps.js // ({ noDeps: [{ block: 'A' }])
I want to see deps for block A
Sergey Berezhnoy
@veged
Aug 14 2014 15:04
for which bemdecl?
Vladimir Starkov
@iamstarkov
Aug 14 2014 15:04
for A bemdecl
Sergey Berezhnoy
@veged
Aug 14 2014 15:05
if only A block appear — it should be without B deps
you can test it
maybe it vary for different tools and versions
but in my general understanding it should be just A, because we have noDeps between A and B
so the semantic of noDeps is to delete dependency link between entities
and noDeps have the top most priority
Vladimir Starkov
@iamstarkov
Aug 14 2014 15:10
in my mind there are to options:
  1. final deps list wll be empty
  2. final deps will contain only B block
I didn't guess, right?
Sergey Berezhnoy
@veged
Aug 14 2014 15:12
ouch! I miss read your example :-( in your case second file (B.deps.js) have no impact at all
B noDeps A means that if you have anywhere B mustDeps A it's gonna be deleted
if you have A mustDeps B there is nothing to delete with B noDeps A
Vladimir Starkov
@iamstarkov
Aug 14 2014 15:38
Where I can read about nodeps mechanism?
Vladimir Starkov
@iamstarkov
Aug 14 2014 15:50
I have not find any spec about deps on bem.info
Vsevolod Strukchinsky
@floatdrop
Aug 14 2014 16:03
Some part of docs about (should|must|no)Deps is here - http://ru.bem.info/tools/bem/bem-tools/depsjs/
Docs says:
noDeps cancels dependencies on lower redefinition levels, preserving them only to the level the noDeps property is defined upon
But what is lower level of definition?
Is is works this way? A mustDeps B + A noDeps C + B mustDeps C = A B?
Or it should only affect levels, but not inheritance in same level of definitions?
Sergey Berezhnoy
@veged
Aug 14 2014 20:18
noDeps cancel dependencies — it means that A mustDeps B + A noDeps B = A
more real example — if you have library with some dependency between particular two blocks you can delete it (exactly) on your project level throughout noDeps
so noDeps doesn't mean that you "delete block from result" but means that you "remove particular dependency link between particular blocks" (actually it's work not only for block but for any BEM-entities: blocks, elems, modifiers)