Skip to content

2.0.0 #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 4, 2015
Merged

2.0.0 #198

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
##### 2.0.0-alpha.1-0 - xx December 2014
##### 2.0.0 - 03 February 2015

_Note:_ Please see the [js-data CHANGELOG](https://github.com/js-data/js-data/blob/master/CHANGELOG.md).

###### Breaking API changes
- Angular module renamed from `angular-data.DS` to `js-data`
- Refactored to be a wrapper for [js-data](https://github.com/js-data/js-data)
- `deserialize` and `serialize` are now properties of `DSHttpAdapter.defaults`
- All hooks (`validate`, `afterCreate`, `serialize`, etc.) now take the resource definition as the first argument instead of just the name of the resource
- `deserialize` and `serialize` are now configuration options used solely by the http adapter
- All hooks (`validate`, `afterCreate`, `serialize`, etc.) now take the actual resource definition as the first argument instead of just the name of the resource
- `DSLocalStorageAdapter` is no longer bundled, but is each separate from js-data-angular.
- The API for `bindOne` and `bindAll` has been changed to be more consistent with the rest of the API
- `eagerInject` has not yet been implemented in `js-data`.

##### Backwards compatible API changes
- GitHub project renamed to js-data-angular
- GitHub project moved to the js-data organization

###### Other
- #199 - Re-implement bindOne & bindAll in js-data-angular (they're missing from js-data)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 Jason Dobry
Copyright (c) 2014-2015 Jason Dobry

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
40 changes: 28 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
<img src="https://raw.githubusercontent.com/js-data/js-data/master/js-data.png" alt="js-data logo" title="js-data" align="right" width="64" height="64" />

## js-data-angular
## js-data-angular [![Bower version](https://badge.fury.io/bo/js-data-angular.png)](http://badge.fury.io/bo/js-data-angular) [![NPM version](https://badge.fury.io/js/js-data-angular.png)](http://badge.fury.io/js/js-data-angular)

Angular wrapper for [js-data](http://www.js-data.io).

#### What about Angular-data?
Documentation for Angular-data 1.x can be found at [angular-data.pseudobry.com](http://angular-data.pseudobry.com).

## API Documentation
[DS](http://www.js-data.io/docs/js-data-angular)

## Demo
[js-data-angular.firebaseapp.com/](https://js-data-angular.firebaseapp.com/)
#### What happened Angular-data?
Js-data-angular is Angular-data 2.0, with [js-data](http://www.js-data.io) as the framework-agnostic core. Documentation for Angular-data 1.x can be found at [angular-data.pseudobry.com](http://angular-data.pseudobry.com).

## Guides
- [Angular + JSData (js-data-angular)](http://www.js-data.io/docs/js-data-angular)
- [Getting Started with js-data](http://www.js-data.io/docs/home)
- [Resources/Models](http://www.js-data.io/docs/resources)
- [Working with the Data Store](http://www.js-data.io/docs/working-with-the-data-store)
- [Adapters](http://www.js-data.io/docs/working-with-adapters)
- [Model Lifecycle](http://www.js-data.io/docs/model-lifecycle)
- [Custom Instance Behavior](http://www.js-data.io/docs/custom-instance-behavior)
- [Computed Properties](http://www.js-data.io/docs/computed-properties)
- [Relations](http://www.js-data.io/docs/relations)
- [Schemata & Validation](http://www.js-data.io/docs/schemata--validation)
- [FAQ](http://www.js-data.io/docs/faq)

## Js-data-angular API Documentation
- [js-data-angular](http://www.js-data.io/docs/js-data-angular)
- [DS](http://www.js-data.io/docs/ds)
- [js-data-schema](http://www.js-data.io/docs/js-data-schema)
- [DSHttpAdapter](http://www.js-data.io/docs/dshttpadapter)
- [DSLocalStorageAdapter](http://www.js-data.io/docs/dslocalstorageadapter)
- [DSLocalForageAdapter](http://www.js-data.io/docs/dslocalforageadapter)
- [DSFirebaseAdapter](http://www.js-data.io/docs/dsfirebaseadapter)
- [DSRedisAdapter](http://www.js-data.io/docs/dsredisadapter)
- [DSRethinkDBAdapter](http://www.js-data.io/docs/dsrethinkdbadapter)

## Project Status

Expand All @@ -29,8 +47,6 @@ Documentation for Angular-data 1.x can be found at [angular-data.pseudobry.com](

Load `js-data-angular.js` after `js-data.js`.

__Note:__ You only have to use `js-data-http` if you want to use the `DSHttpAdapter`.

```js
angular.module('myApp', ['js-data']);
```
Expand Down Expand Up @@ -100,7 +116,7 @@ First, feel free to contact me with questions. [Mailing List](https://groups.io/

The MIT License (MIT)

Copyright (c) 2014 Jason Dobry
Copyright (c) 2014-2015 Jason Dobry

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
54 changes: 50 additions & 4 deletions TRANSITION.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
### 1.x ---> 2.x - 03 February 2015

#### Breaking API changes

##### Module name change

###### Before
`angular.module('myApp', ['angular-data.DS'])`

###### After
`angular.module('myApp', ['js-data'])`

##### `bindOne` and `bindAll` syntax change

###### Before
[bindOne](http://angular-data.pseudobry.com/documentation/api/angular-data/DS.sync%20methods_bindOne) and [bindAll](http://angular-data.pseudobry.com/documentation/api/angular-data/DS.sync%20methods_bindAll)

###### After
[bindOne](http://www.js-data.io/docs/js-data-angular#dsbindone) and [bindAll](http://www.js-data.io/docs/js-data-angular#dsbindall)

#### Backwards compatible API changes

##### Repo re-assignment and name change

###### Before
`https://github.com/jmdobry/angular-data.git`

###### After
`https://github.com/js-data/js-data-angular.git`

##### New Bower package

###### Before
`bower install --save angular-data`

###### After
`bower install --save js-data-angular`

##### New NPM package

###### Before
`npm install --save angular-data`

###### After
`npm install --save js-data js-data-angular`

### 0.9.x. ---> 0.10.x - 29 June 2014

#### Breaking API changes
Expand Down Expand Up @@ -64,17 +110,17 @@ DSProvider.defaults.filter = function (resourceName, where, attrs) {
DSProvider.defaults.filter = function (collection, resourceName, params, options) {
// examine params and
// decide whether to exclude items, skip items, start from an offset, or sort the items
// see the [default implementation that ships with js-data-angular](https://github.com/js-data/js-data-angular/blob/master/src/datastore/index.js#L12)

// see the [default implementation that ships with js-data-angular](https://github.com/js-data/js-data-angular/blob/master/src/datastore/index.js#L12)
// overriding this method is useful when our server only understands a certain
// params format and you want js-data-angular's filter to behave the same as your server

// js-data-angular looks for the following fields:
// - where
// - skip (or offset)
// - limit
// - orderBy (or sort)

// return the filtered collection
};
```
Expand Down
10 changes: 3 additions & 7 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"author": "Jason Dobry",
"name": "js-data-angular",
"description": "Angular wrapper for js-data (originally angular-data).",
"version": "2.0.0-alpha.3-3",
"homepage": "http://www.js-data.io/docs/js-data-angular",
"repository": {
"type": "git",
"url": "https://github.com/js-data/js-data-angular.git"
},
"main": "./dist/js-data-angular.min.js",
"main": "./dist/js-data-angular.js",
"ignore": [
".idea/",
".*",
Expand All @@ -29,10 +28,7 @@
"angular-mocks-1.3.2": "angular-mocks#1.3.2"
},
"dependencies": {
"js-data": "~1.0.x",
"angular": "~1.x"
},
"resolutions": {
"angular": "1.3.2"
"js-data": ">=1.0.0",
"angular": ">=1.0.3"
}
}
31 changes: 17 additions & 14 deletions dist/js-data-angular.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @author Jason Dobry <[email protected]>
* @file js-data-angular.js
* @version 2.0.0-alpha.3-3 - Homepage <http://www.js-data.io/js-data-angular/>
* @version 2.0.0 - Homepage <http://www.js-data.io/js-data-angular/>
* @copyright (c) 2014 Jason Dobry <https://github.com/jmdobry/>
* @license MIT <https://github.com/js-data/js-data-angular/blob/master/LICENSE>
*
Expand Down Expand Up @@ -216,16 +216,21 @@
DSUtils.Promise = QPromise;

// Register any adapters that have been loaded
for (var i = 0; i < adapters.length; i++) {
if (adapters[i].loaded) {
store.registerAdapter(adapters[i].name, arguments[i]);
if (args.length) {
for (var i = 0; i < args.length; i++) {
for (var j = 0; j < adapters.length; j++) {
if (adapters[j].loaded && !adapters[j].registered) {
adapters[j].registered = true;
store.registerAdapter(adapters[j].name, args[i]);
}
}
}
}

// Wrap certain sync functions with $apply
for (i = 0; i < functionsToWrap.length; i++) {
originals[functionsToWrap[i]] = store[functionsToWrap[i]];
store[functionsToWrap[i]] = (function (name) {
for (var k = 0; k < functionsToWrap.length; k++) {
originals[functionsToWrap[k]] = store[functionsToWrap[k]];
store[functionsToWrap[k]] = (function (name) {
return function () {
var args = arguments;
if (!$rootScope.$$phase) {
Expand All @@ -235,16 +240,14 @@
}
return originals[name].apply(store, args);
};
})(functionsToWrap[i]);
})(functionsToWrap[k]);
}

// Hook into the digest loop (throttled)
if (typeof Object.observe !== 'function' ||
typeof Array.observe !== 'function') {
// Hook into the digest loop
if (typeof Object.observe !== 'function' || typeof Array.observe !== 'function') {
$rootScope.$watch(function () {
// Throttle angular-data's digest loop to tenths of a second
return new Date().getTime() / 100 | 0;
}, store.observe.Platform.performMicrotaskCheckpoint);
store.observe.Platform.performMicrotaskCheckpoint();
});
}

return store;
Expand Down
Loading