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
Gregg Roemhildt
@roemhildtg
There's a bit of manual stuff involved with the scope changes
Kevin Phillips
@phillipskevin
if you want to write a codemod, that would be awesome
ah, yeah
Gregg Roemhildt
@roemhildtg
Not sure how I'd code mod that. There's lots of odd cases where you want to keep the scope.vm.stuff
like can-template
Gregg Roemhildt
@roemhildtg
What about this situation? I actually want the "this" value to become the value of toast, because my child renderer template expects that.
<can-import from="spectre-canjs/sp-toast/sp-toast.stache" value:to="scope.vars.toast" />
<div class="toasts">
    {{#for(toast of toasts)}}
        {{#with(toast)}}
        {{>scope.vars.toast}}
        {{/with}}
    {{/for}}
</div>
Is there a better way to do that?
Gregg Roemhildt
@roemhildtg
Thanks @phillipskevin That did fix the issue I was having
I'm also seeing another error in can-view-nodelist
    replace: function (oldElements, newFrag) {
        // The following helps make sure that a selected <option> remains
        // the same by removing `selected` from the currently selected option
        // and adding selected to an option that has the same value.
        var selectedValue,
            parentNode = oldElements[0].parentNode;

        if(parentNode.nodeName.toUpperCase()
The error is because "parentNode" is undefined
Gregg Roemhildt
@roemhildtg
Got any ideas on that one? The oldElements array just contains a text node that is empty.
Gregg Roemhildt
@roemhildtg
Error is occuring in an if statement when a value gets set:
{{#if(projectsPromise.isPending)}}
    <div class="loading"></div>
{{else}}
    <dl-autocomplete 
        options:from="autoCompleteOptions"
        on:value="setSelectedSearch(scope.arguments.0.0)"></dl-autocomplete>

    {{#if(selectedProject)}}
        Error occurs here when selectedProject gets set
    {{/if}}

{{/if}}
Kevin Phillips
@phillipskevin
is that the top-level of the template?
Gregg Roemhildt
@roemhildtg
Yes
Kevin Phillips
@phillipskevin
if you wrap it in a <div> does the error go away?
might be related to canjs/can-stache#202
Gregg Roemhildt
@roemhildtg
Nope. Still happens
Kevin Phillips
@phillipskevin
what is oldElements[0]?
Gregg Roemhildt
@roemhildtg
image.png
A bit up the call stack
image.png
Kevin Phillips
@phillipskevin
what if you wrap Error occurs here when selectedProject gets set in an element?
Gregg Roemhildt
@roemhildtg
Nope
Kevin Phillips
@phillipskevin
ok, if you can reproduce it in a codepen I can take a look
later tonight / tomorrow morning
Gregg Roemhildt
@roemhildtg
Is there a canjs symbol for something like "can.forEach"?
Kevin Phillips
@phillipskevin
there is CanSymbol.iterator
Gregg Roemhildt
@roemhildtg
If I add that, it'll call that function in stache for of ?
Kevin Phillips
@phillipskevin
you're trying to create your own observable you mean?
Gregg Roemhildt
@roemhildtg
Correct. Its kind of like an array...it has a toArray method, and a length property but its not like a normal array where you can do array[0]. So I thought I'd build an iterator function
Kevin Phillips
@phillipskevin
you would need more symbols than that
definitely isObservableLike and isListLike
not sure what else
Andrei Balmus
@abalmush
Hi guys, does anyone has experience with intergating Jest in canjs app?
Gregg Roemhildt
@roemhildtg
I've done this @abalmush
Jest works super well testing view models
Andrei Balmus
@abalmush
@roemhildtg do you have an example especially how to configure it
I have quite old project with canjs 2.3 )
Gregg Roemhildt
@roemhildtg
Weeeeelll, I haven't really needed to configure anything with Jest. That being said I'm writing stuff in es6 now so everything just works.
I'm also using canjs 5
Andrei Balmus
@abalmush
and I tried to get it to work, looks like the instance of canjs inside Component is differetn and I see warning somethig saying that this component is not registered
yeah with Canjs5 should work pretty well
Gregg Roemhildt
@roemhildtg
Ah, so you're trying to test the components? I haven't done that yet. Just viewModel testing so far. Like logic and whatnot. Functional testing is a whole new level for me
Andrei Balmus
@abalmush
yeah yea exatly I’m trying to render it using stache and check if everything is rendered. Same way as with React component )
Gregg Roemhildt
@roemhildtg
Yeah. Its on my todo list to look into that.
Andrei Balmus
@abalmush
Please let me know if you figure it out, I’ll post a message here as well
Gregg Roemhildt
@roemhildtg
:thumbsup:
Guido Smeets
@gsmeets
I am using mocha, but the principles are the same I reckon
I've made a few helper functions to easily render a component. The only tricky part is when you have fixtures for your data, which are collected async. So you need to add some promise to your viewmodels to ensure that they're loaded. I've done that generically for all my "functional" components.