Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 16 20:07
    matthewp commented #5384
  • Oct 16 20:06
    matthewp labeled #5384
  • Oct 16 20:06
    matthewp opened #5384
  • Oct 16 19:53
    matthewp opened #5383
  • Oct 16 16:23
    phillipskevin closed #4841
  • Oct 15 21:43

    phillipskevin on master

    Update dist for release (compare)

  • Oct 15 21:43

    phillipskevin on v6.1.1

    Update dist for release 6.1.1 (compare)

  • Oct 15 21:34

    phillipskevin on can-observable-mixin-1.0.2

    (compare)

  • Oct 15 21:34

    phillipskevin on master

    fix(package): update can-observ… Merge branch 'master' into gree… Merge pull request #5382 from c… (compare)

  • Oct 15 21:34
    phillipskevin closed #5382
  • Oct 15 21:34

    phillipskevin on can-make-map-1.2.2

    (compare)

  • Oct 15 21:34

    phillipskevin on master

    fix(package): update can-make-m… Merge pull request #5380 from c… (compare)

  • Oct 15 21:34
    phillipskevin closed #5380
  • Oct 15 20:30
    phillipskevin synchronize #5382
  • Oct 15 20:30

    phillipskevin on can-observable-mixin-1.0.2

    fix(package): update can-observ… fix(package): update can-simple… Merge pull request #5372 from c… and 2 more (compare)

  • Oct 15 20:30
    phillipskevin opened #5382
  • Oct 15 20:28

    phillipskevin on can-simple-map-4.3.3

    (compare)

  • Oct 15 20:28

    phillipskevin on master

    fix(package): update can-simple… Merge pull request #5378 from c… (compare)

  • Oct 15 20:28
    phillipskevin closed #5378
  • Oct 15 20:26

    phillipskevin on can-observable-mixin-1.0.1

    (compare)

Justin Meyer
@justinbmeyer
The reason you'll see those warnings are because:
  1. you have something like {{plateName}}, but there's no object with a plateName property defined in the scope. This can be ok. It's just a warning. In those cases, it's faster if you do something like {{./plateName}}. Giving a hint on where to look speeds up the bindings.
2. At the time of running the template, there's no my-parent-component-tag component defined.
Mohamed Cherif Bouchelaghem
@cherifGsoul
@justinbmeyer How we can know that mustacheis used here?
Justin Meyer
@justinbmeyer
can/view/scanner is not used by stache.
Mohamed Cherif Bouchelaghem
@cherifGsoul
ok thank you
Viktor Busko
@Lighttree

@justinbmeyer
"are you using Mustache on purpose?" I am not :)
All my components generated by DoneJS generator (and all the templates are .stache), so not sure what can cause mustache processing.
What I'm trying to do is repeat behaviour from the end of this video: https://www.youtube.com/watch?v=mKOwwcKRBic (Share value between 2 components).

This is template for "parent" component that should import 2 others and child components should share data between each other.

<can-import from="trialsetup/components/user-edit-form/user-edit-form" />
<section class="container">
  <header class="row">
    <div class="col-md-12">
      <h1>Lets get you set up with recognition</h1>
      <p class="lead">Add your details below</p>
    </div>
  </header>
  <main class="row">
    <div class="col-md-7">
      <gf-user-edit-form></gf-user-edit-form>
    </div>
    <div class="col-md-5">
      Placeholder for the second component
    </div>
  </main>
</section>

So I'm going to use reference binding here like "*myReference"But as soon as I add input with 2-way binding to "user-edit-form" template:

<input type="text" name="name" {{$value}}="message">

It throws me WARN: can/view/scanner.js: No custom element found for gf-step-admin-setup

gf-step-admin-setup- actually "parent" component (you can find its template above) so looks like it have to exist when I import another component. (unless there is some tricky life-cycle)

The fun thing that I can see my template with input for a second but after that something happens it disappear from the page :)

f I'll change binding to something like that:

<input type="text" name="name" {$value}="message">

It will work, but this is not what I need :(

Mohamed Cherif Bouchelaghem
@cherifGsoul
@Lighttree can you ask the question in donejs chat room? https://gitter.im/donejs/donejs
Mohamed Cherif Bouchelaghem
@cherifGsoul

It will work, but this is not what I need :(

@Lighttree what you mean by this?

Viktor Busko
@Lighttree

@Lighttree what you mean by this?

It will render the component without issues but I need 2-way binding here. I'll try to go with CanJS only and check if it will work.

Mohamed Cherif Bouchelaghem
@cherifGsoul
this sentence: "it will work, but this is not what I need"
Viktor Busko
@Lighttree
whats wrong with it ? :)
Mohamed Cherif Bouchelaghem
@cherifGsoul
if it works, so it's fine it works or maybe I missunderstand :)
Viktor Busko
@Lighttree
It doesn't work correctly. If I add {{$value}} - I'll have the issue that I described above. But I was trying different things to fix it and understand whats wrong with my code. And this {$value} just an example that it can find everything (components, references etc.), but something wrong with the case when I change it to {{$value}}.
Mohamed Cherif Bouchelaghem
@cherifGsoul
@Lighttree can you make a jsbin that describe the problem?
Viktor Busko
@Lighttree
Yeah thats what I'm going to do :D
Mohamed Cherif Bouchelaghem
@cherifGsoul
thank you
Viktor Busko
@Lighttree
@cherifGsoul besides I've fixed issue, that I mention yesterday... it was typo in bindings (facepalm) I didn't saw that in one case we use {{..}} and in another {(..)}, I've expected to see double curly braces everywhere, so my eye didn't notice {()} :)
Mohamed Cherif Bouchelaghem
@cherifGsoul
@Lighttree ok, good :)
Dovid Bleier
@dbleier
I am recursively calling setTimeout and when I do, stache never renders. I think the reason is because can-wait overrides setTimeout with it's own version. And then waits for it to resolve before rendering, but since it is recursive, it never finishes. How to get around this?
  loadSlide(slides, index) {
    var self = this, cs = slides[index], 
    next = (index + 1) % slides.length;
    this.attr('currentSlide', cs);
    setTimeout(function() {
      self.loadSlide.call(self, slides, next);
    }, 
      cs.props.duration * 1000
    );
  },
Thomas Sieverding
@Bajix
Why would that be part of your zone?
Dovid Bleier
@dbleier
why would what be part of my zone?
Thomas Sieverding
@Bajix
can-wait
Also, can-wait seems kind of like a hacky approach to control flow
Dovid Bleier
@dbleier
I don't know. I just stepped into setTimeout and I see it's calling can-wait. I think I am still on donejs 0.6.0
Thomas Sieverding
@Bajix
I see
Dovid Bleier
@dbleier
I didn't choose this, seems donejs did
Thomas Sieverding
@Bajix
I don’t know enough here to give you a good answer
Dovid Bleier
@dbleier
I would be happy to use standard js setTimeout, unless someone has a better idea
thanks for trying
Kevin Phillips
@phillipskevin
can you try wrapping that code so it won’t run on the server?
if (System.isPlatform(‘window’)) { … }
Dovid Bleier
@dbleier
what do you mean? I am not using can-ssr, I am running in the browser on a simple python http server with development.html
Kevin Phillips
@phillipskevin
oh
I didn’t think setTimeout would be overridden on the client
Dovid Bleier
@dbleier
but it seems to be.
when I stepped into setTimeout I got
        return new Override(g, "setTimeout", function(setTimeout){
            return function(fn, timeout){
                var callback = waitWithinRequest(function(){
                    delete request.ids[id];
                    return fn.apply(this, arguments);
                });
                var timeoutId = setTimeout.call(this, callback, timeout);
                var id = timeoutId;
                if(isNode) {
                    id = timeoutId.__timeoutId = globalTimeoutId++;
                }
                request.ids[id] = timeoutId;
                return timeoutId;
            }
        });
Kevin Phillips
@phillipskevin
maybe @matthewp can weigh in
Matthew Phillips
@matthewp
Yeah, if you are recursively calling setTimeout you will want to ignore that
you can do var ignore = require('can-wait/ignore')
which allows you to wrap some code you want to run outside of the zone
var fn = ignore(function() { setTimeout(function{ .... } } )
fn(); // You'll get the real setTimeout
Thomas Sieverding
@Bajix
@matthewp What is can-wait being used for? Compatibility layer for SSR?
Matthew Phillips
@matthewp
Yes, it is how we know when rendering is complete on the server
Thomas Sieverding
@Bajix
I was under the impression that only deferreds mattered
Matthew Phillips
@matthewp
In 0.5.0 we forced you to do this.attr("@root").waitFor(deferred)
but in 0.6.0 we added can-wait
which prevents the need for that
Thomas Sieverding
@Bajix
So you’re hijacking timers & promises instead of doing a root level Promise.all