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)

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
Matthew Phillips
@matthewp
we're hijacking async code so that we are aware of when it happens
so you don't have to manually tell us all of your deferreds
Thomas Sieverding
@Bajix
That has unintended consequences though
Matthew Phillips
@matthewp
what are those consequences?
Thomas Sieverding
@Bajix
For example, when I worked at Pluto, we would use promises both in our A/B testing flow, and for wrapping modal life cycles to do complex chaining
I can think of dozens of cases in which we’ve used promises & timers in which we wouldn’t want those to prevent SSR
Matthew Phillips
@matthewp
You were using promises that didn't result in the UI changing?
That is the purpose, to know when rendering is complete
Thomas Sieverding
@Bajix
I suppose we could have disabled those modals if we were rendering server side