Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 01:04
    greenkeeper[bot] commented #5392
  • 01:04

    greenkeeper[bot] on core-js-3.5.0

    chore(package): update core-js … (compare)

  • Dec 11 18:34
    greenkeeper[bot] labeled #5444
  • Dec 11 18:34
    greenkeeper[bot] opened #5444
  • Dec 11 18:34

    greenkeeper[bot] on can-observable-mixin-1.0.7

    fix(package): update can-observ… (compare)

  • Dec 11 18:30

    cherifGsoul on update-infrastructure-page

    (compare)

  • Dec 11 18:30

    cherifGsoul on master

    Update infrastructure page with… (compare)

  • Dec 11 18:30
    cherifGsoul closed #5441
  • Dec 11 18:30
    cherifGsoul closed #5417
  • Dec 10 17:40
    cherifGsoul review_requested #5443
  • Dec 10 16:47
    cherifGsoul review_requested #5441
  • Dec 10 16:35
    cherifGsoul synchronize #5441
  • Dec 10 16:35

    cherifGsoul on update-infrastructure-page

    Fix typos (compare)

  • Dec 10 10:01
    jkeruzec starred canjs/canjs
  • Dec 09 18:59
    cherifGsoul review_requested #5443
  • Dec 09 18:59
    cherifGsoul opened #5443
  • Dec 09 18:51

    cherifGsoul on document-inserted-removed-can6

    Add inserted/removed events to … (compare)

  • Dec 09 15:38
    greenkeeper[bot] labeled #5442
  • Dec 09 15:38
    greenkeeper[bot] opened #5442
  • Dec 09 15:38

    greenkeeper[bot] on can-view-live-5.0.1

    fix(package): update can-view-l… (compare)

Mohamed Cherif Bouchelaghem
@cherifGsoul
ok
Dovid Bleier
@dbleier
@cherifGsoul do you know if when fall-through-cache updates, it calls the setter of the prop that called getList?
for example
signPromise: {
   get(lastval, set) {
      return Sign.getList({...});
  },
  set(newval) {
  }
},
sign: {
   get(lastval, set) {
    this.attr('signPromise').then(function(signs) { set(signs[0]);}
  },
  set(newval) {
  }
}
Christopher Oliphant
@RALifeCoach

further to this discussion, I have a component with it’s internal viewModel i.e.

can.Component.extend({
tag: ‘my-component’,
template: can.view(‘#some-template’),
viewModel: {
    define: {
        xxx: { type: ‘string’ }
    }
}
});

I add the component to my page via:

var template = can.stache(‘<my-component id="me"></my-component>’)
$(‘body”).append(template());
var myComponent = $(‘#me’);
myComponent.bind(??????);

I want to bind to the component to know when the value of xxx changes.

Dovid Bleier
@dbleier
what would I bind to to emit a change event when the List is updated?
Mohamed Cherif Bouchelaghem
@cherifGsoul
@dbleier I think you should listen to sign changes
Dovid Bleier
@dbleier
sign the VM prop or the connect prop?
I don't think the sign getter is called again after the list is updated
at least I don't see that happening
Mohamed Cherif Bouchelaghem
@cherifGsoul
the setter should be called
@RALifeCoach we can not make it like that
@dbleier sorry I didnt have a closer look at fall-through-cachebehavior so I dont know how it realy does things :/
Dovid Bleier
@dbleier
@cherifGsoul I just but a debugger; line in set for both signPromise and sign and neither got hit
Mohamed Cherif Bouchelaghem
@cherifGsoul
@dbleier can you make a jsbin?
Dovid Bleier
@dbleier
ok
Christopher Oliphant
@RALifeCoach
@cherifGsoul okay, that’s what I thought. What I have done is trigger an event from within the component and listen for the event in the owning module. That works.
Mohamed Cherif Bouchelaghem
@cherifGsoul
@RALifeCoach
   can.Component.extend({
tag: ‘my-component’,
template: can.view(‘#some-template’),
viewModel: {
    define: {
        xxx: { type: ‘string’ }
    }
},
events: {
"{viewModel} xxx":function(){
}
}
});
Justin Meyer
@justinbmeyer
@RALifeCoach was unable to read all of what you wrote ... but I want to address one thing you said .... CanJS, and most frameworks, make your life easier, but that always comes at some performance cost
C makes your life easier than assembly, but at some cost
JavaScript makes your life easier than C, but at some cost
CanJS makes your life easier than plain JS, but at some cost
Why does CanJS's observables covert the entire object into an observable? Because when MOST properties are used (which is the case for MOST apps), its faster to do all of them right away instead of progressively convert them like LazyMap
Christopher Oliphant
@RALifeCoach
@justinbmeyer I am willing to accept some performance hit when initially creating the page. I was surprised when updating the page took even longer. My expectation was that Can JS would be quick and efficient especially when no DOM updates were required.
Justin Meyer
@justinbmeyer
CanJS's observables are "quick" but not quick compared to plain JS objects
they have been worked on a lot to make performance as fast as possible
btw, if you have objects that you don't need observable, you can define their type like "type": "*"
with the define plugin
those objects will not be converted to Maps / Lists
Christopher Oliphant
@RALifeCoach
When I strip down the big object to be an object that contains only needed properties, there is slight improvement on initial load and a huge improvement on update.
I did make use of type: ‘*’ - that gave some improvement
Justin Meyer
@justinbmeyer
the improvement on update doesn't make sense
I wonder if this is what @Bajix was talking about
are you listening to "change" events?
the number of props shouldn't matter to update
ah ... if you are listening to "change" events ... then @Bajix is also right that additional slowness will be introduced
in the initial render
b/c bubbling will need to be setup
Christopher Oliphant
@RALifeCoach
I don’t have a need to fire events on data changing. The only events would be internal to the UI. (Updating the DOM when a value changed.)
Justin Meyer
@justinbmeyer
not sure what that means ... does that mean no, you are not binding on "change" events?
Christopher Oliphant
@RALifeCoach
no I am not binding change events
Dovid Bleier
@dbleier
@cherifGsoul here is the jsbin http://jsbin.com/hemuliyugu/1/edit?js,console
the 1st time you run will set up the cache
then try making a change to the data in the fixture
you'll notice it console.logs the cached data only
if you run a 3rd time you'll see the updates
Mohamed Cherif Bouchelaghem
@cherifGsoul
ok Im checking
Justin Meyer
@justinbmeyer
@RALifeCoach if you'd like to check if bubbling is getting setup, you can put a debugger here: https://github.com/canjs/canjs/blob/master/map/bubble.js#L42
if that gets hit, something is setting up bubbling
Dovid Bleier
@dbleier
the goal is to get logHellos to fire again after cache is updated