These are chat archives for canjs/canjs

Jun 2016
Jun 02 2016 08:43
can we provide a similar functionality of with your components? what i mean, is that we dont need to create a stache-template within the component tag and append this stache-frag to the dom
Justin Meyer
Jun 02 2016 15:41
@pYr0x yup
The big issue is Scope
basically, how do you deal with view-model bindings and such
we could make it work for Custom elements that only use attribute-value based bindings
but not
<my-component foo="bar">
<my-component {foo}="bar">
Jun 02 2016 16:14
i think that would be ok for the first step
within nested components the view-model-binding would work, right?
<my-component><x-foo ({^value}}="bar"></x-foo></my-component>
Justin Meyer
Jun 02 2016 16:17
depends .. is that showing light or shadow dom?
meaning ... lets say someone did something like the following:
document.body = "<my-component><x-foo ({^value}}="bar"></x-foo></my-component>"
(ignoring my quote mistakes) that wouldn't work
I don't think light dom view bindings would work
only shadow DOM
  tag: "my-component",
  view: stache('<x-foo ({^value}}="bar"></x-foo>')
document.body = "<my-component/>"
Joel Kuzmarski
Jun 02 2016 20:45
What is the difference between <can-import/> and <can-import></can-import>? I'm seeing difference in behaviour.
Kevin Phillips
Jun 02 2016 20:48
if you include the end tag, it uses progressive loading
meaning it won’t automatically be loaded
and the scope inside the tag will be the promise
so you can do things like
<can-import from=“my-app/home/">
  {{#if isPending}}
Joel Kuzmarski
Jun 02 2016 20:53
Thank you for the explanation @phillipskevin. What does export-as="" mean/do? Can't find docs on it?
Matthew Phillips
Jun 02 2016 20:57
export-as is for done-autorender
It defines the ViewModel that will be used to render the template
usually you provide the viewmodel like so:
var VM = require("./viewmodel");
var renderer = require("./main.stache");

var frag = renderer(new VM())
but with done-autorender, the plugin does the above for you
so using `export-as="viewModel" tells done-autorender to use that module as the VM
Joel Kuzmarski
Jun 02 2016 21:06
You wouldn't ever "export-as" anything other than "viewModel", Correct? As in you'd never write export-as="myModel".
Jun 02 2016 21:33
@leoj3n canjs/canjs#2408
for your first question
Joel Kuzmarski
Jun 02 2016 21:35
@pYr0x looks great thanks! I was actually wondering if can-import was functionally equivelant to import.
Jun 02 2016 21:36
it is
you can import the exported value from a module
Thomas Sieverding
Jun 02 2016 23:41
How do I use done-autorender outside of my main index.stache
It doesn’t seem to play nicely as a drop in replacement for can/view/autorender
I’d like my component demo html files to be similar to my main index entry point