Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 14 21:13
    greenkeeper[bot] labeled #5378
  • Oct 14 21:12
    greenkeeper[bot] opened #5378
  • Oct 14 21:12

    greenkeeper[bot] on can-simple-map-4.3.3

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

  • Oct 14 20:19
    greenkeeper[bot] labeled #5377
  • Oct 14 20:19
    greenkeeper[bot] opened #5377
  • Oct 14 20:19

    greenkeeper[bot] on @feathersjs

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

  • Oct 14 20:18
    greenkeeper[bot] labeled #5376
  • Oct 14 20:18
    greenkeeper[bot] opened #5376
  • Oct 14 20:18

    greenkeeper[bot] on @feathersjs

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

  • Oct 14 14:43
    greenkeeper[bot] closed #5373
  • Oct 14 14:43

    greenkeeper[bot] on can-deep-observable-1.0.1

    (compare)

  • Oct 14 14:42

    m-mujica on update-deep-observable

    (compare)

  • Oct 14 14:42

    m-mujica on master

    Update can-deep-observable to l… Merge pull request #5374 from c… (compare)

  • Oct 14 14:42
    m-mujica closed #5374
  • Oct 14 14:42
    m-mujica closed #5365
  • Oct 14 14:09
    f-ricci starred canjs/canjs
  • Oct 14 13:55
    greenkeeper[bot] commented #5375
  • Oct 14 13:55

    greenkeeper[bot] on core-js-3.3.2

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

  • Oct 14 10:51
    m-mujica review_requested #5374
  • Oct 14 07:43
    rjgotten commented #5358
Chasen Le Hara
@chasenlehara
I think IE 11 has basic support for Map, so a polyfill shouldn’t be required for it.
Pestdoktor
@Pestdoktor
here's the error on a fresh 'donejs add app' + babel-polyfill:
Eben
@eben-roux
hello, I'm trying to add some bootstrap javascript when a component is inserted but the "inserted" event doesn't seem to fire
any advice on the best way to pick up when a component is added to the DOM?
Pestdoktor
@Pestdoktor
are you using canjs 4?
The inserted and removed events, most commonly used in can-components are no longer included.
Eben
@eben-roux
thought as much... thanks, I'll have a look
thanks a stack... that did the trick
Eben
@eben-roux
do you know how I would get the viewModel in that method?
pffft... nevermind
"this"
Chasen Le Hara
@chasenlehara
@Pestdoktor Is that with the Map polyfill? Does it work without it?
Pestdoktor
@Pestdoktor
without any polyfill it complains about missing assign method: https://hastebin.com/raw/oricomajak
Justin Meyer
@justinbmeyer
@Lighttree I think something like Context API is a foot-gun ... it makes things simple at first, but difficult to reuse and test later.
I think it's better to at least pass the "global" state ... you can always do: <sub-component state:from="this"> where this is your global state. By passing, you at least allow someone to pass a different state value.
Justin Meyer
@justinbmeyer
I've also thought about supporting object (or hash) so you can select what actually gets put into state:
<sub-component state:from="{propA, probB: valB}">
Justin Meyer
@justinbmeyer
canjs/can-stache#505
Viktor Busko
@Lighttree

Hi @Lighttree, we’re only testing CanJS 4 in Edge and not IE 11.
You can see what the test suite runs here: https://github.com/canjs/canjs#canjs
We’re open to adding support for IE11, it just hasn’t been a priority because none of our projects have required it and this is the first time it’s come up. 🙂

@chasenlehara In this case what is current browser support for CanJS ? Is it valid to create bugs for IE11? I'm not sure in which project create it, because I wasn't able figure out the reason of such behavior.

Eben
@eben-roux
I'm trying to bind a method to a component attribute like so: click:from="@scope@root@edit(.)" and I've tried quite a few variants but it just doesn't seem to be passed. Any ideas?
Viktor Busko
@Lighttree
@eben-roux Is it CanJS 3 or 4 ?
Eben
@eben-roux
hi, that is canjs 4
Viktor Busko
@Lighttree
@eben-roux there is changes in how you pass methods to components. https://www.bitovi.com/blog/canjs-4.0#simplified-stache
Eben
@eben-roux
if I use on:click="scope.root.edit(.)" directly on, say, a <div> it works fine, but I need to pass that to my component and I don't seem to be able to do that
the component would then call the passed method
Justin Meyer
@justinbmeyer
@roemhildtg looks great!
@Lighttree yes, it's totally valid. We want to support IE11 (except for can-observe). We just didn't want to be weighed down by it for release. Our goal will probably to support IE11 given certain polyfills people should include.
@eben-roux ... I'm confused ... your original example had click:from ... is that a mistake? Should it be on:click? What do you mean "bind a method to a component"? Do you mean that this isn't right in edit? If that's true, that's a bug.
I'm confused because you're talking about "passing" AND showing listening to a click.
Viktor Busko
@Lighttree
@justinbmeyer well, yeah I think that It should work with polyfills and it works for CanJS 3. But in 4th it works different. Where I can rise the bug ?
Here is stacktrace for the issue that I refer to:
https://hastebin.com/raw/qesivazazo
These undefined looks weird.
Justin Meyer
@justinbmeyer
you can file them in canjs/canjs: https://github.com/canjs/canjs/issues/new
I know there's certain things IE11's map does not support ... we can probably avoid all of them.
Viktor Busko
@Lighttree
canjs/canjs#4100
Justin Meyer
@justinbmeyer
thanks
Viktor Busko
@Lighttree
np
henst922
@henst922
Hi! Is there something similar to this https://www.npmjs.com/package/react-router-modal to handle routing to a modal with canjs?
Justin Meyer
@justinbmeyer

@henst922 CanJS has a two-way routing system, so it wouldn't match specific urls. Though you can match certain state.

This JSBin shows how to create a generic modal: http://jsbin.com/misigo/edit?html,js,output

can.Component.extend({
    tag: "my-modal",
    view: `
          <div class='background'></div>
          <div class='modal-container'>
            <h3>{{title}}</h3>
            <div class='modal-contents'><content></content></div>
          </div>`
});
With CanJS, you would have something like:
{{#if( routeCurrent(page='todos') ) }}
  <my-modal title:raw="Wanna Save?">
      CONTENT FOR YOUR MODAL
  </my-modal>
{{/if}}
basically, if your route data's state matches page=todos ... it will render the modal
@henst922 canjs's routing system is quite a bit different from other routing systems. It's worth reading up on: https://canjs.com/doc/guides/technology-overview.html#Observablesandthebrowser_slocation
Eben
@eben-roux
@justinbmeyer : I'll put together a jsbin example just to ensure I'm not doing something odd. I want to use a method on my view model within a component that is rendered in an {{#each}}. I therefore need to get to the scope.root.mymethod as I understand. The component has to call the method that is bound by rendering the on:click to the method: something like:
{{#each(subObjects)}}
   <my-component click:from="scope.root.the-method-on-the-main-viewmodel" />
{{/each}}
Justin Meyer
@justinbmeyer
@eben-roux , so you are setting click on my-component's VM to that method
I think there might be a bug because I think that methods are supposed to be auto bound
Eben
@eben-roux
@justinbmeyer I think I missed the whole function binding boat :) --- having a look now on a jsbin
Justin Meyer
@justinbmeyer
I would call the click property something else. It's a bit confusing. Maybe clickCallback
This should work though:
<my-comp clickCallback:from="scope.root.method.bind(scope.root)">
it's possible that scope.root.X isn't being auto-bound. This happens in can-key-tree cc @phillipskevin