These are chat archives for canjs/canjs

8th
Apr 2018
Viktor Busko
@Lighttree
Apr 08 2018 16:42

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
Apr 08 2018 16:42
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
Apr 08 2018 16:42
@eben-roux Is it CanJS 3 or 4 ?
Eben
@eben-roux
Apr 08 2018 17:04
hi, that is canjs 4
Viktor Busko
@Lighttree
Apr 08 2018 18:19
@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
Apr 08 2018 18:23
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
Apr 08 2018 18:35
@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
Apr 08 2018 18:40
@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
Apr 08 2018 18:41
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
Apr 08 2018 19:19
canjs/canjs#4100
Justin Meyer
@justinbmeyer
Apr 08 2018 19:26
thanks
Viktor Busko
@Lighttree
Apr 08 2018 19:26
np
henst922
@henst922
Apr 08 2018 20:57
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
Apr 08 2018 23:39

@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