Closed alex3683 closed 10 years ago
Add json-patch to your requirejs configuration:
{
shim: {
// ...
'json-patch': {
exports: 'jsonpatch'
}
// ...
},
paths: {
// ...
// LaxarJS Patterns:
'json-patch': '../bower_components/fast-json-patch/src/json-patch-duplex',
// ...
}
}
In your application directory delete bower_components
and run
tools/bin/bower install
didUpdate
-events can now carry the changes in JSON Patch syntax using the patches
field. This is supported by resources.updateHandler( scope, modelKey )
, resources.handlerFor( scope )
and resources.updatePublisherForFeature( scope, featurePath, optionalOptions )
.
Implemented on master
(v0.12.0
)
To have a non-ambiguous format for changes of resources in the client that would even play well when communicating with a RESTful backend, we like to introduce JSON Patch (http://tools.ietf.org/html/rfc6902). For now it should only be introduced in addition to the currently supported
updates
and already deprecateddata
fields, but the goal is to make it the only supported way for didUpdate events starting from LaxarJS Patterns 1.0.A candidate for a JSON Patch library is https://github.com/Starcounter-Jack/JSON-Patch.