Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 14 20:01
    greenkeeper[bot] labeled #5450
  • Dec 14 20:01
    greenkeeper[bot] opened #5450
  • Dec 14 20:00

    greenkeeper[bot] on semver-7.0.0

    chore(package): update semver t… (compare)

  • Dec 14 16:58
    millette starred canjs/canjs
  • Dec 14 00:14
    greenkeeper[bot] labeled #5449
  • Dec 14 00:14
    greenkeeper[bot] opened #5449
  • Dec 14 00:14

    greenkeeper[bot] on can-super-model-2.0.0

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

  • Dec 14 00:13
    greenkeeper[bot] labeled #5448
  • Dec 14 00:13
    greenkeeper[bot] opened #5448
  • Dec 14 00:13

    greenkeeper[bot] on can-define-rest-model-2.0.0

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

  • Dec 14 00:12
    greenkeeper[bot] labeled #5447
  • Dec 14 00:12
    greenkeeper[bot] opened #5447
  • Dec 14 00:12

    greenkeeper[bot] on can-define-realtime-rest-model-2.0.0

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

  • Dec 14 00:07
    greenkeeper[bot] labeled #5446
  • Dec 14 00:07
    greenkeeper[bot] opened #5446
  • Dec 14 00:07

    greenkeeper[bot] on can-connect-ndjson-2.0.0

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

  • Dec 13 21:27

    greenkeeper[bot] on @octokit

    (compare)

  • Dec 13 21:25

    greenkeeper[bot] on @octokit

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

  • Dec 13 21:21

    greenkeeper[bot] on @octokit

    (compare)

  • Dec 13 21:20

    greenkeeper[bot] on @octokit

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

Kevin Phillips
@phillipskevin
#with does, yes
we're going to add a #let helper that can be used like #with but without creating a new scope
Gregg Roemhildt
@roemhildtg
That'll be nice and easy
Kevin Phillips
@phillipskevin
that bug you found yesterday is fixed now also: https://github.com/canjs/can-view-scope/releases/tag/v4.8.1
Gregg Roemhildt
@roemhildtg
:+1:
Sweet!
Kevin Phillips
@phillipskevin
if you haven't converted all of your templates to for...of already, you should be able to update
Gregg Roemhildt
@roemhildtg
Working on it :P
Regexpressions work pretty well
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.