Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:38
    greenkeeper[bot] labeled #5442
  • 15:38
    greenkeeper[bot] opened #5442
  • 15:38

    greenkeeper[bot] on can-view-live-5.0.1

    fix(package): update can-view-l… (compare)

  • Dec 08 21:21
    greenkeeper[bot] commented #5392
  • Dec 08 21:21

    greenkeeper[bot] on core-js-3.4.8

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

  • Dec 06 18:40
    cherifGsoul review_requested #5441
  • Dec 06 18:39
    cherifGsoul opened #5441
  • Dec 06 18:22

    cherifGsoul on update-infrastructure-page

    Update infrastructure page with… (compare)

  • Dec 06 18:14
    greenkeeper[bot] commented #5422
  • Dec 06 18:14

    greenkeeper[bot] on @feathersjs

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

  • Dec 06 18:11
    greenkeeper[bot] commented #5401
  • Dec 06 18:11

    greenkeeper[bot] on @feathersjs

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

  • 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
apsignifi
@apsignifi
can4 - changing call expression syntax.
would {{#each .}} change to {{#each(.)}} ?
Kevin Phillips
@phillipskevin
yeah, or {{#each(this)}}
either works
apsignifi
@apsignifi
@phillipskevin Thanks.
can4 : is this valid ?
{{^if(../../action)}}
Virendra Kumar
@virendrak-dev
@phillipskevin please help me for the issue related with inserted event in single page component.
Kevin Phillips
@phillipskevin
@apsignifi that is valid, yes
you can do {{scope.log()}} to see what the scope looks like
@virendrak-dev what is the issue?
Virendra Kumar
@virendrak-dev
in Can2 we use inerted event
events: {
"inserted": function() {
this.viewModel.initDatePicker();
this.viewModel.initTimePicker();
}
}
then how we can use this event in .component file
?
I have a jquery datepicker plugin and I want to initialize in .component file
image.png
apsignifi
@apsignifi

@phillipskevin : Thanks.

@apsignifi that is valid, yes

Virendra Kumar
@virendrak-dev
above is the screenshot of code and it doesn't work, how I can call the initDatePicker() in inserted event?
above syntax for inerted event does'nt work.
Kevin Phillips
@phillipskevin
<script type="events">
        export default {
            click: function(){
                this.viewModel.attr("visible", !this.viewModel.attr("visible"))
            }
        };
</script>
that's how you do events in a .component
https://github.com/donejs/done-component is the best place to find out about .componentfiles
Virendra Kumar
@virendrak-dev
nice! it works. Thanks you so much @phillipskevin .
Kevin Phillips
@phillipskevin
you're welcome
apsignifi
@apsignifi

can4 : I have a helper :

stache.registerHelper('isActive', function(value, level, options) {

    if (typeof value == 'function') {
        value = value();
    }

    var context = options.scope.get(level);

   // if there is no current active panel (there isnt one on initialize) then we set the first loaded panel to active

    if (context.active_panel === null || typeof context.active_panel == 'undefined' ) {
        context.active_panel = value ;
    }

    if (context.active_panel === value ) { 
        return options.fn(context);
    } 
    else {
        return options.inverse(context);
    }

});

from migration perspective, do I need to change from
{{#isActive scope.index '../'}} to {{#isActive(scope.index, '../')}}
?

Chasen Le Hara
@chasenlehara
@apsignifi I think this part of the migration guide helps clarify that https://canjs.com/doc/migrate-4.html
The exception is built-in helpers or Helper Expressions (when called with >=1 argument). This is so that many changes for helpers like {{#each items}} or {{#eq value1 value2}} do not hinder upgradability.
BTW, sorry we haven’t been as responsive on here, there’s way more people hanging out in the Slack: https://bitovi.com/community/slack
apsignifi
@apsignifi
@chasenlehara : thanks, I have joined our slack channel as well.
Chasen Le Hara
@chasenlehara
Our next online meetup is going to be on Thursday, March 21st! Register here and check out the videos from our last meetup: https://www.bitovi.com/blog/save-the-date-march-21st-for-our-next-online-meetup-and-videos-from-februarys-meetup
Paul Moscuzza
@pmoscuzza-tc
Hello, I am trying to upgrade our codebase to canjs 3 from 2. I am running into a problem with rendering our old existing ejs templates. Most of our ejs templates use can.view.render to render pieces of the template. Since can.view.render is not supported in canjs 3 I created a can.view.render shiv that returns a deferred object containing the template we are trying to insert. However when I insert this imported template into the parent ejs template using ejs syntax (<%== can.view.render(template,data) %>), I just get [Object object] instead of the actual template. Is there any way I can overcome this problem?
Paul Tichonczuk
@tracer99
@phillipskevin or @chasenlehara any help with the above?
Chasen Le Hara
@chasenlehara
@pmoscuzza-tc Would you mind posting your question to the Slack please? https://bitovi.com/community/slack
I’m not very familiar with EJS and Justin can probably answer your question fairly quickly.
I don’t think anyone else is still watching this Gitter actively. :)
@pmoscuzza-tc When you post in Slack, it might be helpful to share what your shiv looks like.
Paul Moscuzza
@pmoscuzza-tc
*shim :P
Chasen Le Hara
@chasenlehara
Oops, yeah, not a shiv… 🙈
Manuel Mujica
@m-mujica
hello, is there any guide about setting up fixtures? Not sure what's the latest recommended way to do that?
nickmingneau
@nickmingneau
Hi, I was wondering if there was a list of breaking changes between 5.16 and the latest version because I'm unable to upgrade due to random stuff breaking. For example ../ in stache doesn't work anymore, and some elements that were defined in my project at can 5.16 are undefined now.
Chasen Le Hara
@chasenlehara
@nickmingneau There shouldn’t be any breaking changes. Can you duplicate the issue in a CodePen? https://codepen.io/bitovi/pen/pYwJao/?editors=1000
Also, btw, everyone’s moved to Slack, so you’ll get faster responses there :D https://bitovi.com/community/slack
AntonProkofyev
@AntonProkofyev

Hi all, i'm trying to migrate from canjs 3 to 4 and get new warning
... Unable to find key "someList.length".
in js i have something like this:

someListPromise: {
        get() {
            if (this.id) {
                return SomeMap.getList({ id: this.id });
            }
            return Promise.resolve([]);
        }
    },
    someList: {
        type: [SomeMap],
        get(last, resolve) {
            return this.someListPromise.then(resolve).catch(() => {});
        },
        default: []
    }

and in stache :

{{#if (someListPromise.isResolved)}} 
        {{#if(someList.length)}} ...
AntonProkofyev
@AntonProkofyev
the code is still working but i'm getting this warning.
if i'm changing stache to
{{#if(someList['length'])}}
the warning is disappear but i'm not sure if it's right to do this. any workaround?
Volha Manko
@volha_manko_gitlab
Hello, did anyone try to use css modules adding classes in stache?
AntonProkofyev
@AntonProkofyev
And one more question. As helpers is deprecated in 4.0 for components how can i move such helpers to wm
customHelper(options) {
        if (this.foo && this.bar) {
            return options.fn();
        }
        return options.inverse();
    }
Chasen Le Hara
@chasenlehara
Hi @AntonProkofyev, everyone’s moved to our Slack, so you’ll get faster responses there in the future: https://bitovi.com/community/slack
Re: your question about someList, you’re returning a Promise from the getter, which is why stache tells you there’s no length property
Remove return from the someList getter and you should be good to go.
Chasen Le Hara
@chasenlehara
Re: your question about helpers, these docs should help: https://canjs.com/doc/can-stache.html#Creatinghelpers
If you change customHelper to either a global helper or call expression, you can write #if(customHelper()) and remove the options.fn/inverse code from the helper