Skip to content

Releases: canjs/can-define

Update docs with new @parent & @collection

31 Oct 18:00
Compare
Choose a tag to compare

Release to re-include test folder

27 Oct 22:30
Compare
Choose a tag to compare

This was due to an npm bug

Error When Using Short-hand Improperly

26 Oct 17:33
Compare
Choose a tag to compare

This release makes it so that using the shorthand syntax for a Define property without a properly defined propDefinition with throw an error and cause the value to not be set.

For Example:

DefineMap.extend({
  prop01: DefineMap, // <- Sets Type to DefineMap
  prop02: 0, // <- Throws error and prop02 is not set
  prop03: 'boolean', // <- Sets type to boolean
  prop04: 'string that is not a type' // <- Throws error and prop04 is not set

Use can-define-lazy-value

05 Oct 22:32
Compare
Choose a tag to compare

Using can-define-lazy-value instead of local replaceWith function.

#273

Deprecate .set(Object)

03 Oct 15:03
Compare
Choose a tag to compare

DefineMap and DefineList have the .set() function for setting possibly-unknown keys to provided values. .set had a pattern that took an object and set properties based on the keys of the object. This is now deprecated in favor of the following functions:

  • .assign(Object) shallow-copies the properties of the object to the DefineMap/DefineList (object values are replaced). Existing keys on the map or list not part of the provided object are preserved.
  • .assignDeep(Object) deep-copies the properties of the object to the DefineMap/DefineList (object values are merged). Existing keys on the map or list not part of the provided object are preserved.
  • .update(Object) shallow-copies the properties of the object to the DefineMap/DefineList (object values are replaced). Existing keys on the map or list not part of the provided object are not preserved.
  • .updateDeep(Object) deep-copies the properties of the object to the DefineMap/DefineList (object values are merged). Existing keys on the map or list not part of the provided object are not preserved.

Republishing 1.4.6

26 Sep 16:10
Compare
Choose a tag to compare

npm/npm#18341 is causing test/ folders to be ignored by npm pack, which means that the canjs test suite cannot find the tests for can-define. This republishes [email protected] using [email protected].

Using can-simple-observable for getters using lastSetValue

26 Sep 14:30
Compare
Choose a tag to compare

Fixing binding to getters that use lastSetVal

08 Sep 17:34
Compare
Choose a tag to compare

#261

This fixes an issue where if you have a getter using lastSetVal like:

  place: {
    get: function(lastSet){
      if(lastSet) {
        return lastSet;
      }
    }
  }

and were binding to it in a template like:

    {{#if place}}
      THERE IS A PLACE
    {{/if}}

The template would not be updated when setting place.

Helpful warnings

01 Sep 15:14
Compare
Choose a tag to compare

Warn when setting a property that has only a zero-arg getter.
Warn when value property is assigned an object
Warn when value property is assigned a constructor
Warn when a constructor is supplied as a type definition

Observation / CID fixes