These are chat archives for bem/talk

20th
Aug 2014
Alexej Yaroshevich
@zxqfox
Aug 20 2014 00:18
https://github.com/zxqfox/express-bem okay. Something wrong now?
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 07:08
good work on decoupling engines from express-bem
Alexej Yaroshevich
@zxqfox
Aug 20 2014 07:08
thanks ;-)
Vladimir Starkov
@iamstarkov
Aug 20 2014 07:18
hey, if I have deps file like this ([{ shouldDeps: […] }, { shouldDeps: […] }]). What does it mean?
Alexej Yaroshevich
@zxqfox
Aug 20 2014 07:18
just 2 separated section with the same functionality
Vladimir Starkov
@iamstarkov
Aug 20 2014 07:19
I don't understand
Usually block have one deps object with should and must deps. What can I expect if the same block have deps objects (of course different)?
Alexej Yaroshevich
@zxqfox
Aug 20 2014 07:21
([{ shouldDeps: A }, { shouldDeps: B }]) is almost the same as ([{ shouldDeps: A.concat(B) }])
Vladimir Starkov
@iamstarkov
Aug 20 2014 07:21
okay, can you point me to to this logic described in spec?
Alexej Yaroshevich
@zxqfox
Aug 20 2014 07:22
Do you have some configured bundle? Can you build it and look at deps.json?
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 07:22
I found it only in i-bem block (i-bem__dom.deps.js) - is this a hack for something?
Alexej Yaroshevich
@zxqfox
Aug 20 2014 07:25
Hm... In i-bem__dom another case. There are must+should
But yes, it's really similar.
It's not a hack as I can see
And once again, atm deps and depsByTech not so well documented, unfortunately there is no widely described documentation about it.
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 07:28
bem-components is active user of this notation. bummer.
Alexej Yaroshevich
@zxqfox
Aug 20 2014 07:28
([{ shouldDeps: A }, { shouldDeps: B }]) == ([{ shouldDeps: A.concat(B) }])
// but
([{ shouldDeps: A }, { tech: "some.js", shouldDeps: B }])
// not the same
@matmuchrapna where you found it? ;-)
Vladimir Starkov
@iamstarkov
Aug 20 2014 07:31
nowhere, but if we can have array of deps objects in deps file, why both of them cannot have shouldDeps properties
Alexej Yaroshevich
@zxqfox
Aug 20 2014 07:32
yes they can. it was made for case 2 in the last example
but nobody doing it I think ;-D
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 07:42
what does spec.js and tmpl-spec.js tech do?
I bet they needed for testing purposes
Alexej Yaroshevich
@zxqfox
Aug 20 2014 07:44
spec for tests
tmpl-spec is probably for stub test files generation. or not.
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 07:45
okay, we can ignore them
there is attach block in bem-components thou
which have tech: ‘js'
Alexej Yaroshevich
@zxqfox
Aug 20 2014 07:45
oh, ye
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 07:47
can it be fixed?
Alexej Yaroshevich
@zxqfox
Aug 20 2014 07:47
you can try to use noDeps
at your level
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 07:47
I dont have tech term to ignore it
could attach block be rewritten to merge tech: ‘js’ block into first one?
@veged ?
Alexej Yaroshevich
@zxqfox
Aug 20 2014 07:48
mm, just add one more object to the end ([{...}, {tech: "spec.js", noDeps: ...}])
im not sure
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 07:49
I dont have tech support in my deps parser
Alexej Yaroshevich
@zxqfox
Aug 20 2014 07:49
ah.
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 07:50
imho tech should not be in deps
and it usage in bem-core and bem-components tells me that I am right
Alexej Yaroshevich
@zxqfox
Aug 20 2014 07:50
ye, im agree
it should be realized another way
Vladimir Starkov
@iamstarkov
Aug 20 2014 07:51
I agreed with @floatdrop, 'cause deps by tech used only in one block in bem-core and one block in bem-components (i don't speak about tech spec.js, which is using only for testing purposes)
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:04
also attach block has section for tech: ‘js’ but inside it only bemhtml tech is specified. Is this means, that if we are using bh - then we can ignore this whole section?
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:05
I think if you are using bh it should be replaced with bh. But probably it can be resolved without this section in enb so yes you can ignore
I don't know well enb
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:11
I cant replace something in bem-components
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:12
You can noDeps bemhtml in deps.js and so on
as temporary solution
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:12
I don’t have tech
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:13
I think your parser just ignore it
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:13
Yep
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:13
So you just need to cancel bemhtml
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:13
Can I just say, that it can’t be done?
(also we don’t yet have noDeps support)
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:15
Well, unfortunately i don't know. we need @veged or somebody else who working on it.
Well. What If you make empty bemhtml tech?
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:16
I don’t understand what you mean
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:17
I mean you will create a stub that will generate empty bemhtml.js files instead of real bemhtml (or spec.js, or anything)
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:17
Why would I do that?
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:18
Just to skip a problem for a while
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:18
This will fix a problem, if I have tech support in deps files
But for know it just can’t be done
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:19
mkay ;-(
Sergey Berezhnoy
@veged
Aug 20 2014 08:31
a lot of messages, I missed :-(
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:31
attach block in bem-components has section for tech: ‘js’ but inside it only bemhtml tech is specified. Is this means, that if we are using bh - then we can ignore this whole section?
Sergey Berezhnoy
@veged
Aug 20 2014 08:32
@floatdrop you need to support tech in your deps parser — it's a part of deps format
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:32
and in any other blocks in bem-core & bem-components tech field in deps file used for spec.js tech (which used only for testing)
@veged well… I don’t think tech in deps is appropriate
and your usage of it is telling me the same
Sergey Berezhnoy
@veged
Aug 20 2014 08:33
if you use bh you should add it to tech deps too — think we better do this in bem-core itself (plz add issue)
Vladimir Starkov
@iamstarkov
Aug 20 2014 08:33

attach block in bem-components has section for tech: ‘js’ but inside it only bemhtml tech is specified. Is this means, that if we are using bh - then we can ignore this whole section?

I'm more concerned if we are using bh, then block attach will be broken for us?

Sergey Berezhnoy
@veged
Aug 20 2014 08:35
tech in deps is definitely appropriate ;-) I add it by my own ;-))
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:36
here you go bem/bem-core#652
Vladimir Starkov
@iamstarkov
Aug 20 2014 08:36
if we close eyes on testing purposes of tech term in deps, then there only two blocks have deps by tech (one for each bem block libraries)
oh
i-bem in bem-core use tech spec.js too
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:37
@veged I don't understand tech in deps too ;-\
Vladimir Starkov
@iamstarkov
Aug 20 2014 08:38
that's seems to me only one block in all bem blocks libs are using deps by tech
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:38
Feels like we can live without it
Vladimir Starkov
@iamstarkov
Aug 20 2014 08:39
may be this block can be restructured to not make deps logic too hard to understand, implement and support
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:39
not tech deps?
Sergey Berezhnoy
@veged
Aug 20 2014 08:41
the purpose of depsByTechs is to provide dependencies only for particular tech — for example, you need templates on client side (but not all of them, as on server), or you have some deps in your tests (specs) only for mocks and doesn't need such deps everywhere
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:41
this can be done without tech property
Sergey Berezhnoy
@veged
Aug 20 2014 08:42
so tech in deps give you possibility to decl different deps for different environments (techs)
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:42
you can store client templates in *.client.js and server in *.js
so if you want to build all js - just build all *.js files
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:43
yup. agreed
Sergey Berezhnoy
@veged
Aug 20 2014 08:43
@floatdrop describe the way without depsByTechs plz — we thinking about it a lot and pretty believe in current solution
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:43
and if you want just client code - build *.client.js files in blocks
simple and verbose
Sergey Berezhnoy
@veged
Aug 20 2014 08:44
there is side problem with bemhtml/bh — they are pretend both to be "template" tech, so we just need to decl deps for both
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:44
when I thinking about depsByTechs it's like I looking at bentley with low-cost wires
Sergey Berezhnoy
@veged
Aug 20 2014 08:45
with such approach you gonna need to duplicate content in .js and .client.js
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:45
why so?
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:46
it can be resolved with another.js tech
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:46
this approach easly moves to *.base.js if you want so
but I can’t see why
Sergey Berezhnoy
@veged
Aug 20 2014 08:49
let's describe from start — you have some code in *.bemhtml (from libs and your own), then you need to use some of this templates on browser side, you suggest to make *.browser.bemhtml tech and copy-paste needed templates to it (even you doesn't know which, because templates may have own deps)
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:49
not copy-paste, but move
Sergey Berezhnoy
@veged
Aug 20 2014 08:50
I also think topic gonna be too complex to 1) chat about 2) in non-native lang ;-)
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:50
;-D]
Sergey Berezhnoy
@veged
Aug 20 2014 08:50
copy-paste because you still need previosly usage as old *.bemhtml
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:50
I strongly advise against it
you building for server side *.bemhtml and *.client.bemhtml
and for client just *.client.bemhtml
Sergey Berezhnoy
@veged
Aug 20 2014 08:51
come to BEMup in Spb https://tech.yandex.ru/events/bemup/2-september-2014/ and let's continue offline
how can you calc the content of *.client.bemhtml without special type of declaration which blocks you need on client?
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:53
you take all blocks for both cases and blocks, that have *.client.bemhtml files goes to client
I don’t see, why you should allow users to create different dependency tree for different techs
this leads to confusion and complex build process
Sergey Berezhnoy
@veged
Aug 20 2014 08:56
but content for button.client.bemhtml and button.bemhtml are the same
all template are the same on client and server actually
I agree with some complexity here but it's payload for avoiding a lot of copy-paste
Alexej Yaroshevich
@zxqfox
Aug 20 2014 08:57

I don’t see, why you should allow users to create different dependency tree for different techs

same here

Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 08:59
@veged again you should not copy paste code from .bemhtml to *.client.bemhtml
if it is same just rename file
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:00
stop touching fs when no need ;-)
Sergey Berezhnoy
@veged
Aug 20 2014 09:00
because the nature of the World as such ;-) you need different subset of templates on browser
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 09:01
@veged so you achive this
Sergey Berezhnoy
@veged
Aug 20 2014 09:01
I can't rename it, because we need *.bemhtml too
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 09:01
by splitting different parts to different files
and placing common parts to *.base.js
Sergey Berezhnoy
@veged
Aug 20 2014 09:01
it's not a different parts — it's the same code
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 09:01
then there is no problem
Sergey Berezhnoy
@veged
Aug 20 2014 09:01
templates are always the same
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:02
I think the reason of low usage depsByTechs in core libraries is nature.
But in real projects there're lot of it
But I still can't imagine it
Sergey Berezhnoy
@veged
Aug 20 2014 09:02
so I come up with *.base.bemhtml without any *.bemhtml and *.browser.bemhtml ;-) because there is no difference between
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 09:02
Can you provide examples @zxqfox ?
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:03
If I even can't imagine ;-) Nope.
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 09:03
@veged, if there is no difference between, why would you split it into different files first place
?
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:04
@veged Are you 100% sure there is no another way to resolve this problem?
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 09:04
Are you sure there is a problem? :D
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:04
depsByTech is ugly, u know
@floatdrop actually, yes. But I think it can be resolved via flexible dependencies or something
Sergey Berezhnoy
@veged
Aug 20 2014 09:05
I doesn't know about uglies of depsByTechs and I doesn't know another way yet
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 09:05
describe an example please @zxqfox
and we try to elaborate on this
Sergey Berezhnoy
@veged
Aug 20 2014 09:06
there is no difference in content of files and in deps between them but there is a difference which subset of whole code I need in *.browser.js tech
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 09:08
so, you have block, that included in browser build, but not included in server build?
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:08
and vice versa y
Sergey Berezhnoy
@veged
Aug 20 2014 09:08
yes
actually not vide versa
usually server have all of templates
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 09:08
so my point - you can move that code from blocks into files
Sergey Berezhnoy
@veged
Aug 20 2014 09:09
but for other cases it may be vv
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:09
But server doesn't need some packages
or some else
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 09:09
that will be placed in blocks that are requiring this magic on/off block
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:09
Actually, I don't understand why It shouldn't be resolved by splitting techs
And then merging to browser.js and node.js e.g.
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 09:09
or place empty file *.js and file with browser code *.client.js and always include that block
but, in fact this case is very rare
every body says about sharing code between sever/client, but on practice you don’t meet such code (besides bh library I guess)
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:11

But server doesn't need some packages

I mean server doesn't need special code which packing css/js to one js file

and unpacking it dynamically, etc.
Sergey Berezhnoy
@veged
Aug 20 2014 09:11
common guys, let's face that we can't discuss such hard topic in text chat format — we walk in a circle
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:11
;-D
ROUND
bummer
Sergey Berezhnoy
@veged
Aug 20 2014 09:12
ok — I can't
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:12
@floatdrop will you came in spb?
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 09:13
@zxqfox maybe
I dont like airlines
Sergey Berezhnoy
@veged
Aug 20 2014 09:13
@floatdrop you can code you suggestion in some short example and create an issue for further discuss
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 09:13
will do
issue is created, by the way
bem/bem-core#652
Sergey Berezhnoy
@veged
Aug 20 2014 09:21
actually I'm gonna reformulate issue to "Add depsByTech for BH along with current BEMHTML deps"
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:21
rewrite it
but depsByTech should be discussed hard anyway
Vladimir Starkov
@iamstarkov
Aug 20 2014 09:24
bem/bem-core#652 is not about bh depsByTech
it's about the whole depsByTech idea
Alexander Savin
@apsavin
Aug 20 2014 09:30
Hey guys what the problem with depsByTech? It's just a way to point that some techs of block have some deps.
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:32
The real problem is in it's nature. Block tech is just a part of block. It can't by nature be wisher. It's like a hand wanna sword, but head said nope, and gut wanna eat so head should eat.
And hand getting sword
It's like block is no more a solid thing. And we going back to js/css files instead of separated blocks with it.
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:50
Guys, bemup will be 2 or 6 sept?
Alexander Savin
@apsavin
Aug 20 2014 09:50
@zxqfox 6
Alexej Yaroshevich
@zxqfox
Aug 20 2014 09:50
ty <3
Alexander Savin
@apsavin
Aug 20 2014 09:54
@zxqfox, in the real world block is just a set of technologies. Dependencies of block are dependencies of each technology in it. You can consider it as a shortcut. Why can't some technology have additional dependencies? If you'll build bundle with that technology, then this additional dependecies will make sense, if not - then not.
But more important question is - how to avoid depsByTech? I see no way.
Alexej Yaroshevich
@zxqfox
Aug 20 2014 10:01

You can consider it as a shortcut. Why can't some technology have additional dependencies?

Because it will be block dependencies

Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 10:02
*it should be
Alexej Yaroshevich
@zxqfox
Aug 20 2014 10:02
If some tech of block need another block — It would be
At one hand we have blocks with their dependecies, at another we have techs with the same. Do you think techs should be with the same priority as blocks? Why?
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 10:09
I don’t think so. I just ignore techs in bem-core.
In issue I wrote, that tech is redundant, but it was rewritten by @veged
Alexej Yaroshevich
@zxqfox
Aug 20 2014 10:11
He just formalized issue. Nobody knows how to stop using depsByTechs
As I can see atm
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 10:11
He just rewrote it
Alexej Yaroshevich
@zxqfox
Aug 20 2014 10:11
It's a topic for offline. He's right
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 10:12
I more like open discussions when working on opensourced project.
At least when project is stable.
Alexej Yaroshevich
@zxqfox
Aug 20 2014 10:13
Well, topic was not about project, but about deps standard and realization. No?
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 10:14
No. I just conserned about bem-core / bem-components compatibility.
There is no well defined standard in documentation anyway.
Alexej Yaroshevich
@zxqfox
Aug 20 2014 10:14
That's a main problem I think
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 10:15
It will be very sad, if terminology from bem-tools and build systems will be in BEM standard
You should separate those guys
Alexej Yaroshevich
@zxqfox
Aug 20 2014 10:16
;-D
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 10:35
why https://tech.yandex.ru/events/bemup/2-september-2014/talks/2185/ is requiring Linux/Macos, but excludes Windows?
Sergey Berezhnoy
@veged
Aug 20 2014 11:51
but we can create another for further discussion
we also can point Skype meeting for discussion issue — it would be more efficient then typing about same things in cycle
Sergey Berezhnoy
@veged
Aug 20 2014 12:15
because Windows is much harder for support — but you can use Vagrant and VirtualBox
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 12:42
sigh
Vladimir Starkov
@iamstarkov
Aug 20 2014 18:06
why elems prop in deps can be a string?
I thought i should always be an array
Vsevolod Strukchinsky
@floatdrop
Aug 20 2014 18:07
bcz it shortcut
ffs