Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 14 17:40
    nlundquist edited #5424
  • Nov 14 17:40
    nlundquist edited #5424
  • Nov 14 17:39
    nlundquist opened #5424
  • Nov 14 17:39
    nlundquist review_requested #5424
  • Nov 14 17:39

    nlundquist on 107-update-converter-demos

    update can-stache-converters de… (compare)

  • Nov 14 14:32
    greenkeeper[bot] labeled #5423
  • Nov 14 14:32
    greenkeeper[bot] opened #5423
  • Nov 14 14:32

    greenkeeper[bot] on can-route-5.0.1

    fix(package): update can-route … (compare)

  • Nov 13 13:09

    greenkeeper[bot] on steal-tools-2.2.3

    (compare)

  • Nov 13 12:55

    greenkeeper[bot] on steal-tools-2.2.3

    chore(package): update steal-to… (compare)

  • Nov 13 01:44

    greenkeeper[bot] on @webcomponents

    (compare)

  • Nov 13 01:42

    greenkeeper[bot] on @webcomponents

    chore(package): update @webcomp… (compare)

  • Nov 12 05:28
    greenkeeper[bot] commented #5392
  • Nov 12 05:28

    greenkeeper[bot] on core-js-3.4.1

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

  • Nov 11 18:03
    greenkeeper[bot] labeled #5422
  • Nov 11 18:03
    greenkeeper[bot] opened #5422
  • Nov 11 18:03

    greenkeeper[bot] on @feathersjs

    chore(package): update @feather… (compare)

  • Nov 11 18:02
    greenkeeper[bot] commented #5401
  • Nov 11 18:02

    greenkeeper[bot] on @feathersjs

    chore(package): update @feather… (compare)

  • Nov 10 23:39

    greenkeeper[bot] on @octokit

    (compare)

Jeroen Cornelissen
@jeroencornelissen
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?
andre-cgn
@andre-cgn
i used addHelper
nope i am using identical versions
and only bundling one
Kevin Phillips
@phillipskevin
what version are you using?
andre-cgn
@andre-cgn
can-stache 4.1.1
Kevin Phillips
@phillipskevin
how are you calling the helper?
andre-cgn
@andre-cgn
as i said, the first package only contains one can-component and a stache helper. nothing is bundled. the bundling takes place in the core package which uses the first one as a dependency
my helper is called 'translate'
Kevin Phillips
@phillipskevin
so you're calling it like {{translate("foo")}} ?
andre-cgn
@andre-cgn
exactly
Flavio Garcia
@piraz
Hello guys, when I import a template using steal-stache using
import template from "./nav.stache";
it works
but like this: