Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 18 22:20
    greenkeeper[bot] labeled #5391
  • Oct 18 22:20
    greenkeeper[bot] opened #5391
  • Oct 18 22:20

    greenkeeper[bot] on can-observable-mixin-1.0.3

    fix(package): update can-observ… (compare)

  • Oct 18 19:08
    cherifGsoul labeled #5390
  • Oct 18 19:07
    cherifGsoul opened #5390
  • Oct 18 18:45
    greenkeeper[bot] labeled #5389
  • Oct 18 18:45
    greenkeeper[bot] opened #5389
  • Oct 18 18:45

    greenkeeper[bot] on can-observable-bindings-1.3.0

    fix(package): update can-observ… (compare)

  • Oct 18 18:29

    matthewp on master

    Update dist for release (compare)

  • Oct 18 18:29

    matthewp on v6.1.3

    Update dist for release 6.1.3 (compare)

  • Oct 18 17:59

    matthewp on can-observable-array-1.0.2

    (compare)

  • Oct 18 17:59

    matthewp on master

    fix(package): update can-observ… Merge pull request #5388 from c… (compare)

  • Oct 18 17:59
    matthewp closed #5388
  • Oct 18 16:46
    greenkeeper[bot] labeled #5388
  • Oct 18 16:46
    greenkeeper[bot] opened #5388
  • Oct 18 16:46

    greenkeeper[bot] on can-observable-array-1.0.2

    fix(package): update can-observ… (compare)

  • Oct 18 12:45
    greenkeeper[bot] labeled #5387
  • Oct 18 12:45
    greenkeeper[bot] opened #5387
  • Oct 18 12:45

    greenkeeper[bot] on can-stache-element-1.0.2

    fix(package): update can-stache… (compare)

  • Oct 18 09:49
    chasenlehara edited #5384
Kevin Phillips
@phillipskevin
can-map/can-map-define has attr() and works the same as the Map and define plugin in 2.3
Frank Lemanschik
@frank-dspeed
DifineMap nativ should get depricated or not?
Kevin Phillips
@phillipskevin
DefineMap you don’t need to use attr()
Gregg Roemhildt
@roemhildtg
I like using DefineMap since there's no need for attr
Kevin Phillips
@phillipskevin
DefineMap is the new way
Gregg Roemhildt
@roemhildtg
But can you confirm whether or not the set behavior has changed?
Kevin Phillips
@phillipskevin
set works the same
it’s the value that is not working in your example I think
Frank Lemanschik
@frank-dspeed
the old works but should complain when using attr
Kevin Phillips
@phillipskevin
no can-map-define is a different module
you have to use attr
@roemhildtg
let a = can.DefineMap.extend('a', {
  init(){
    console.log(arguments);
  },
  val: {
    set(val){
      console.log('hey there', val);
      return val;
    }
  }
})
let b = new a();
b.val = 'Hello';
console.log(b.val)
that does what you’re expecting
Frank Lemanschik
@frank-dspeed
ya but you agre with me that we don't use that this way any more as we do var DefineMap = require("can-define/map/map");
Kevin Phillips
@phillipskevin
don’t use what this way?
can-map and can-map-define are legacy modules
for backward compatibility
Frank Lemanschik
@frank-dspeed
we don't use can-map-define in donejs examples
ya
thats what i mean they are still updated but not used any more
Kevin Phillips
@phillipskevin
the donejs examples will be updated to use DefineMap, yeah
Frank Lemanschik
@frank-dspeed
they get replaced by the lazy models
Kevin Phillips
@phillipskevin
and generators, etc
Frank Lemanschik
@frank-dspeed
ya thats what i mean :)
Gregg Roemhildt
@roemhildtg
Okay, but I can provide a default value still, its just this doesn't call the set method anymore?
Frank Lemanschik
@frank-dspeed
i depricated it and throw it out all over
Oh @phillipskevin do you maybe know or tryed it what happens to a 2.3 project when you switch do can3.0
and use the legacy stuff does it work?
Kevin Phillips
@phillipskevin
yes
Frank Lemanschik
@frank-dspeed
so we are compatible wow
Kevin Phillips
@phillipskevin
yeah, we have client projects that are upgrading to 3.0
Frank Lemanschik
@frank-dspeed
don't knowed that fact should consider that in the genrator
ya upgrading means for me also changing the components
i mean it works to only change the requires and imports and they still work nothing left out?
Kevin Phillips
@phillipskevin
no, you do have to make some changes
@roemhildtg to answer your question… I’m not sure
Gregg Roemhildt
@roemhildtg
I've been doing the future proof migration, its not so bad. It cleans up the code a lot removing all of the .attr stuff
Kevin Phillips
@phillipskevin
I don’t think setting a default value on DefineMap like that does what you want
Gregg Roemhildt
@roemhildtg
Okay just thought I'd ask. I do know that in the previous version set would be called when the default value was set. http://jsbin.com/wicuguwisa/edit?html,js,console,output
Kevin Phillips
@phillipskevin
yeah
there are some differences with the order of how the define properties get set up
if that’s something you need, feel free to open an issue
Frank Lemanschik
@frank-dspeed
@phillipskevin do you have a idea what happens to such?
Kevin Phillips
@phillipskevin
not sure what you mean
Frank Lemanschik
@frank-dspeed

canMap.extend(
/ @prototype */
{
define: {
/

     * @property {office/models/session} office/components/navigation.loginSession loginSession
     * @parent office/components/navigation.properties
     *
     * A placeholder session with a nested [office/models/user user] property that
     * is used for two-way binding the login form's username and password.
     */
    loginSession: {
        value: function(){
            return new Session({user: new User()});
        }
    }
    /**
     * @property {office/app} office/components/navigation.app app
     * @parent office/components/navigation.properties
     *
     * The [office/app] used to add or destroy the session.
     */
     /**
      * @property {Promise<office/models/session>} office/components/navigation.sessionPromise sessionPromise
      * @parent office/components/navigation.properties
      *
      * The promise that resolves when the user is logged in.
      */
},
/**
 * @function createSession
 *
 * Creates the session on the server and when successful updates [office/components/navigation.app]
 * with the session. Sets [office/components/navigation.sessionPromise].
 * @param {Event} [ev] Optional DOM event that will be prevented if passed.
 */
createSession: function(ev){
    if(ev) {
        ev.preventDefault();
    }
    var self = this;
    var sessionPromise = this.attr("loginSession").save().then(function(session){

        self.attr("loginSession", new Session({user: new User()}));
        self.attr("app").attr("session", session);

    });
    this.attr("sessionPromise", sessionPromise);
},

```

you see we have a map and then define:{}
and functions under the define
Gregg Roemhildt
@roemhildtg
Okay, good to know. I think its useful. I'll put in an issue.
Kevin Phillips
@phillipskevin
@frank-dspeed yeah… that’s how can-map and can-map-define work