Skip to content

Commit c3d47b0

Browse files
committed
Merge pull request #329 from js-data/3.0
3.0
2 parents 72e3105 + 65dbe3e commit c3d47b0

34 files changed

+701
-700
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ bower_components/
2020

2121
*.iml
2222
.idea/
23+
24+
build_examples/r.js/bundle.js
25+
build_examples/browserify/bundle.js
26+
build_examples/webpack/bundle.js
27+
build_examples/webpack_es6/bundle.js
28+
build_examples/webpack_es6_2/bundle.js

CHANGELOG.md

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
##### 3.0.0 - 02 July 2015
2+
3+
Stable Version 3.0.0
4+
5+
##### 3.0.0-rc.1 - 28 June 2015
6+
7+
Stable Version 3.0.0-rc.1
8+
9+
##### 3.0.0-beta.2 - 19 April 2015
10+
11+
Added examples of various build setups `./build_examples/`
12+
13+
##### 3.0.0-beta.1 - 17 April 2015
14+
15+
###### Backwards compatible API changes
16+
- #306 - Keep it DRY
17+
18+
###### Other
19+
- #314 - Switch to using peerDependencies
20+
121
##### 2.4.0 - 15 April 2015
222

323
###### Backwards compatible API changes

Gruntfile.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ module.exports = function (grunt) {
7272
files: [
7373
'bower_components/angular-1.3.2/angular.js',
7474
'bower_components/angular-mocks-1.3.2/angular-mocks.js',
75-
'bower_components/js-data/dist/js-data.js',
75+
'node_modules/js-data/dist/js-data.min.js',
7676
'dist/js-data-angular.min.js',
7777
'karma.start.js',
7878
'test/**/*.js'
@@ -87,10 +87,11 @@ module.exports = function (grunt) {
8787
},
8888
webpack: {
8989
dist: {
90+
debug: true,
9091
entry: './src/index.js',
9192
output: {
9293
filename: './dist/js-data-angular.js',
93-
libraryTarget: 'umd',
94+
libraryTarget: 'umd2',
9495
library: 'jsDataAngularModuleName'
9596
},
9697
externals: {
@@ -100,11 +101,12 @@ module.exports = function (grunt) {
100101
commonjs2: 'js-data',
101102
root: 'JSData'
102103
},
104+
'axios': 'axios',
103105
'angular': 'angular'
104106
},
105107
module: {
106108
loaders: [
107-
{ test: /(.+)\.js$/, exclude: /node_modules/, loader: 'babel-loader?blacklist=useStrict' }
109+
{ test: /(.+)\.js$/, loader: 'babel-loader?blacklist=useStrict' }
108110
],
109111
preLoaders: [
110112
{

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Angular wrapper for [js-data](http://www.js-data.io).
66

77
#### What happened Angular-data?
8-
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).
8+
Angular-data is deprecated. js-data + js-data-angular is the new hotness.
99

1010
### Guides
1111
- [Angular + JSData (js-data-angular)](http://www.js-data.io/docs/js-data-angular)
@@ -41,7 +41,7 @@ __Latest Release:__ [![Latest Release](https://img.shields.io/github/release/js-
4141

4242
__Status:__
4343

44-
[![Dependency Status](https://img.shields.io/gemnasium/js-data/js-data-angular.svg?style=flat-square)](https://gemnasium.com/js-data/js-data-angular) [![Coverage Status](https://img.shields.io/coveralls/js-data/js-data-angular/master.svg?style=flat-square)](https://coveralls.io/r/js-data/js-data-angular?branch=master) [![Codacity](https://img.shields.io/codacy/e7690b906dfa471ebcc8b2bdc52e9662.svg?style=flat-square)](https://www.codacy.com/public/jasondobry/js-data-angular/dashboard)
44+
[![Dependency Status](https://img.shields.io/gemnasium/js-data/js-data-angular.svg?style=flat-square)](https://gemnasium.com/js-data/js-data-angular) [![Coverage Status](https://img.shields.io/coveralls/js-data/js-data-angular/master.svg?style=flat-square)](https://coveralls.io/r/js-data/js-data-angular?branch=master) [![Codacity](https://img.shields.io/codacy/e7690b906dfa471ebcc8b2bdc52e9662.svg?style=flat-square)](https://www.codacy.com/public/jasondobry/js-data-angular/dashboard)
4545

4646
__Supported Platforms:__
4747

@@ -99,6 +99,8 @@ app.controller('postCtrl', function ($scope, $routeParams, Post, Comment) {
9999
[CHANGELOG.md](https://github.com/js-data/js-data-angular/blob/master/CHANGELOG.md)
100100

101101
### Community
102+
- [Gitter Channel](https://gitter.im/js-data/js-data) - Better than IRC!
103+
- [Announcements](http://www.js-data.io/blog)
102104
- [Mailing List](https://groups.io/org/groupsio/jsdata) - Ask your questions!
103105
- [Issues](https://github.com/js-data/js-data-angular/issues) - Found a bug? Feature request? Submit an issue!
104106
- [GitHub](https://github.com/js-data/js-data-angular) - View the source code for js-data.

bower.json

+2-10
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,12 @@
1818
"package.json"
1919
],
2020
"devDependencies": {
21-
"angular-1.1.5": "angular-unstable#1.1.5",
22-
"angular-1.2.16": "angular#1.2.16",
23-
"angular-1.2.25": "angular#1.2.25",
2421
"angular-1.3.2": "angular#1.3.2",
25-
"angular-mocks-1.1.5": "angular-mocks-unstable#1.1.5",
26-
"angular-mocks-1.2.16": "angular-mocks#1.2.16",
27-
"angular-mocks-1.2.25": "angular-mocks#1.2.25",
2822
"angular-mocks-1.3.2": "angular-mocks#1.3.2"
2923
},
3024
"dependencies": {
31-
"js-data": ">=1.5.7",
25+
"js-data": ">=2.0.0",
26+
"js-data-http": ">=2.0.0",
3227
"angular": ">=1.1.0"
33-
},
34-
"resolutions": {
35-
"angular": "1.3.2"
3628
}
3729
}

build_examples/browserify/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Running `browserify -x axios app.js > bundle.js` in this directory will produce `bundle.js`
2+
3+
Note the external dependency "axios" that is excluded from the build (it's not needed when using js-data-angular).

build_examples/browserify/app.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// this is what you would do in a real app
2+
// var angular = require('angular');
3+
4+
// for the example to work
5+
var angular = require('../../node_modules/angular');
6+
7+
console.log(angular);
8+
9+
angular.module('app', [
10+
// this is what you would do in a real app
11+
// require('js-data-angular')
12+
13+
// for the example to work
14+
require('../../dist/js-data-angular.js')
15+
]).run(function (DS, DSVersion, $rootScope) {
16+
$rootScope.test = 'It works! Using js-data ' + DSVersion.full;
17+
});

build_examples/browserify/index.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html ng-app="app">
3+
<head>
4+
<title>My App</title>
5+
<!-- load bundled scripts -->
6+
<script src="bundle.js"></script>
7+
</head>
8+
<body>
9+
<h1>{{ test }}</h1>
10+
</body>
11+
</html>

build_examples/r.js/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Running `r.js -o require.config.js` in this directory will produce `bundle.js`
2+
3+
In `index.html` switch `script/main` between `main` (load scripts dynamically) and `bundle` (load bundled scripts)

build_examples/r.js/app.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
define('app', [
2+
'angular',
3+
'js-data-angular'
4+
], function (angular, jsDataModuleName) {
5+
return angular.module('app', [jsDataModuleName])
6+
.run(function (DS, DSVersion, $rootScope) {
7+
$rootScope.test = 'It works! Using js-data ' + DSVersion.full;
8+
});
9+
});

build_examples/r.js/index.html

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>My App</title>
5+
<!-- load scripts dynamically -->
6+
<script data-main="main" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.17/require.min.js"></script>
7+
8+
<!-- load bundled scripts -->
9+
<!--<script data-main="bundle" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.17/require.min.js"></script>-->
10+
</head>
11+
<body ng-cloak>
12+
<h1>{{ test }}</h1>
13+
</body>
14+
</html>

build_examples/r.js/main.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
require.config({
2+
paths: {
3+
angular: '../../bower_components/angular/angular',
4+
'js-data-angular': '../../dist/js-data-angular',
5+
'js-data': '../../bower_components/js-data/dist/js-data'
6+
},
7+
shim: {
8+
'angular': {
9+
exports: 'angular'
10+
}
11+
}
12+
});
13+
14+
require([
15+
'angular',
16+
'app'
17+
], function (angular, app) {
18+
angular.element(document.getElementsByTagName('html')[0]).ready(function () {
19+
// bootstrap the app manually
20+
angular.bootstrap(document, ['app']);
21+
});
22+
}
23+
);

build_examples/r.js/require.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
({
2+
name: 'main',
3+
mainConfigFile: 'main.js',
4+
out: 'bundle.js',
5+
optimize: 'none'
6+
})

build_examples/webpack/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Running `webpack` in this directory will produce `bundle.js`
2+
3+
Note the external dependency "axios" that is excluded from the build (it's not needed when using js-data-angular).

build_examples/webpack/app.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// this is what you would do in a real app
2+
// var angular = require('angular');
3+
4+
// for the example to work
5+
var angular = require('../../node_modules/angular');
6+
7+
console.log(angular);
8+
9+
angular.module('app', [
10+
// this is what you would do in a real app
11+
// require('js-data-angular')
12+
13+
// for the example to work
14+
require('../../dist/js-data-angular.js')
15+
]).run(function (DS, DSVersion, $rootScope) {
16+
$rootScope.test = 'It works! Using js-data ' + DSVersion.full;
17+
});

build_examples/webpack/index.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html ng-app="app">
3+
<head>
4+
<title>My App</title>
5+
<!-- load bundled scripts -->
6+
<script src="bundle.js"></script>
7+
</head>
8+
<body>
9+
<h1>{{ test }}</h1>
10+
</body>
11+
</html>
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
entry: './app.js',
3+
output: {
4+
filename: 'bundle.js'
5+
},
6+
externals: ['axios'],
7+
resolve: {
8+
alias: {
9+
'js-data-angular': '../dist/js-data-angular.js'
10+
}
11+
}
12+
};

build_examples/webpack_es6/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Running `webpack` in this directory will produce `bundle.js`
2+
3+
Note the external dependency "axios" that is excluded from the build (it's not needed when using js-data-angular).

build_examples/webpack_es6/app.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import angular from 'angular';
2+
import jsDataModuleName from 'js-data-angular';
3+
4+
angular.module('app', [
5+
jsDataModuleName
6+
]).run((DS, DSVersion, $rootScope) => {
7+
$rootScope.test = 'It works! Using js-data ' + DSVersion.full;
8+
});

build_examples/webpack_es6/index.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html ng-app="app">
3+
<head>
4+
<title>My App</title>
5+
<!-- load bundled scripts -->
6+
<script src="bundle.js"></script>
7+
</head>
8+
<body>
9+
<h1>{{ test }}</h1>
10+
</body>
11+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
entry: './app.js',
3+
output: {
4+
filename: 'bundle.js'
5+
},
6+
externals: ['axios'],
7+
resolve: {
8+
alias: {
9+
'js-data-angular': '../../dist/js-data-angular.js'
10+
}
11+
},
12+
module: {
13+
loaders: [
14+
{ test: /(.+)\.js$/, loader: 'babel-loader?blacklist=useStrict' }
15+
]
16+
}
17+
};
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Running `webpack` in this directory will produce `bundle.js`
2+
3+
Note the external dependency "axios" that is excluded from the build (it's not needed when using js-data-angular).

build_examples/webpack_es6_2/app.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import 'angular';
2+
import 'js-data-angular';
3+
4+
angular.module('app', [
5+
'js-data'
6+
]).run((DS, DSVersion, $rootScope) => {
7+
$rootScope.test = 'It works! Using js-data ' + DSVersion.full;
8+
});
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html ng-app="app">
3+
<head>
4+
<title>My App</title>
5+
<!-- load bundled scripts -->
6+
<script src="bundle.js"></script>
7+
</head>
8+
<body>
9+
<h1>{{ test }}</h1>
10+
</body>
11+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
entry: './app.js',
3+
output: {
4+
filename: 'bundle.js'
5+
},
6+
externals: ['axios'],
7+
resolve: {
8+
alias: {
9+
'js-data-angular': '../../dist/js-data-angular.js'
10+
}
11+
},
12+
module: {
13+
loaders: [
14+
{ test: /(.+)\.js$/, loader: 'babel-loader?blacklist=useStrict' }
15+
]
16+
}
17+
};

0 commit comments

Comments
 (0)