Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 04 22:03
    chasenlehara opened #5440
  • Dec 04 22:03
    chasenlehara labeled #5440
  • Dec 04 19:18
    cherifGsoul review_requested #5432
  • Dec 04 14:09
    m-ahmadi starred canjs/canjs
  • Dec 04 10:52
    ansyeow starred canjs/canjs
  • Dec 03 14:53
    matthewp commented #5439
  • Dec 03 14:30
    frank-dspeed opened #5439
  • Dec 02 18:13
    greenkeeper[bot] commented #5392
  • Dec 02 18:13

    greenkeeper[bot] on core-js-3.4.7

    chore(package): update core-js … (compare)

  • Dec 02 17:48
    greenkeeper[bot] commented #5392
  • Dec 02 17:48

    greenkeeper[bot] on core-js-3.4.6

    chore(package): update core-js … (compare)

  • Dec 02 15:38
    phillipskevin commented #5438
  • Dec 02 15:38
    phillipskevin closed #5438
  • Dec 02 15:38
    phillipskevin commented #5438
  • Dec 01 23:28
    justinbmeyer commented #5438
  • Dec 01 23:06
    justinbmeyer commented #5438
  • Dec 01 23:06
    justinbmeyer commented #5438
  • Dec 01 23:04
    justinbmeyer edited #5438
  • Dec 01 23:03
    justinbmeyer opened #5438
  • Nov 29 15:01
    cherifGsoul synchronize #5432
Nico R.
@nriesco
I even tried using try/catch if (data instanceof DefineList)
Nico R.
@nriesco
I think is the server side rendering that is failing
Nico R.
@nriesco
this only affects the initial load, I thought I had a way to sort data after loading, but that seems to be a big splinter left to remove
Nico R.
@nriesco
It seems to me that there must be a condition where I should not sort, something like if (data instanceof DefineList) data.sort(sorter) so I don’t sort when some criteria is not met. The thing is that not even try/catch will stop it from failling so I really need to know in advance what to verify.
or data.isSortable or DefineList.isSortable(data)
Ranjan Subbiah
@ranjanbuilds

hey all, I'm using can-fixture ike this:

let randoProgress = chance.pickone(['exploration', 'design', 'construction', 'lighting', 'expansion']);
let stagesResponse = {
    stages: {
        progress: randoProgress
    },
    success: 1
}

Fixture('GET /json/internet/get_town_stages', function() {
    return stagesResponse;
});

And then I do some testing. But at some point I need to modify stagesReponse and test. What's the best way to do this?

Kevin Phillips
@phillipskevin
can't you just modify it?
is there some reason that won't work? or are you just wondering if that's the best approach?
Ranjan Subbiah
@ranjanbuilds
yeah, tried that and it was throwing an error, but I am realizing it might have more to do with chai as promised.
but also, yeah, is it the best way? Or should I be using https://canjs.com/doc/can-fixture.requestHandler.html. Was curious as to how to mock fail response.
Kevin Phillips
@phillipskevin
I think either way is fine
https://canjs.com/doc/can-fixture.response.html has some examples of how to mock failures
Matthew Phillips
@matthewp
https://www.bitovi.com/blog/donejs-2.0 DoneJS 2.0 is out everyone!
Jeroen Cornelissen
@jeroencornelissen
Having a routing issue where my route changes from /#!&page=admin&subpage=settings to /#!admin/settings, immidiatly but you can see it flicker.
When I do history.back() it changes back to /#!&page=admin&subpage=settings and stays like this.
Registered routes:
route.register('{page}/{subpage}');
route.register('{page}/{subpage}/{itemId}’);
Justin Meyer
@justinbmeyer
@pYr0x good one .... yes we canJS!
@jeroencornelissen this is with 4.0?
what does your setup look like?
I updated the chat guide to a "better" setup
but the old 3.0 setup should work
Jeroen Cornelissen
@jeroencornelissen

@justinbmeyer Yes, 4.0. My setup is simular to bitballs, with a stache helper that renders a can-import dynamically.
In main.js:

route.data = routing;
route.register('{page}/{subpage}');
route.register('{page}/{subpage}/{itemId}');
route.start();

routing.js:

const Routing = DefineMap.extend('Routing', {
  page: { type: 'string', default: 'tickets' },
  subpage: { type: 'string', default: 'list' },
  itemId: { type: 'string' },
  get pageConfig() {
    if (pageConfigs[this.page] === undefined) {
      this.update({ subpage: 'list', page: 'tickets' }); // default route
      return pageConfigs[this.page];
    } else if (this.page.toLowerCase() === 'tickets') {
      return pageConfigs[this.page];
    } else { // admin
      let pageConfig = pageConfigs[this.page][this.subpage];
      if (pageConfig === undefined) {
        this.subpage = 'settings’; // default admin route
        return pageConfigs[this.page][this.subpage];
      }
      return pageConfig;
    }
  }
});

With possible routes to:
#!/admin/settings
#!/admin/priviliges
#!/tickets/list
#!/tickets/list/{Filter.id}
#!/tickets/detail/{Ticket.id}
...

Justin Meyer
@justinbmeyer
Cool stuff from Chris ... https://forums.donejs.com/t/improving-initial-render-performance-with-can-defer/817 <-- delays expensive component rendering!
oh, you probably don't want to be calling .update() and instead want to use the defaults in .register("...", defaults)
@jeroencornelissen
Jeroen Cornelissen
@jeroencornelissen
Thx, @justinbmeyer. You’re right .update() wasn’t a good idea :clap:
Jeroen Cornelissen
@jeroencornelissen
@justinbmeyer Hmm, I removed the routeUrl helper in my stache also and did the route directly <a href="#!/admin/settings”> and that solved the issue.
When I do: {{routeUrl(page='admin' subpage='settings')}} the route flickers from #!&page=admin&subpage=settings to #!&page=admin&subpage=settings.
Justin Meyer
@justinbmeyer
@jeroencornelissen aren't those identical?
btw, if you are in 4.0, you can can.queues.log("flush") and see the route updates happen
Justin Meyer
@justinbmeyer
@/all We are about to discuss the survey proposals: https://www.youtube.com/watch?v=EEBytcIX7oA
Jeroen Cornelissen
@jeroencornelissen
@justinbmeyer sorry I meant from ... to #!admin/settings.
Jared Stehler
@jaredstehler
Anyone have tips on troubleshooting stache timeout errors?
Potentially unhandled rejection [4] Error: Timeout of 5000 exceeded at eval (http://localhost:8082/src/index.stache:247:17) at eval (http://localhost:8082/node_modules/can-zone/lib/tasks.js:149:15) at Task.run (http://localhost:8082/node_modules/can-zone/lib/zone.js:41:17) at Zone.runTask (http://localhost:8082/node_modules/can-zone/lib/zone.js:183:14)
then a bunch of
this is the line in datastream-app.control.js: instances: { get: function get(prevVal, resolver) { DataStreamAppInstance.getList({ artifact: this.app.artifact, ts: this.updateTs }).then(function (data) { // setTimeout($.proxy(this.updateData, this), 10000); resolver(data); }); } },
but i see that the http request is completing in 900ms
Kevin Phillips
@phillipskevin
take a look at https://www.youtube.com/watch?v=8cWPZM8fiOQ, @jaredstehler
Jared Stehler
@jaredstehler
thanks!
Jared Stehler
@jaredstehler
any best practices on "polling" and updating lists of superMaps? I'm currently doing what feels hacky:
export const ViewModel = DefineMap.extend({

  title: {
    get() {
      return 'Recent Deploys';
    }
  },

  updateTime: 'number',

  deploys: {
    get(prevVal, resolver) {
      if(this.updateTime) {
        var params = route.data.serialize();
        params.ts = this.updateTime;

        Deploy.getList(params).then((d) => {
          setTimeout($.proxy(this.update, this), 30000);
          resolver(d);
        });
      }
      else {
        resolver(null);
      }
    }
  },

  update() {
    this.updateTime = new Date().getTime();
  }

});

export default Component.extend({
  tag: 'deploy-list',
  ViewModel,
  events: {
    inserted() {
      this.viewModel.update();
    }
  },
  view
});
it also causes the whole list to flicker each update
and I think that it might have been causing or contributing to my zone render timeout issues..
andre-cgn
@andre-cgn
hey guys. i've got a stache.addHelper related question. anyone around who might be able to help?
I've got a repository with just one can component and a helper to go with it. both written in es6 style and transpiled with babel. i import that package via es6 import in my main project (that project is built via browserify + babelify). i would expect my stache view helper to also be available to all components and templates in my core repository - even though that helper is registered by the imported module with my simple can-component
it doesnt work though
i added stache to get window object for debugging purposes. when i get window.stahce-getHelper('myhelper'), it does return a function
but i still get warnings in the console that stache cannot find the myhelper helper
is there any good way around this
Mohamed Cherif Bouchelaghem
@cherifGsoul
@andre-cgn how did you register the helper? in the componet helpers object or with stache.registerHelper ?
Kevin Phillips
@phillipskevin
@andre-cgn do you have multiple versions of stache?