Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:34

    chasenlehara on 5119-testing-guide

    Update the Testing guide for Ca… (compare)

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

    cherifGsoul on update-theme-new-buttons

    Theme pre-release 2 (compare)

  • 10:29

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

    (compare)

  • 10:26

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

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

  • 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
  • Sep 19 18:39

    phillipskevin on overview-svg

    (compare)

  • Sep 19 18:39

    phillipskevin on major

    fixing svg on technology overvi… Merge pull request #5301 from c… (compare)

  • Sep 19 18:39
    phillipskevin closed #5301
  • Sep 19 18:32
    phillipskevin opened #5301
  • Sep 19 18:31

    phillipskevin on overview-svg

    fixing svg on technology overvi… (compare)

  • Sep 19 18:10

    phillipskevin on overview-svg

    (compare)

  • Sep 19 16:40
    phillipskevin labeled #5300
  • Sep 19 16:40
    phillipskevin opened #5300
  • Sep 19 15:16
    m-mujica edited #5119
  • Sep 19 14:59
    m-mujica edited #5119
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
It would result in UI changing, however there would be a sizable delay
Matthew Phillips
@matthewp
Yes, you can selectively render stuff of course
use helpers to only render certain parts in the client
Thomas Sieverding
@Bajix
can-wait always gets loaded?
Matthew Phillips
@matthewp
it's used by done-autorender