Skip to content

Commit ab5575c

Browse files
committed
Stable Version 3.0.0-beta.2.
1 parent f632242 commit ab5575c

17 files changed

+98
-14
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ bower_components/
2222
.idea/
2323

2424
build_examples/r.js/bundle.js
25+
build_examples/browserify/bundle.js
26+
build_examples/webpack/bundle.js

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
##### 3.0.0-beta.2 - 19 April 2015
2+
3+
Added examples of various build setups `./build_examples/`
4+
15
##### 3.0.0-beta.1 - 17 April 2015
26

7+
###### Backwards compatible API changes
8+
- #306 - Keep it DRY
9+
10+
###### Other
11+
- #314 - Switch to using peerDependencies
12+
313
##### 2.4.0 - 15 April 2015
414

515
###### Backwards compatible API changes

Gruntfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ module.exports = function (grunt) {
9696
},
9797
externals: {
9898
'js-data': {
99-
amd: 'JSData',
99+
amd: 'js-data',
100100
commonjs: 'js-data',
101101
commonjs2: 'js-data',
102102
root: 'JSData'

bower.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
"angular-mocks-1.1.5": "angular-mocks-unstable#1.1.5",
2626
"angular-mocks-1.2.16": "angular-mocks#1.2.16",
2727
"angular-mocks-1.2.25": "angular-mocks#1.2.25",
28-
"angular-mocks-1.3.2": "angular-mocks#1.3.2",
29-
"requirejs": "~2.1.17"
28+
"angular-mocks-1.3.2": "angular-mocks#1.3.2"
3029
},
3130
"dependencies": {
3231
"js-data": "2.0.0-beta.3",

build_examples/browserify/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
`browserify -x axios app.js > bundle.js` 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/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
<head>
44
<title>My App</title>
55
<!-- load scripts dynamically -->
6-
<!--<script data-main="main" src="../../bower_components/requirejs/require.js"></script>-->
6+
<script data-main="main" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.17/require.min.js"></script>
77

88
<!-- load bundled scripts -->
9-
<script data-main="bundle" src="../../bower_components/requirejs/require.js"></script>
9+
<!--<script data-main="bundle" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.17/require.min.js"></script>-->
1010
</head>
1111
<body ng-cloak>
1212
<h1>{{ test }}</h1>

build_examples/r.js/main.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ require.config({
22
paths: {
33
angular: '../../bower_components/angular/angular',
44
'js-data-angular': '../../dist/js-data-angular',
5-
'JSData': '../../bower_components/js-data/dist/js-data'
5+
'js-data': '../../bower_components/js-data/dist/js-data'
66
},
77
shim: {
88
'angular': {
@@ -13,8 +13,7 @@ require.config({
1313

1414
require([
1515
'angular',
16-
'app',
17-
'JSData'
16+
'app'
1817
], function (angular, app) {
1918
angular.element(document.getElementsByTagName('html')[0]).ready(function () {
2019
// bootstrap the app manually

build_examples/webpack/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
`browserify -x axios app.js > bundle.js` 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+
};

dist/js-data-angular.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* js-data-angular
3-
* @version 3.0.0-beta.1 - Homepage <https://www.js-data.io/docs/js-data-angular/>
3+
* @version 3.0.0-beta.2 - Homepage <https://www.js-data.io/docs/js-data-angular/>
44
* @author Jason Dobry <[email protected]>
55
* @copyright (c) 2014-2015 Jason Dobry
66
* @license MIT <https://github.com/js-data/js-data-angular/blob/master/LICENSE>
@@ -11,7 +11,7 @@
1111
if(typeof exports === 'object' && typeof module === 'object')
1212
module.exports = factory(require("js-data"), require("angular"), (function webpackLoadOptionalExternalModule() { try { return require("axios"); } catch(e) {} }()));
1313
else if(typeof define === 'function' && define.amd)
14-
define(["JSData", "angular"], function webpackLoadOptionalExternalModuleAmd(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {
14+
define(["js-data", "angular"], function webpackLoadOptionalExternalModuleAmd(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {
1515
return factory(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, root["axios"]);
1616
});
1717
else if(typeof exports === 'object')

dist/js-data-angular.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js-data-angular.min.map

+1-1
Large diffs are not rendered by default.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "js-data-angular",
33
"description": "Angular wrapper for js-data.",
4-
"version": "3.0.0-beta.1",
4+
"version": "3.0.0-beta.2",
55
"homepage": "http://www.js-data.io/docs/js-data-angular",
66
"repository": {
77
"type": "git",

0 commit comments

Comments
 (0)