These are chat archives for canjs/canjs

13th
Aug 2016
Christopher Oliphant
@RALifeCoach
Aug 13 2016 00:33
@justinbmeyer Okay, I have read, re-read and re-read the docs for can-connect. I cannot get this to work. When I create a connection the code throws an exception. Here is my model code.
import connect from 'can-connect';
import DefineMap from 'can-define/map/map';
import DefineList from 'can-define/list/list';
import config from '../config';

import connectConstructor from 'can-connect/constructor/';
import connectMap from 'can-connect/can/map/';
import connectDataParse from 'can-connect/data/parse/';


const Player = DefineMap.extend({
    playerId: {
        type: 'string',
        value: ''
    },
    name: {
        type: 'string',
        value: ''
    },
    country: {
        type: 'string',
        value: ''
    }
});

const PlayerList = DefineList.extend([
    {
        player: {
            type: Object,
            Value: Player
        }
    }
]);

connect([
    connectConstructor,
    connectMap,
    connectDataParse
], {
    Map: Player,
    List: PlayerList,
    getListData: function (params){
        var url = pgatour.format(config.playersUrl, {
            id: params.id
        });
        return new Promise((resolve, reject)=>{
            $.get(url).then(resolve, reject);
        });
    },
    parseInstanceData: function (response) {
        const data = JSON.parse(response);
        return data.plrs.filter((player)=>{
            return player.pr === config.tourCode;
        }).map((player)=>{
            return {
                playerName: player.nameL + ',' + player.nameF,
                playerId: player.pid,
                countryCode: player.ct
            };
        });
    }
});

export default PlayerList;
The exception is:
steal.production.js:6 Potentially unhandled rejection [1] TypeError: connection.addListReference is not a function
    at Constructor.eval (http://localhost:8091/dist/bundles/for-justin/player-bio/components/player-bio.js:11098:28)
    at Constructor.addAndSetup (http://localhost:8091/dist/bundles/for-justin/app.js:3662:30)
    at Constructor.addEventListener (http://localhost:8091/dist/bundles/for-justin/player-bio/components/player-bio.js:1673:47)
    at Observation.addEdge (http://localhost:8091/dist/bundles/for-justin/app.js:2149:23)
    at Observation.updateBindings (http://localhost:8091/dist/bundles/for-justin/app.js:2205:26)
    at Observation.start (http://localhost:8091/dist/bundles/for-justin/app.js:2197:18)
    at Compute._on (http://localhost:8091/dist/bundles/for-justin/app.js:3831:29)
    at Compute.eval (http://localhost:8091/dist/bundles/for-justin/app.js:3946:18)
    at Compute.eval [as _eventSetup] (http://localhost:8091/dist/bundles/for-justin/app.js:2335:27)
    at Compute.addAndSetup (http://localhost:8091/dist/bundles/for-justin/app.js:3662:30)(anonymous function) @ steal.production.js:6
Thanks in advance for your help
Leath Cooper
@IcculusC
Aug 13 2016 04:54
is there a good solution for transitions between elements or more specifically route changes?
Julian
@pYr0x
Aug 13 2016 09:16
@IcculusC that would be nive to know
i also had this question but didnt found an answer
maybe you can open an thread in the forum
Mohamed Cherif Bouchelaghem
@cherifGsoul
Aug 13 2016 09:21
@pYr0x @IcculusC did you try this? https://github.com/canjs/can-animate
Julian
@pYr0x
Aug 13 2016 09:25
@cherifGsoul thx. i know that project, but it seems pretty outdated. do you know if this plugin wroks also good with can route and route changes?
Mohamed Cherif Bouchelaghem
@cherifGsoul
Aug 13 2016 09:27
@pYr0x no :/
Julian
@pYr0x
Aug 13 2016 09:27
maybe another repo that should be get some more love :)
Mohamed Cherif Bouchelaghem
@cherifGsoul
Aug 13 2016 09:28
exactely
Julian
@pYr0x
Aug 13 2016 09:28
do you had any time to think about steal-sass?
i looked into node-sass
but we need sass.js for the browser version
but the whole problem is, we have to make your own css/less dependency graph
Mohamed Cherif Bouchelaghem
@cherifGsoul
Aug 13 2016 09:29
I didnt make a real progress yet I have a client who's gonna kill me with change requests
Julian
@pYr0x
Aug 13 2016 09:30
oh i know that as well :)
Mohamed Cherif Bouchelaghem
@cherifGsoul
Aug 13 2016 09:30
node-sass is for building
I think the import is the the biggest issue
Julian
@pYr0x
Aug 13 2016 09:32
stealjs/steal-css#16
Christopher Oliphant
@RALifeCoach
Aug 13 2016 10:08
@justinbmeyer Do you know wehn you will have time to look at can-connect?
Julian
@pYr0x
Aug 13 2016 10:09
i think he is on vacation
this weekend
Christopher Oliphant
@RALifeCoach
Aug 13 2016 10:10
I am glad that he is taking time for himself and sad that my problem will have to wait. Thanks Julian.
Julian
@pYr0x
Aug 13 2016 10:11
is that ironical?
Christopher Oliphant
@RALifeCoach
Aug 13 2016 10:11
perhaps
Julian
@pYr0x
Aug 13 2016 10:12
sorry.... do you pay any tax for getting help?
Christopher Oliphant
@RALifeCoach
Aug 13 2016 10:13
No, but maybe I should.
Julian
@pYr0x
Aug 13 2016 10:13
sorry i really dont understand....
it is weekend and you say, that the people behind canjs should be there 7/24 ?
Christopher Oliphant
@RALifeCoach
Aug 13 2016 10:14
Either do I. What point are you trying to make?
Julian
@pYr0x
Aug 13 2016 10:15
it is weekend?
Christopher Oliphant
@RALifeCoach
Aug 13 2016 10:15
Yes, this is a weekend.
Julian
@pYr0x
Aug 13 2016 10:16
so what do you expect?
very core team member will be there and help you?
Christopher Oliphant
@RALifeCoach
Aug 13 2016 10:17
No, that was not what I was saying at all. I was expressing my feelings. Not making a statement about whether or or not he should be here.
Julian
@pYr0x
Aug 13 2016 10:17
and i think if justin is on vacation, he deserved it
Christopher Oliphant
@RALifeCoach
Aug 13 2016 10:17
I have often expressed my gratitude for the time I receive from all of you and I was agreeing that he deserved vacation.
Julian
@pYr0x
Aug 13 2016 10:18
ok
Christopher Oliphant
@RALifeCoach
Aug 13 2016 10:19
My feelings of sadness that I will have to wait, belong to me. They are not a statement that he should have been here to help.
My first statement was that I was glad he had taken the time.
And that remains true.
Eben
@eben-roux
Aug 13 2016 11:09
@pYr0x : what time is it in Germany? You are in Germany, right?
Hello, btw :)
Julian
@pYr0x
Aug 13 2016 11:12
13
hi
:)
Eben
@eben-roux
Aug 13 2016 11:13
so we're almost on the same clock... almost 13h15 here in South Africa
Mohamed Cherif Bouchelaghem
@cherifGsoul
Aug 13 2016 11:14
HAHA I tought Im the only user of canjs ecosystem in whole africa :D
Julian
@pYr0x
Aug 13 2016 11:14
:)
Eben
@eben-roux
Aug 13 2016 11:14
I am implementing my first real system in canjs currently (2.3)
been interested in it for some time coz I like the structure / architecture
Julian
@pYr0x
Aug 13 2016 11:15
good to hear
Eben
@eben-roux
Aug 13 2016 11:15
there have been quite a couple of changes though --- and seems as though the 3.0 release is going to be somewhat of a departure
Julian
@pYr0x
Aug 13 2016 11:16
yeah i think 2.3 will be ok
the only main difference is the module structure
but stache works as in 2.3
Eben
@eben-roux
Aug 13 2016 11:17
those are fine for smaller systems (such as mine) but at a previous employer we ran into a situation where we got stuck on versions of another MVC framework <cough>ember</cough> since the changes meant too much re-work
Julian, it seemed as though the Map isn't going to allow .attr anymore in 3.0
that is quite a huge change ---but a guess with some patchwork / plug-in it could stay for backward compatibility
or did misinterpret that coming change I wonder :)
Julian
@pYr0x
Aug 13 2016 11:19
attr works
Eben
@eben-roux
Aug 13 2016 11:19
ah!
Julian
@pYr0x
Aug 13 2016 11:19
but it throw a warning
use get()
Eben
@eben-roux
Aug 13 2016 11:19
that's cool
interesting
I haven't looked at 3.0 --- I'll wait till it's ready for prime-time then I'll upgrade
interesting since if memory serves ember uses a get/set method (you'd think I'd remember after using it for 3 years lol)
although you could use the attribute directly: myObejct.blah = something --- although the bindings wouldn't fire in that case
Julian
@pYr0x
Aug 13 2016 11:22
i think they will fire
Eben
@eben-roux
Aug 13 2016 11:23
anyhow, I'll have a look once it's out... want to convince my current employer to go with canjs eventually --- currently on... don't laugh... Asp.Net WebForms --- been here 5 months so I cannot take credit pfew
Julian
@pYr0x
Aug 13 2016 11:24
:)
Eben
@eben-roux
Aug 13 2016 11:24
the "not-firing-on-set" was referring specifically to the way ember works (well, worked when last I touched it)
you had to do object.set('xyz', value) else the bindings wouldn't fire --- although there was some method one could call to force a property change event
Julian
@pYr0x
Aug 13 2016 11:25
i think canjs works a little bit different then ember
but i doent really know
Eben
@eben-roux
Aug 13 2016 11:25
lol, most definitely
which is why I like it :)
Mohamed Cherif Bouchelaghem
@cherifGsoul
Aug 13 2016 11:28
ember is js on rails
Eben
@eben-roux
Aug 13 2016 11:28
haven't used rails so I'll have to believe you :)
I know that ember has also had many improvements and changes since I last used it --- it is very convention-based
Mohamed Cherif Bouchelaghem
@cherifGsoul
Aug 13 2016 11:37
I dont know if it's changed or not, I think the major architectural difference is the app state in ember the app state depends on the route in canjs the route depends on the app state
Eben
@eben-roux
Aug 13 2016 11:39
There is a very tight coupling in ember between the naming/structure of the application and the route --- not so in canjs
however, this means that you need to be quite cognizant of routing in a canjs application and you have to do all the mapping yourself --- which brings quite a bit of flexibility
that is what I like about canjs --- it isn't prescriptive when it comes to the application architecture
Mohamed Cherif Bouchelaghem
@cherifGsoul
Aug 13 2016 11:48
@eben-roux Im glad that you like it :)
Eben
@eben-roux
Aug 13 2016 12:00
@cherifGsoul How are you involved with canjs (or also just a user)? Where in Africa are you from, then?
Mohamed Cherif Bouchelaghem
@cherifGsoul
Aug 13 2016 12:04
@eben-roux I contribute with some bug fixing and now I have steal-sass to work on
and Im in the North Africa :D
Algeria
Eben
@eben-roux
Aug 13 2016 12:09
cool beans...
Mohamed Cherif Bouchelaghem
@cherifGsoul
Aug 13 2016 12:10
:)
Julian
@pYr0x
Aug 13 2016 15:58
@RALifeCoach so... you read the docs right?
and what do you try?
jusus... you really dont want thinking, right?
just adding the 'can-connect/constructor/store/store' behaivour will do the trick!
Mohamed Cherif Bouchelaghem
@cherifGsoul
Aug 13 2016 16:02
@pYr0x easy man :)
take it easy
Julian
@pYr0x
Aug 13 2016 16:02
that makes me very angry
Christopher Oliphant
@RALifeCoach
Aug 13 2016 16:44
@pYr0x No, I did not notice that comment. And in reading the documentation, I do not see any association between /store and the problem I was having. I hear that you are not comfortable working with me. I am sorry you find me difficult to work with. I read and re-read documentation. I try different options, over and over again. I spend hours (and some times days) struggling with a problem. I try to make Gitter my last resort.
CanJS use
When you bind on a Todo instance or Todo.List list, they will automatically call [can.connect/constructor-store.addInstanceReference] and [can.connect/constructor-store.addListReference].
i dont believe that you dont see that
Christopher Oliphant
@RALifeCoach
Aug 13 2016 16:52
Julian if you are uncomfortable working with me, then stop.
Julian
@pYr0x
Aug 13 2016 16:52
ok
Mohamed Cherif Bouchelaghem
@cherifGsoul
Aug 13 2016 20:47
This message was deleted
5*-7-