Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 15 18:40
    lateshift starred canjs/canjs
  • Sep 13 21:53
    chasenlehara closed #5207
  • Sep 13 21:28

    chasenlehara on major

    Update dist for release (compare)

  • Sep 13 21:28

    chasenlehara on v6.0.0-pre.14

    Update dist for release 6.0.0-pre.14 (compare)

  • Sep 13 21:22

    chasenlehara on 5207-remove-can-define

    (compare)

  • Sep 13 21:22

    chasenlehara on major

    Remove can-define usage in CanJ… (compare)

  • Sep 13 21:22
    chasenlehara closed #5282
  • Sep 13 21:08

    m-mujica on playlist

    WIP: Upgrade playlist editor to… (compare)

  • Sep 13 20:19
    m-mujica commented #5119
  • Sep 13 17:36
    m-mujica edited #5119
  • Sep 13 17:15
    m-mujica edited #5119
  • Sep 13 16:34
    chasenlehara review_requested #5282
  • Sep 13 16:34
    chasenlehara review_requested #5282
  • Sep 13 16:33
    chasenlehara ready_for_review #5282
  • Sep 13 15:04

    greenkeeper[bot] on webpack-4.40.2

    (compare)

  • Sep 13 14:47

    greenkeeper[bot] on webpack-4.40.2

    chore(package): update webpack … (compare)

  • Sep 13 14:36
    chasenlehara synchronize #5282
  • Sep 13 14:36

    chasenlehara on 5207-remove-can-define

    Remove can-define usage in CanJ… (compare)

  • Sep 13 13:56
    chasenlehara synchronize #5282
  • Sep 13 13:56

    chasenlehara on 5207-remove-can-define

    Remove can-define usage in CanJ… (compare)

Justin Meyer
@justinbmeyer
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
Nikolay Nadorichev
@Luanre
I've tried it
Mohamed Cherif Bouchelaghem
@cherifGsoul
@matthewp a use case for this hybrid mobile apps
Nikolay Nadorichev
@Luanre
in inserted event component already have rendered template
Matthew Phillips
@matthewp
it should be empty though, right?
unless you have stuff in your own template
you want to wrap your own template like
{{#if emptyContents}} ... {{/if}}
Nikolay Nadorichev
@Luanre
Ah, yeah, works like a charm, thank you!
my mistake was: {{#if emptyContents}}...{{else}}<content />{{/if}}
Paul Tichonczuk
@tracer99
If a key in a map is "watch", FF throws an error: 'TypeError: missing argument 1 when calling function this[prop]' because watch is a function in can.Map
should I file this as a bug or is there something I'm missing?
Matthew Phillips
@matthewp
there's a function named watch on can.Map?
is that your function?
Paul Tichonczuk
@tracer99
no
sec. I'll get you the details
Matthew Phillips
@matthewp
map = new can.Map