These are chat archives for canjs/canjs

29th
Nov 2016
Thomas Sieverding
@Bajix
Nov 29 2016 14:52
Is there an alternative to done-autorender that’s ready for 3.0?
Kevin Phillips
@phillipskevin
Nov 29 2016 15:03
there is http://v3.canjs.com/doc/can-view-autorender.html, but it doesn’t do exactly what done-autorender does
is done-autorender not working with 3.0?
Thomas Sieverding
@Bajix
Nov 29 2016 15:04
It looks like a 3.0 version simply was never released, though there’s a candidate
Kevin Phillips
@phillipskevin
Nov 29 2016 15:04
yeah, I see a branch, but I don’t think there was a pre-release
the branch is pretty old though, so not sure how well it will work
Thomas Sieverding
@Bajix
Nov 29 2016 15:05
Sighs… this is a frustrating thing to get caught up on when trying to roll out an upgrade
Kevin Phillips
@phillipskevin
Nov 29 2016 15:07
if you want to check if that branch works for you, we can put out a pre-release
Thomas Sieverding
@Bajix
Nov 29 2016 15:07
It’d be nice to have a version of autorender w/ up to date deps for 3.0
Even if that’s a pre-release
Thomas Sieverding
@Bajix
Nov 29 2016 15:49
I’m getting the error for done-autorender@0.9.0-pre.1:
the appState is available as the html viewModel 1) got the appstate
Kevin Phillips
@phillipskevin
Nov 29 2016 15:52
when running the tests?
Thomas Sieverding
@Bajix
Nov 29 2016 15:52
Yep
Kevin Phillips
@phillipskevin
Nov 29 2016 15:55
I think it needs to import can-jquery now
in order to get $.fn.viewModel
Thomas Sieverding
@Bajix
Nov 29 2016 16:02
        var AppViewModel = require("test/basics/state");
        var canViewModel = require("can-view-model");

        var vm = canViewModel(document.documentElement);

        if(window.QUnit) {
            QUnit.ok(vm instanceof AppViewModel, "got the appstate");
            removeMyself();
        } else {
            console.log("Got viewModel", vm);
        }
That breaks
AppViewModel uses can-map, maybe that’s the issue?
That uses can-simple-map
So possibly failed instanceof
Kevin Phillips
@phillipskevin
Nov 29 2016 16:04
it should use types.DefaultMap
if it exists
which should be set to can-map by can-map
Thomas Sieverding
@Bajix
Nov 29 2016 16:06
Actually it should use that specific constructor now that I’m looking at it
So this behavior is in fact broken =/
Viktor Busko
@Lighttree
Nov 29 2016 16:24

Maybe someone know is there a way to call makeActive when something happens outside of tabs component ?

https://github.com/bitovi-components/bit-tabs/blob/master/src/unstyled.js#L63

for example I need make correct tab active depends on data from upper component.

Kevin Phillips
@phillipskevin
Nov 29 2016 16:31
you could export it from the component
check out the “Exporting Functions” section of http://v3.canjs.com/doc/can-stache-bindings.toParent.html
Viktor Busko
@Lighttree
Nov 29 2016 16:33
yeah, I think this might help, thanks
Kevin Phillips
@phillipskevin
Nov 29 2016 16:33
:thumbsup:
Kevin Phillips
@phillipskevin
Nov 29 2016 17:30
@Bajix I checked a can3 donejs project I have and it’s working with done-autorender@0.9.0-pre.1
Thomas Sieverding
@Bajix
Nov 29 2016 17:31
Hmmm ok I’ll look into it further; it’s just terrifying have a app rewrite mid-progress and running into potential compatibility snags
In any case, auto-render should be updated to pass the viewModel test
Kevin Phillips
@phillipskevin
Nov 29 2016 17:32
I agree
canViewModel(‘html’) instanceof DefineMap returns true in my app
Thomas Sieverding
@Bajix
Nov 29 2016 17:33
@phillipskevin Does your routing work as expected? My chief concern being that this test breaking affects routing
I see; that much makes sense however it should be an instance of your App constructor
Can you confirm that instanceof check works with whatever you’ve passed into as the view model for autorender
Kevin Phillips
@phillipskevin
Nov 29 2016 17:34
it is
Thomas Sieverding
@Bajix
Nov 29 2016 17:34
;o
Kevin Phillips
@phillipskevin
Nov 29 2016 17:35
canViewModel(‘html’) instanceof AppViewModel
is true
Thomas Sieverding
@Bajix
Nov 29 2016 17:35
Strange that the test would fail on 0.9.0
That helps at least, thanks
Kevin Phillips
@phillipskevin
Nov 29 2016 17:36
no problem