These are chat archives for canjs/canjs

23rd
Sep 2016
Mason Shin
@minsooshin
Sep 23 2016 00:21
btw, is this correct?
var DefineMap = require("can-define/map/map");
var DefineList = require("can-define/map/map”);
isn’t it suppose to be this?
var DefineList = require(“can-define/list/list”);
@justinbmeyer
Justin Meyer
@justinbmeyer
Sep 23 2016 01:22
@minsooshin yes, thanks
@nriesco thanks, did you checkout the todomvc one?
Mason Shin
@minsooshin
Sep 23 2016 01:27
is there a way to import dynamically in the stache?
{{#if widget}}
  <can-import from=“pages/{{widget}}/" />
something like this
when I tried with
<can-import from=“pages/projects” />
Nico R.
@nriesco
Sep 23 2016 01:28
@justinbmeyer actually I was using that one as a guide, but it is far more complex (believe me, for a beginer like me it is quite difficult to understand. On the contrary, the chat demo is still complex but I could get it.
Mason Shin
@minsooshin
Sep 23 2016 01:28
it works, but with {{widget}} doesn’t work
Justin Meyer
@justinbmeyer
Sep 23 2016 01:29
@minsooshin thats not supported. You could create a helper that does it maybe.
The core problem is that <can-import> doesn't listen for changes in the from attribute
cc @matthewp
@nriesco ok, I'm happy you found it useful. I'm working on another example to come after TodoMVC
My goal will be 4 progressively harder guides ... Chat -> TodoMVC -> ATM -> Place My Order
TodoMVC and ATM are about the same, but ATM will show testing
Mason Shin
@minsooshin
Sep 23 2016 02:43
yes, I got it
I added that in the helper :)
thanks @justinbmeyer
Sérgio Cunha
@sergiomcunha
Sep 23 2016 10:56
Hello
I'm having this warning on my page "WARN: Use %index in place of @index."
How can I use the %index?? Is there any documentation for that?
Sérgio Cunha
@sergiomcunha
Sep 23 2016 10:58
Ok, thanks
but I'm not using the version 3.0.0*
Sérgio Cunha
@sergiomcunha
Sep 23 2016 11:00
Ok, but there's any special reason for this warning to appear?
Julian
@pYr0x
Sep 23 2016 11:01
yes
canjs/can-stache#19
Justin Meyer
@justinbmeyer
Sep 23 2016 15:27
About to start the contributors meeting: https://www.youtube.com/watch?v=Vc_eomYD4D8
Justin Meyer
@justinbmeyer
Sep 23 2016 16:53
@pYr0x @matthewp @daffl @phillipskevin @prashantsharmain - in CanJS's tests ... flush is called 4144 times, it only does something 33 times.
so hopefully that means it's not going to impact performance much
Kevin Phillips
@phillipskevin
Sep 23 2016 16:55
I’d be interested to look at those 33 times
see if it could simplify a bunch of tests where flush is doing the work for us now
Justin Meyer
@justinbmeyer
Sep 23 2016 17:08
@phillipskevin I think what it can do ... is actually remove a few places where we are already using can.batch.afterPreviousEvents
The first of those 33 places is in the component tabs example test
Kevin Phillips
@phillipskevin
Sep 23 2016 17:09
internally you mean? or in a test?
Justin Meyer
@justinbmeyer
Sep 23 2016 17:09
internally
Kevin Phillips
@phillipskevin
Sep 23 2016 17:10
ok
I actually think this might be solving some hidden bugs
b/c can.view.live.list listens for add
but it might get that event first
it looks like it is
then it starts trying to read other computes .... but those computes haven't yet responded to the add event
so there's a flush
which makes sense
I bet there's some stuff in can.view.live that can get simplified b/c of this
same thing w/ the tree combo
the nice thing is that so far, there's not really other events that need to be dispatched
just the signal that tells computes to update themselves
Kevin Phillips
@phillipskevin
Sep 23 2016 17:15
while running the flush you mean?
Justin Meyer
@justinbmeyer
Sep 23 2016 17:18
yeah
so far it seems it's always involved with {{#each}}
and something being added to a list
each responds to the change ... and then reads observables
I wonder if this will actually make things faster ....
b/c it's possible the DOM was being generated
with the stale data
and then the compute's change event was being fired
and the update happening
this will make it so the compute's change events are fired immediately ... and the value isn't stale
so there shouldn't be any change
Kevin Phillips
@phillipskevin
Sep 23 2016 17:20
yeah, might be hard to measure that
Justin Meyer
@justinbmeyer
Sep 23 2016 17:21
canjs/can-compute#28
@phillipskevin actually ... that would probably have found this error
if the value of that read was checked
actually ...
nm
that one would have been right ...
hmmm
that's an interesting case ... b/c the compute's change handler is reading itself
there's probably an optimization to be done here
Kevin Phillips
@phillipskevin
Sep 23 2016 17:26
yeah, it makes sense that the flush wouldn’t catch that
Justin Meyer
@justinbmeyer
Sep 23 2016 17:26
that if you've been updated for a batch ... and then read w/i that batch ... no need to flush
async computes are a bit screwy
yeah, so it seems like only the async example and {{#each}} is going to cause a flush
I'd say for a day-to-day developer .. they are going to flush only in tests and {{#each}}
Nico R.
@nriesco
Sep 23 2016 21:18
This message was deleted