These are chat archives for canjs/canjs

Dec 2017
Viktor Busko
Dec 08 2017 13:27
Guys, am I right that can.js has its own virtual dom implementation similar to React? Based on this it seems like it has (unless this is DoneJS feature). But based on description here: this is different thing (maybe just mess with terms). My question is... it there any plans or possibility to do shallow rendering for can.js similar to: The purpose is the same - testing.
Kevin Phillips
Dec 08 2017 15:32
We have virtual dom for server-side rendering, @Lighttree. It's not used when rendering client-side.
You could use it for tests though - we do that in can-stache and a few other libraries.
to make sure they work in the real DOM and VDOM
we don't currently have a plan to do any kind of shallow rendering
but you can always submit a proposal
that would be really cool
Justin Meyer
Dec 08 2017 15:46
@phillipskevin that's an interesting idea ... ideally, we'd make all custom elements use Scope to find the custom tag ... what's suggested would be a matter of making a scope that doesn't "look" for globally registered tags.
Trickier if you are importing.
Brad Momberger
Dec 08 2017 15:58
For testing in isolation, you can do a shallow render of components by replacing can-view-callbacks._tags with an empty object after every test -- the effect will be to not render content for any custom tag (including can-components) that you don't define in the test itself. We have a limited form of this in the can-stache-bindings tests (deleting individual tag handlers) but the crude way is easiest.
Chasen Le Hara
Dec 08 2017 16:30
Our bi-weekly contributors meeting live-stream will start in just a few minutes!