These are chat archives for canjs/canjs

14th
Dec 2017
Jeroen Cornelissen
@jeroencornelissen
Dec 14 2017 20:57
How is can-element different from can-component?
Frank Lemanschik
@frank-dspeed
Dec 14 2017 20:57
@jeroencornelissen thats my most loved topic
:)
Ok Lets get into that from a high level point of view can-component registers a can-view-callback that renders the component if the component-tag is inserted or found in a stache template
Jeroen Cornelissen
@jeroencornelissen
Dec 14 2017 20:58
I'm having some performance issues rendering a list component and each row is also a component.
Kevin Phillips
@phillipskevin
Dec 14 2017 20:58
can-element uses customElements.define
so you can put your custom element directly in html and the html parser will render it
Frank Lemanschik
@frank-dspeed
Dec 14 2017 20:59
can-element is a WebComponent it registers a Custom Element in the browser Custom Element API read about that via https://webcomponents.org
you can use a can-component inside can-element but can-element inside can-component leads to unexpected behaviers
Jeroen Cornelissen
@jeroencornelissen
Dec 14 2017 21:00
Ok, will have you look into that or go vanilla js for rendering.
Kevin Phillips
@phillipskevin
Dec 14 2017 21:00
does each row need to be a component?
Jeroen Cornelissen
@jeroencornelissen
Dec 14 2017 21:00
*have to
Not sure, but it looked the best solution architect first.
Man, autocorrect
Frank Lemanschik
@frank-dspeed
Dec 14 2017 21:02
you got autocorrection inside gitter?
that would help me a lot what are you using :)
Jeroen Cornelissen
@jeroencornelissen
Dec 14 2017 21:02
I'm on mobile
Frank Lemanschik
@frank-dspeed
Dec 14 2017 21:02
ah ya that ....
i understand the problem 100%
are you using google keyboard?
it works most best and remembers custom words
the best i found on android
Jeroen Cornelissen
@jeroencornelissen
Dec 14 2017 21:04
Problem is that each row can contain difficult configs, settings, ... So my stache has a lot of if's, switches and helpers.
And each row can contain other components.
Frank Lemanschik
@frank-dspeed
Dec 14 2017 21:06
i am using stache helpers for that
like in the bitballs example via options.context.PropertyNameInDefineMap
@jeroencornelissen look into the bitballs/public/src/app.js
Jeroen Cornelissen
@jeroencornelissen
Dec 14 2017 21:07
Ok. Thx
Frank Lemanschik
@frank-dspeed
Dec 14 2017 21:07
the pageComponentsConfig helper
example is really powerfull