These are chat archives for canjs/canjs

24th
May 2016
Justin Meyer
@justinbmeyer
May 24 2016 00:06
@minsooshin the old validate plugin is deprecated
but not the can-validate plugin
sorry if that's confusing
Mason Shin
@minsooshin
May 24 2016 00:07
got it. I just installed can-validate to try a shot in my app
Justin Meyer
@justinbmeyer
May 24 2016 00:08
cool
Mason Shin
@minsooshin
May 24 2016 00:14
doesn can-validate works with bootstrap?
Justin Meyer
@justinbmeyer
May 24 2016 00:15
I'm not sure. I can get @Macrofig to answer that tomorrow morning.
Mason Shin
@minsooshin
May 24 2016 00:15
got it
I think it works :)
I just checked bootstrap code itself.
Mason Shin
@minsooshin
May 24 2016 04:36
@justinbmeyer the reason I asked that was I had javascript error with my library when I tried to use can-validate module with {($value)} on input dom.
81cabd76-2112-11e6-91c9-0602900ec9c3.png
I have this in my code.
Array.prototype.contains = function(obj) {
  return this.indexOf(obj) > -1;
};
I am curious why {($value)} causes this issue with null.
Currently, I just remove this prototype function and replace the feature with regex instead of using this function. However, I would like to understand why it happens.
Adam L Barrett
@BigAB
May 24 2016 20:17

Is there any way to "observe" a maps property/attr in dev mode, so that when that attr changes, I can somehow see a list of all the getters/computes that just ran?

Preferably one which starts with whatever original change happened and ends with this attrs change?

Is their a way this could be possible?

Matthew Phillips
@matthewp
May 24 2016 20:19
@justinbmeyer worked on something surrounding that
not sure where he left off with it
Justin Meyer
@justinbmeyer
May 24 2016 20:20
@BigAB I worked on being able to trace a compute's dependencies
and theorized on making an event contain all the dependent events that led up to it in dev mode
Adam L Barrett
@BigAB
May 24 2016 20:21
Yeah, that sounds like what I need (I think), what is the status?
Justin Meyer
@justinbmeyer
May 24 2016 20:21
I wrote it and then threw it away
the 1st part
but you want the 2nd part
Adam L Barrett
@BigAB
May 24 2016 20:22
Ok, but it could be possible then. Maybe like as a dev plugin, if I wanted to tackle that later this week or next, do you have naythign I could look at or should I just talk to you about it?
so dependencyChange is called when a compute's dependency has .. er .. changed
ev.target should have "what" changed
ev.type should be the event name (typically the property)
Adam L Barrett
@BigAB
May 24 2016 20:25
Okay, beauty. Yeah that sets me up enought to get started I think, Thanks
Justin Meyer
@justinbmeyer
May 24 2016 20:25
basically, you'd want to change this to pass that information along to the eventual new event that gets fired
that already happens ... but only with batchNum
we'd want to change this so maybe the whole event object gets passed around
that function is called with the batch num
and triggers a new event for the changed compute
{type: "change", batchNum: batchNum}
that object could include the events that preceded it.
it could even include the stack trace