These are chat archives for canjs/canjs

30th
Nov 2016
Frank Lemanschik
@frank-dspeed
Nov 30 2016 00:22
@phillipskevin donejs at present normaly don't works with can3.0 but i have it working including autorender and that https://github.com/donejs/donejs/issues/750#issuecomment-263285764
Kevin Phillips
@phillipskevin
Nov 30 2016 00:33
yeah, I did something similar
I'm not using git dependencies though
the only non-npm dependency i have is I linked to the can3 branch of generator-donejs
Viktor Busko
@Lighttree
Nov 30 2016 10:42

Guys is 3.0 will support using with download bundler the same as 2.3.27?
I see this option here: http://v3.canjs.com/doc/guides/setup.html#Scripttagswiththedownloadbuilder

but I don't see download bundler on a home page :)

I know that NPM-way is prefered, so I'm interested will this option be available.
Chasen Le Hara
@chasenlehara
Nov 30 2016 16:16
We’re removing the download builder for CanJS 3; those docs were from our 2.3 release.
You can take a sneak peek at the changes to that page; I just opened a PR yesterday: canjs/canjs#2812
Viktor Busko
@Lighttree
Nov 30 2016 16:47
Thanks, I was thinking about just downloading NPM package and using it without NPM :)
Chasen Le Hara
@chasenlehara
Nov 30 2016 17:01
Yeah, I think that works too if you just want can.js or can.all.js
Frank Lemanschik
@frank-dspeed
Nov 30 2016 17:02
@chasenlehara ehm i think he means he downloads the NPM packages into folders and yes this will 100% work
as it don't matters how you add the files to the file system
:D
you can download npm packages as zip and extract them to any path
and you can always download the git repos as zip also
Viktor Busko
@Lighttree
Nov 30 2016 17:54
(function() {
    var addParticipantsViewModel = can.Map.extend({
        define: {
            participantsStaging: {
                value: [{
                    firstName: '',
                    lastName: '',
                    email: ''
                }],
                set: function(newValue) {
                    console.log('setter');
                    return newValue;
                },
                get: function(value) {
                    console.log('getter');
                    return value;
                }
            }
        },

        addParticipantItem: function() {
            this.attr('participantsStaging').push({
                firstName: '',
                lastName: '',
                email: ''
            });
        }
    });

    /**
     * Add Participants component
     */
    can.Component.extend({
      tag: 'add-participants',
      template: can.view('addParticipants-template'),
      viewModel: addParticipantsViewModel
    });
}());
Is there any way to make get/set work in this case ? I'm pushing new items to participantsStaging by clicking on some button and expecting setter to work, but it doesn't .
I was thinking maybe there is some conversion to can.List happens and in my version of CanJS it doesn't work with define plugin :|
not sure
Frank Lemanschik
@frank-dspeed
Nov 30 2016 17:56
@Lighttree what canjs version
Viktor Busko
@Lighttree
Nov 30 2016 17:57
2.2.9
Frank Lemanschik
@frank-dspeed
Nov 30 2016 17:57
and you think the setter don't works because you get no console.log right?
Viktor Busko
@Lighttree
Nov 30 2016 17:57
right
Frank Lemanschik
@frank-dspeed
Nov 30 2016 17:58
i will look fast into the 2x syntax i am more familar with 3x
Viktor Busko
@Lighttree
Nov 30 2016 17:59
if I put log right after push and get participantsStaging I see that item pushed, but no log from get/set
Chasen Le Hara
@chasenlehara
Nov 30 2016 18:00
The setter isn’t called when you modify the list, only when you set the list (i.e. this.attr(‘participantsStaging’, []))
Frank Lemanschik
@frank-dspeed
Nov 30 2016 18:01
@chasenlehara but it sound as its binded value so it should do this.attr right?
and addItem calls this.attr
Viktor Busko
@Lighttree
Nov 30 2016 18:02
@chasenlehara thanks, I've changed my code to:
        addParticipantItem: function() {
            var list = this.attr('participantsStaging');
            list.push({
                firstName: '1',
                lastName: '2',
                email: '3'
            });
            this.attr('participantsStaging', list);
        }
and setter logs
Frank Lemanschik
@frank-dspeed
Nov 30 2016 18:03
ah i understand :)
a push is not a set :)
Chasen Le Hara
@chasenlehara
Nov 30 2016 18:08
Yup, exactly
Thomas Sieverding
@Bajix
Nov 30 2016 19:17
Are there release notes for can 3.2?
Matthew Phillips
@matthewp
Nov 30 2016 22:05
not peak->peek?
Kevin Phillips
@phillipskevin
Nov 30 2016 22:06
that was 3.1.0
Chasen Le Hara
@chasenlehara
Nov 30 2016 23:08
Does anyone know if this sort of thing works?
<can-import from="components/example” *importPromise></can-import/>
<other-component {import-did-resolve}="importPromise.isResolved" />
Essentially, being able to export the promise from can-import to use it somewhere else?
Kevin Phillips
@phillipskevin
Nov 30 2016 23:20
@chasenlehara I know you can export the value returned by the promise
don’t know of a way to export the promise itself
if you use a static import like that though, won’t the promise always be resolved?
Chasen Le Hara
@chasenlehara
Nov 30 2016 23:25
Hm, if it’s being progressively loaded, I would expect there to be room for failure.