canjs v6.2.0 Release Notes
Release Date: 2019-10-22 // over 4 years ago-
🚀 canjs/canjs v6.2.0 Release Notes
🚀 This is a minor release with several error message improvements.
🚀 can-attribute-observable
🚀 can-observable-array
🚀 can-observable-array v1.0.2 - Run properties set by index through the Array.items converter
When setting an item by index, it should run through theArray.items
converter. This will do so now:class MyArray { static items = type.convert(Number); }let arr = new MyArray(); arr[0] = "4";console.log(arr[0]); // 4
🚀 can-observable-bindings
➕ Add
fromAttribute
to can-namespace🚀 This patch release adds
fromAttribute
tocan-namespace
so it is available on the globalcan
object.🚀 can-observable-bindings v1.3.0 - The ability to pass a object to fromAttribute
📜 This makes possible to pass a conversion object tofromAttribute
, the object must haveparse
andstringify
methods:person: { type: Object, bind: fromAttribute( JSON ) }
Or
person: { type: Object, bind: fromAttribute( 'attribute-name' , JSON ) }
🚀 can-observable-mixin
- 🚀 can-observable-mixin v1.0.3 - Enhance type error message
✨ This enhance type error message by adding the value type in the message:
Before:
farah.age = '4'; // -> Uncaught Error: 4 is not of type Number. Property age is using "type: Number". Use "age: type.convert(Number)" to automatically convert values to Numbers when setting the "age" property.
`Now:
farah.age = '4'; // -> Uncaught Error: "4" (string) is not of type Number. Property age is using "type: Number". Use "age: type.convert(Number)" to automatically convert values to Numbers when setting the "age" property.