These are chat archives for canjs/canjs

23rd
Mar 2018
Viktor Busko
@Lighttree
Mar 23 2018 09:30

if you want to rule out auto-mount, you can break right here: https://github.com/canjs/can-view-callbacks/blob/731d4fe9cfb3998e2a382db07561f60dc917bca9/can-view-callbacks.js#L178

@phillipskevin Ok I got the issue. We started to implement new components using can 4 those components used on the page with can 2. And new components inside have inner components that have same names as components written in can 2

So let's say on the page we have list with comments. And we have re-usable <custom-textarea></custom-textarea> written in can 2.
After we added to this page new bundle with component about....feedbacks written on can 4 and this components has updated version of <cutom-textarea></custom-textarea> that using can 4 already :( can-view-callbacks register custom-textarea and render can4 component inside can2 component :)

Maybe there is way to add some check that verify... can 4+ components or i don't know some dericitive that tells to not touch this component.
There is global flag for this:
https://github.com/canjs/can-view-callbacks/blob/731d4fe9cfb3998e2a382db07561f60dc917bca9/can-view-callbacks.js#L21
But maybe there is more... local approach so we can mark our can 2 components.

Obviously there is way to... name them like can4-custom-textarea but aaahhh... not really good.

This is how it looks on UI:
https://www.dropbox.com/s/frgn7azgxoimy41/UI.PNG?dl=0

And in DOM (can4 component content highlighted) :)
https://www.dropbox.com/s/4p61qm1z0kg0g4t/dom.PNG?dl=0

Kevin Phillips
@phillipskevin
Mar 23 2018 14:36
Obviously there is way to... name them like can4-custom-textarea but aaahhh... not really good.
@Lighttree I think this is the correct solution
just like you can't have multiple native custom elements with the same tag name, you shouldn't create two components with the same tag name
Justin Meyer
@justinbmeyer
Mar 23 2018 20:54
@roemhildtg did you get the can-define fix for sorting?
Gregg Roemhildt
@roemhildtg
Mar 23 2018 21:21
Yup! It works. Thanks for getting that up so quickly