Skip to content

Commit

Permalink
Stable Version 1.0.0-alpha.5-1.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry committed Nov 19, 2014
1 parent c63d3ef commit 2ef08ef
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 59 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
@@ -1,7 +1,11 @@
##### 1.0.0-alpha.5-1 - 19 November 2014

Removed DSUtils.deepFreeze

##### 1.0.0-alpha.5-0 - 18 November 2014

###### Breaking API changes
- All hooks now take the resource definition object as the first argument instead of just the name of the resource
- All hooks now take the resource definition object as the first argument instead of just the name of the resource

###### Backwards compatible API changes
- jmdobry/angular-data#238
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -10,7 +10,7 @@ Unlike Backbone and Ember Models, js-data does not require the use of getters an

Supporting relations, computed properties, model lifecycle control and a slew of other features, js-data is the tool for giving your data the respect it deserves.

__Latest Release:__ [1.0.0-alpha.5-0](https://github.com/js-data/js-data/releases/tag/1.0.0-alpha.5-0)
__Latest Release:__ [1.0.0-alpha.5-1](https://github.com/js-data/js-data/releases/tag/1.0.0-alpha.5-1)

js-data is pre-release. The API is subject to change, though the current api is well tested.

Expand Down
2 changes: 1 addition & 1 deletion bower.json
@@ -1,7 +1,7 @@
{
"name": "js-data",
"description": "Robust, framework-agnostic in-memory data store.",
"version": "1.0.0-alpha.5-0",
"version": "1.0.0-alpha.5-1",
"homepage": "http://www.js-data.io",
"repository": {
"type": "git",
Expand Down
34 changes: 7 additions & 27 deletions dist/js-data.js
@@ -1,7 +1,7 @@
/**
* @author Jason Dobry <jason.dobry@gmail.com>
* @file js-data.js
* @version 1.0.0-alpha.5-0 - Homepage <http://www.js-data.io/>
* @version 1.0.0-alpha.5-1 - Homepage <http://www.js-data.io/>
* @copyright (c) 2014 Jason Dobry
* @license MIT <https://github.com/js-data/js-data/blob/master/LICENSE>
*
Expand Down Expand Up @@ -3427,16 +3427,11 @@ var asyncMethods = require('./async_methods');
var observe = require('../../lib/observe-js/observe-js');
var Schemator;

DSUtils.deepFreeze(syncMethods);
DSUtils.deepFreeze(asyncMethods);
DSUtils.deepFreeze(DSErrors);
DSUtils.deepFreeze(DSUtils);

function lifecycleNoopCb(resourceName, attrs, cb) {
function lifecycleNoopCb(resource, attrs, cb) {
cb(null, attrs);
}

function lifecycleNoop(resourceName, attrs) {
function lifecycleNoop(resource, attrs) {
return attrs;
}

Expand Down Expand Up @@ -3853,8 +3848,10 @@ function defineResource(definition) {
});
});
}
DSUtils.deepFreeze(def.relations);
DSUtils.deepFreeze(def.relationList);
if (typeof Object.freeze === 'function') {
Object.freeze(def.relations);
Object.freeze(def.relationList);
}
}

def.getEndpoint = function (attrs, options) {
Expand Down Expand Up @@ -5238,23 +5235,6 @@ module.exports = {
},
updateTimestamp: updateTimestamp,
Promise: _Promise,
deepFreeze: function deepFreeze(o) {
if (typeof Object.freeze === 'function' && typeof Object.isFrozen === 'function') {
var prop, propKey;
Object.freeze(o); // First freeze the object.
for (propKey in o) {
prop = o[propKey];
if (!prop || !o.hasOwnProperty(propKey) || typeof prop !== 'object' || Object.isFrozen(prop)) {
// If the object is on the prototype, not an object, or is already frozen,
// skip it. Note that this might leave an unfrozen reference somewhere in the
// object if there is an already frozen object containing an unfrozen object.
continue;
}

deepFreeze(prop); // Recursively call deepFreeze.
}
}
},
compute: function (fn, field, DSUtils) {
var _this = this;
var args = [];
Expand Down
4 changes: 2 additions & 2 deletions dist/js-data.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "js-data",
"description": "Robust, framework-agnostic in-memory data store.",
"version": "1.0.0-alpha.5-0",
"version": "1.0.0-alpha.5-1",
"homepage": "http://www.js-data.io",
"repository": {
"type": "git",
Expand Down
9 changes: 2 additions & 7 deletions src/datastore/index.js
Expand Up @@ -5,16 +5,11 @@ var asyncMethods = require('./async_methods');
var observe = require('../../lib/observe-js/observe-js');
var Schemator;

DSUtils.deepFreeze(syncMethods);
DSUtils.deepFreeze(asyncMethods);
DSUtils.deepFreeze(DSErrors);
DSUtils.deepFreeze(DSUtils);

function lifecycleNoopCb(resourceName, attrs, cb) {
function lifecycleNoopCb(resource, attrs, cb) {
cb(null, attrs);
}

function lifecycleNoop(resourceName, attrs) {
function lifecycleNoop(resource, attrs) {
return attrs;
}

Expand Down
6 changes: 4 additions & 2 deletions src/datastore/sync_methods/defineResource.js
Expand Up @@ -87,8 +87,10 @@ function defineResource(definition) {
});
});
}
DSUtils.deepFreeze(def.relations);
DSUtils.deepFreeze(def.relationList);
if (typeof Object.freeze === 'function') {
Object.freeze(def.relations);
Object.freeze(def.relationList);
}
}

def.getEndpoint = function (attrs, options) {
Expand Down
17 changes: 0 additions & 17 deletions src/utils.js
Expand Up @@ -306,23 +306,6 @@ module.exports = {
},
updateTimestamp: updateTimestamp,
Promise: _Promise,
deepFreeze: function deepFreeze(o) {
if (typeof Object.freeze === 'function' && typeof Object.isFrozen === 'function') {
var prop, propKey;
Object.freeze(o); // First freeze the object.
for (propKey in o) {
prop = o[propKey];
if (!prop || !o.hasOwnProperty(propKey) || typeof prop !== 'object' || Object.isFrozen(prop)) {
// If the object is on the prototype, not an object, or is already frozen,
// skip it. Note that this might leave an unfrozen reference somewhere in the
// object if there is an already frozen object containing an unfrozen object.
continue;
}

deepFreeze(prop); // Recursively call deepFreeze.
}
}
},
compute: function (fn, field, DSUtils) {
var _this = this;
var args = [];
Expand Down

0 comments on commit 2ef08ef

Please sign in to comment.