Releases: canjs/can-migrate
Inline define-map static properties to ObservableObject and split chained variables declarations
Inline DefineMap to ObservableObject and Component imports
Fixes for Observable objects and rest-model
Handle StacheElement when exported via module.export
This fixes an issue where
module.exports = Component.extend({
tag: "my-app",
view: `CanJS {{feels}} modules`,
ViewModel: {
feels: { default: "😍" }
}
});
Was having issues with adding the customElements.define
so now it should be:
module.exports = class MyApp extends StacheElement {
static get view() {
return `CanJS {{feels}} modules`;
}
static get props() {
return {
feels: { default: "😍" }
};
}
};
customElements.define('my-app', MyApp);
Also fixes issue with not converting require
statements as there was only logic for import
.
propertyDefaults for StacheElement & Remove Spread ObservableArray
Add creating propertyDefaults
to StacheElement
:
static get propertyDefaults() {
return DeepObservable;
}
For a StacheElement
and remove the transform for ObservableArray
that would transform DefineList([1, 2])
into ObservableArray(...[1, 2])
as the first parameter is now an array.
Transform `.mjs` files
Update the files that are transformed to work on .mjs
files.
propertyDefaults to ObservableObject & ObservableArray
Add
static get propertyDefaults() {
return DeepObservable;
}
to ObservableObject
if propertyDefaults
doesn't already exist and ObservableArray
add:
static get items () {
return DeepObservable;
}
if this doesn't already exist.
Rename to StacheElement, ObservableArray & ObservableObject
Update the transforms to use the new names, from
StacheDefineElement
to StacheElement
DefineObject
to ObservableObject
DefineArray
to ObservableArray
Type convert custom types
This will convert custom types such as ObservableObject
or ObservableArray
with type.maybeConvert
for less strict check.
Convert:
{
elem: MyMap
}
into:
{
elem: type.maybeConvert(MyMap)
}
transform default() into a getter
transform Defaults into getters
Replaces
{ prop: { Default: Todo } }
with
prop: {
get default () {
return new Todo()
}
}
Also fix issue with transforming setters into methods.