Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 20 21:04
    m-mujica commented #5303
  • Sep 20 20:23
    m-mujica opened #5303
  • Sep 20 20:23

    m-mujica on upgrade-deps

    Update can-type and can-stache-… (compare)

  • Sep 20 20:05
    m-mujica edited #5302
  • Sep 20 20:03
    m-mujica synchronize #5302
  • Sep 20 20:03

    m-mujica on upgrade

    Upgrade routing guide to Can 6 Fix incorrect highlight Use svg images (instead of .png) (compare)

  • Sep 20 19:32
    m-mujica opened #5302
  • Sep 20 19:29

    m-mujica on upgrade

    Upgrade routing guide to Can 6 Fix incorrect highlight (compare)

  • Sep 20 17:42

    m-mujica on upgrade

    WIP: Upgrade (compare)

  • Sep 20 17:06
    do-adams starred canjs/canjs
  • Sep 20 13:34

    chasenlehara on 5119-testing-guide

    Update the Testing guide for Ca… (compare)

  • Sep 20 13:21
    cherifGsoul commented #5295
  • Sep 20 13:18
    cherifGsoul synchronize #5295
  • Sep 20 13:18

    cherifGsoul on update-theme-new-buttons

    Theme pre-release 2 (compare)

  • Sep 20 10:29

    greenkeeper[bot] on socket.io-client-2.3.0

    (compare)

  • Sep 20 10:26

    greenkeeper[bot] on socket.io-client-2.3.0

    chore(package): update socket.i… (compare)

  • Sep 20 06:40
    HellMagic starred canjs/canjs
  • Sep 19 20:42
    m-mujica commented #5119
  • Sep 19 18:40
    phillipskevin closed #5300
  • Sep 19 18:40
    phillipskevin commented #5300
dylanrtt
@dylanrtt
well that was just for illustration purposes and the function seemed to be running
Justin Meyer
@justinbmeyer
ah, the function is running, but the wrong arguments?
dylanrtt
@dylanrtt
maybe this is a better example http://jsbin.com/doxuvusiqo/edit?html,js,output
Justin Meyer
@justinbmeyer
this is an interesting case
so {{parentAttr}} is bound to the "template scope"'s parentAttr property
later, when you set parentAttr, it's on the my-component viewModel
which is different then the template-scope
dylanrtt
@dylanrtt
ah, that makes sense
Justin Meyer
@justinbmeyer
this is why {{parentAttr}} doesn't change
well, that doesn't change
because once can.view.Scope finds a "context" that has a parentAttr value ... it stops listening for other contexts
technically, {{parentAttr}} should probably change to "def"
because viewModel.parentAttr should be higher then templateVM.parentAttr
but there's big performance advantageous for not listening to other scopes
once you found a match
I added parentAttr: null
dylanrtt
@dylanrtt
I actually don't have a need for 2-way binding this way. So far, I've only needed to give the parent scope read access to the child, but I ran into a bug where the refs scope was modifying the child (after a routing change ended a batch) and the compute would throw an error. I was trying to see if I could reproduce it in a smaller case like this but it doesn't update the child as we are seeing.
Justin Meyer
@justinbmeyer
also, you could do {{./parentAttr}}
ah
yeah, please let me know if you can reproduce
dylanrtt
@dylanrtt
The weird thing is there was no reason for the parent scope to be modified as it was basically just inserting. Depending on how I got to the page, it would not happen at all
Chris Gomez
@akagomez

I notice a lot of people use the block helper to set the context of the nested template:

{{#foo.bar}}
  Baz is a property of bar: {{baz}}
{{/foo.bar}}

Question 1 of 2:
Will the content of the {{#foo.bar}} block be re-rendered whenever there is a change event on bar, or only when bar is set on foo?

Question 2 of 2:
If rendered on change, is there a clever way to set context without the expensive re-rendering of the entire block? Or is the context setting what makes it necessary to re-render the entire block?

Mohamed Cherif Bouchelaghem
@cherifGsoul
@justinbmeyer hi, when you have time, can you give me guidance to fix and test this canjs/can-connect#27 or the line in comment is just enough
Justin Meyer
@justinbmeyer
@cherifGsoul I submitted a fix last night.
Mohamed Cherif Bouchelaghem
@cherifGsoul
@justinbmeyer yes I saw it and made a little commet :+1:
thanks :)
Mohamed Cherif Bouchelaghem
@cherifGsoul
I just see that <can-import from="..."></can-import> dosent have same behavior as <can-import from="..."/>
how to choose between them?
David Luecke
@daffl
@cherifGsoul <can-import /> => imports synchronously (everything in the template after this will have the data from that import)
<can-import></can-import> imports dynamically (the context within that tag will be a promise with a {{value}} that has the module context once it is resolved).
Mohamed Cherif Bouchelaghem
@cherifGsoul
@daffl it's clear now thank you :smile:
Paulius
@paulius005
So if I have a compute that just returns a function. Is there a way to make it destroy its cache so it can keep calling the function? Running this.attr('change'); has been the only way I have been able to get my validation to work. Otherwise calling allErrors doesn't actually go into _errorsArray
allErrors: can.compute(function() {
      return this._errorsArray();
    }),
    _errorsArray: function(attributes) {
       this.attr('change');
Mohamed Cherif Bouchelaghem
@cherifGsoul
@paulius005 is this in a can.Map
Paulius
@paulius005
yep
v2.0.0pre something
Mohamed Cherif Bouchelaghem
@cherifGsoul
2.3.0pre?
Paulius
@paulius005
2.0.0
Mohamed Cherif Bouchelaghem
@cherifGsoul
emm an old version!! I think its was a bug to define can.compute in a map
Paulius
@paulius005
Yeah, we've spent most of the quarter trying to update. We're making great progress, now we're running into heap size issues while building. We're just hoping we don't have to upgrade steal before finishing the canjs update
Mohamed Cherif Bouchelaghem
@cherifGsoul
the compute problem was corrected in 2.2.0I gues
Paulius
@paulius005
thanks!
attr('change') it is
Nikolay Nadorichev
@Luanre
Is it possible to render component's template only if no content passed to can.Component ?
Chris Gomez
@akagomez
@Luanre That’s a good question. As far as I know, no.
Mohamed Cherif Bouchelaghem
@cherifGsoul
@Luanre I was wondering that too for example page component should only change the content
Matthew Phillips
@matthewp
You could implement this yourself in inserted
something like
this.attr("emptyContents", this.element.children().length === 0)
this wouldn't be dynamic, of course
would need mutation observers for that