Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 17:25
    matthewp edited #5384
  • 17:00

    matthewp on can-dom-mutate-2.0.7

    (compare)

  • 17:00

    matthewp on master

    fix(package): update can-dom-mu… Merge pull request #5386 from c… (compare)

  • 17:00
    matthewp closed #5386
  • 16:27
    greenkeeper[bot] labeled #5386
  • 16:27
    greenkeeper[bot] opened #5386
  • 16:27

    greenkeeper[bot] on can-dom-mutate-2.0.7

    fix(package): update can-dom-mu… (compare)

  • 16:25

    matthewp on can-dom-mutate-2.0.6

    (compare)

  • 16:24
    matthewp closed #5379
  • 16:24
    matthewp commented #5379
  • 15:26

    greenkeeper[bot] on can-type-1.1.2

    (compare)

  • 15:26

    matthewp on master

    fix(package): update can-type t… Merge pull request #5385 from c… (compare)

  • 15:26
    matthewp closed #5385
  • 14:11
    matthewp closed #5377
  • 14:11
    matthewp closed #5376
  • 14:11
    matthewp closed #5375
  • 14:07
    greenkeeper[bot] labeled #5385
  • 14:07
    greenkeeper[bot] opened #5385
  • 14:07

    greenkeeper[bot] on can-type-1.1.2

    fix(package): update can-type t… (compare)

  • Oct 16 20:07
    matthewp commented #5384
Chasen Le Hara
@chasenlehara
You can see what the test suite runs here: https://github.com/canjs/canjs#canjs
Chasen Le Hara
@chasenlehara
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. 🙂
What’s throwing the Incompatible receiver, map required! error?
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