Releases: canjs/canjs
observable.value
can-simple-observable
This adds .value
getter and setters for Async/Resolver/Settable/Setter and SimpleObservable:
obs = new SimpleObservable(5);
obs.value // ->5
obs.value = 3;
obs.value // -> 3
can-view-live
If a part of the DOM managed by .html
was updated twice within the same "batch", the second update would not work as it would try to replace incorrect oldNodes
. This patch fixes this bug.
This bug occurred in situations where two-way bindings would cause cycles.
can-view-scope
- can-view-scope v4.9.1 - making scope/foo() walk the scope correctly before calling foo
canjs/can-view-scope#190
Fixes a bug using scope/key
to lookup and call functions. For example, the following would work:
{{../../../method()}}
The this was not:
{{scope/method()}}
can-attribute-observable
- can-attribute-observable v1.1.3 - Works with .value
This fixes a bug cause by can-simple-observable getting the ability to use.value
to get and set the value.
can-define
- can-define v2.6.3 - Deleted props are still observable
can-query-logic
- can-query-logic v1.1.1 - Fixes hydration bug with {age:22} and {age: [22]}
PR canjs/can-query-logic#20
can-route
- can-route v4.4.2 - Fixes bug with
.value
being observable
can-route-pushstate
- can-route-pushstate v5.0.6 - Fixes bug with
.value
being observable
scope/key support in stache
canjs/canjs v5.10.0 Release Notes
can-stache
can-view-scope
- can-view-scope v4.9.0 - Adds support for scope/key
This is a minor release, providing support for:
Which is equivalent to:
for(of) fixes
canjs/canjs v5.9.2 Release Notes
can-ajax
can-construct
can-define
- can-define v2.6.2 - Prevent defining computed properties on the prototype
This prevents setting a DefineMap's computed properties on the prototype, which causes binding issues. This fixes a regression that was introduced in 2.6.0.
can-route
- can-route v4.4.1 - Add can-define as a dependency
can-define was listed as a devDependency
can-stache
- can-stache v4.11.1 - Custom scopes get a let context
canjs/can-stache#592 (review) - can-stache v4.11.2 - for(of) produces observable scopes
#594
Makes this sorta thing work:
{{# for(thing of this.stuff)}}
{{let theValue=null}}
<driver-list selected:to="theValue" on:click='fooName = 3'/>
<driver-edit driver:from="theValue"/>
{{/ for}}
{{# for(items) }}
{{scope.index}}
{{/ for}}
The above works.
can-view-scope
v5.9.1
Bug Fix
- can-view-scope v4.8.1 - notContext scopes are readable using ../
This fixes an issue whereobject
could not be read using../object
in the following example sinceobject
is in a "notContext" scope:
{{#each(objects, object=value)}}
{{#each(../fields, field=value)}}
{{../object[field]}}
{{/each}}
{{/each}}
5.9.0
New Features
can-route
- can-route v4.4.0 - DefineMap as the default route.data
This is a minor release of can-route that adds DefineMap, from can-define, as the new default forroute.data
. This is backwards compatible with old uses of the default route.data.
To see how this is useful, consider this example:
import route from "can-route";
route.register("{page}", { page: "home" });
route.start();
console.log(route.data.page); // -> "home"
As you can see, since route.data
is a DefineMap we can use the properties on it directly using JavaScript dot notation.
The purpose of this change is to reduce the amount of boilerplate to get started with canjs routing. Usually you create an application ViewModel and then set it as the route.data
like below.
import route from "can-route";
import DefineMap from "can-define/map/map";
const AppViewModel = DefineMap.extend({
page: "string"
});
route.register("{page}", { page: "home" });
route.data = new AppViewModel();
route.start();
console.log(route.data.page); // -> "home"
The above still works, of course, but with can-route 4.2.0 this boilerplate becomes unnecessary.
This also allows you to have better separation between your application state and your route data. No more serialize: false
!! Consider the following:
import route from "can-route";
import DefineMap from "can-define/map/map";
const AppViewModel = DefineMap.extend({
someNonSerializedState: "string",
routeData: {
default: () => route.data
}
});
route.register("{page}", { page: "home" });
Now you have clean separate between your route state and the rest of your application's state. You can use this in your stache like so:
v5.8.0
New Features
- can-define v2.6.0 - Observable on changes to enumerable properties via defineInstanceKey
- can-simple-dom v1.4.0
- can-simple-map v4.3.0 - canReflect.hasOwnKey works
- can-stache v4.11.0 - First versions of {{for(in)}} and {{let}} helpers
- can-view-scope v4.8.0 - Scope refactor and variable scopes
Bug Fixes
- can-construct v3.5.2 - Makes init and setup non-enumerable
- can-define v2.5.9 - can-define/map/map Documentation Updates.
- can-define v2.5.10 - Expando property types and fewer enumerable internals
- can-define v2.5.12 - can-define Documentation Updates
- can-define v2.6.1 - Fixes enumerability of prototype properties for Safari
- can-define-backup v2.1.0 - Fixes issue with enumerability of added functions
- can-diff v1.4.2 - fix merging lists of primitives
#11 - can-kefir v1.1.1
- can-kefir v1.1.2 - fix global build
- can-map-define v4.3.4 - getOwnEnumerableKeys accounts for default behavior values
- can-realtime-rest-model v1.0.1 - Docs improvements
- can-reflect v1.17.5 - assignDeep assigns deep
- can-rest-model v1.0.1 - Docs improvements
- can-route-pushstate v5.0.3
- can-route-pushstate v5.0.4
- can-route-pushstate v5.0.5
- can-simple-dom v1.4.1
- can-simple-dom v1.4.2
- can-view-scope v4.7.1 - Tolerate walking to a scope that doesn't exist
v5.7.0
Builds
This makes everything.mjs
the build for all core and ecosystem builds.
New Packages
- can-connect-ndjson v1.0.0 - Upgrade to compatibility with canjs 4/5
- can-validate-legacy v2.0.0 - Upgrade can packages to 4.x
Bug Fixes
5.6.1
v5.6.0
New Features
A new package, can-map-compat is added to canjs, which makes it easier to migrate away from can-map to newer observable types such as DefineMaps.
import { DefineMap, makeMapCompat } from "can";
const ViewModel = makeMapCompat(DefineMap.extend("ViewModel", {
page: {
default: "home"
}
}));
const vm = new ViewModel();
vm.attr("page"); // -> "home"
vm.attr("page", "cart");
vm.attr("page"); // -> "cart"
vm.removeAttr("page");
vm.attr("page"); // -> undefined
Bug Fixes
can-attribute-observable
can-component
count:from="count"
works below:
can.Component.extend({
tag: "my-counter",
view: `
<can-slot name="incrementButton"
add:from="add">
<button on:click="add(1)">+1</button>
</can-slot>
<can-slot name="countDisplay"
count:from="count">
{{count}}
</can-slot>
`,
ViewModel: {
count: {type: "number", default: 0},
add(increment){
debugger;
this.count += increment;
}
}
});
- can-component v4.4.1 - Handle ViewModel component property value to be null during instantiation
Properties in ViewModel can be initialized to null when instantiating a component - can-component v5.0.0-pre.0
can-construct
can-define
- can-define v2.5.5 - Fixed deprecation notice for .set
PR #365 - can-define v2.5.6 - Documentation improvements
This release improves documentation and changes everything to use thecan
package.
can-dom-data-state
- can-dom-data-state v1.0.2 - v1.0.2
This fixes a memory leak caused bysetData
listening for an element's removal in order to delete the internal DOM state.
can-dom-mutate
- can-dom-mutate v1.1.1 - Making inserted events not bubble
canjs/can-dom-mutate#38 - can-dom-mutate v1.2.0 - Adding to can-namespace
canjs/can-dom-mutate#39 - can-dom-mutate v1.2.1 - Prevents memory leaks caused by passing a DocumentFragment to onNodeRemoval
can-map
Adds a _legacyAttrBehavior
property, which when set to true
, keeps can-map compatible with how it worked before can-reflect
( https://github.com/canjs/can-map/releases/tag/v3.2.0 ).
To use it, you can either:
// Sets the legacy behavior for all Maps
can.Map.prototype._legacyAttrBehavior = true
// Sets the legacy behavior for an individual map type
Type = can.Map.extend({ _legacyAttrBehavior: true}})
// Sets the legacy behavior for a single map instance
var map = new can.Map();
map._legacyAttrBehavior = true;
- can-map v4.3.0 - Adds _legacyAttrBehavior to .serialize()
- can-map v4.3.1 - Makes deep assigns and updates work with _legacyAttrBehavior
When using_legacyAttrBehavior: true
to enable the legacy attr
behavior you still want to interop with other map types. For this to
work:
map.attr({
prop: new DefineMap()
})
This works with both assign and update forms of attr().
- can-map v4.3.2
- can-map v4.3.3 - Handles props with undefined values
Makes sure that any props on the map are still added when their value isundefined
, whether during construction or set later. PR#122
can-map-compat
can-queues
can-reflect
- can-reflect v1.17.2
- can-reflect v1.17.3
- can-reflect v1.17.4 - Fixes documentation on update and updateDeep
This fixes the documentation and code examples forupdate
andupdateDeep
.
Bugs
can-stache
- can-stache v4.10.4 - Fixes bug with bracket expression used after a call expression
- can-stache v4.10.5 - Fixes arguments passed to helpers and adds
addConverter
docs
PR #582
can-stache-bindings
passes the bindingState which includes information about the binding
can-stache-converters
- can-stache-converters v4.2.1
- can-stache-converters v4.2.2
- can-stache-converters v4.2.3
- can-stache-converters v4.2.4
can-view-callbacks
v5.5.0
New Features
- can-component v4.4.0 - Slots able to pass individual values
- can-dom-mutate v1.2.0 - Adding to can-namespace
You can now use inserted/removed events with the can
package (global or ES Module builds) like:
import { domEvents, domMutateDomEvents, domMutateNode } from "can";
domEvents.addEvent(domMutateDomEvents.inserted);
domEvents.addEvent(domMutateDomEvents.removed);
...
domMutateNode.appendChild.call(document.body, p);
Adds a _legacyAttrBehavior
property, which when set to true
, keeps can-map compatible with how it worked before can-reflect
( https://github.com/canjs/can-map/releases/tag/v3.2.0 ).
To use it, you can either:
// Sets the legacy behavior for all Maps
can.Map.prototype._legacyAttrBehavior = true
// Sets the legacy behavior for an individual map type
Type = can.Map.extend({ _legacyAttrBehavior: true}})
// Sets the legacy behavior for a single map instance
var map = new can.Map();
map._legacyAttrBehavior = true;
Bug Fixes
- can-attribute-observable v1.1.1
- can-attribute-observable v1.1.2 - Removing console.log
- can-component v4.4.1 - Properties in ViewModel can be initialized to null when instantiating a component
- can-construct v3.5.1 - fixed two documentation syntax highlights
- can-define v2.5.5 - Fixed deprecation notice for .set
- can-dom-data-state v1.0.2 - fixes a memory leak caused by
setData
listening for an element's removal in order to delete the internal DOM state. - can-dom-mutate v1.1.1 - Making inserted events not bubble
- can-dom-mutate v1.2.1 - Prevents memory leaks caused by passing a DocumentFragment to onNodeRemoval
- can-map v4.3.0 - Adds _legacyAttrBehavior to .serialize()
- can-map v4.3.1 - Makes deep assigns and updates work with _legacyAttrBehavior
- can-map v4.3.2
- can-map v4.3.3 - Handles props with undefined values
- can-reflect v1.17.2
- can-reflect v1.17.3
- can-reflect v1.17.4 - Fixes documentation on update and updateDeep
- can-route v4.3.5 - Calling attr with an object no longer stringifies object
- can-stache v4.10.4 - Fixes bug with bracket expression used after a call expression
- can-stache v4.10.5 - Fixes arguments passed to helpers and adds
addConverter
docs - can-stache-converters v4.2.4