Releases: canjs/can-define
Update docs with new @parent & @collection
Release to re-include test folder
This was due to an npm bug
Error When Using Short-hand Improperly
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
Using can-define-lazy-value instead of local replaceWith
function.
Deprecate .set(Object)
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
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
Fixing binding to getters that use lastSetVal
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
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