Skip to content

Commit

Permalink
Stable Version 3.0.0-beta.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry committed Apr 20, 2015
1 parent f632242 commit ab5575c
Show file tree
Hide file tree
Showing 17 changed files with 98 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ bower_components/
.idea/

build_examples/r.js/bundle.js
build_examples/browserify/bundle.js
build_examples/webpack/bundle.js
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
##### 3.0.0-beta.2 - 19 April 2015

Added examples of various build setups `./build_examples/`

##### 3.0.0-beta.1 - 17 April 2015

###### Backwards compatible API changes
- #306 - Keep it DRY

###### Other
- #314 - Switch to using peerDependencies

##### 2.4.0 - 15 April 2015

###### Backwards compatible API changes
Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ module.exports = function (grunt) {
},
externals: {
'js-data': {
amd: 'JSData',
amd: 'js-data',
commonjs: 'js-data',
commonjs2: 'js-data',
root: 'JSData'
Expand Down
3 changes: 1 addition & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"angular-mocks-1.1.5": "angular-mocks-unstable#1.1.5",
"angular-mocks-1.2.16": "angular-mocks#1.2.16",
"angular-mocks-1.2.25": "angular-mocks#1.2.25",
"angular-mocks-1.3.2": "angular-mocks#1.3.2",
"requirejs": "~2.1.17"
"angular-mocks-1.3.2": "angular-mocks#1.3.2"
},
"dependencies": {
"js-data": "2.0.0-beta.3",
Expand Down
3 changes: 3 additions & 0 deletions build_examples/browserify/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
`browserify -x axios app.js > bundle.js` will produce `bundle.js`

Note the external dependency "axios" that is excluded from the build (it's not needed when using js-data-angular).
17 changes: 17 additions & 0 deletions build_examples/browserify/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// this is what you would do in a real app
// var angular = require('angular');

// for the example to work
var angular = require('../../node_modules/angular');

console.log(angular);

angular.module('app', [
// this is what you would do in a real app
// require('js-data-angular')

// for the example to work
require('../../dist/js-data-angular.js')
]).run(function (DS, DSVersion, $rootScope) {
$rootScope.test = 'It works! Using js-data ' + DSVersion.full;
});
11 changes: 11 additions & 0 deletions build_examples/browserify/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html ng-app="app">
<head>
<title>My App</title>
<!-- load bundled scripts -->
<script src="bundle.js"></script>
</head>
<body>
<h1>{{ test }}</h1>
</body>
</html>
4 changes: 2 additions & 2 deletions build_examples/r.js/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<head>
<title>My App</title>
<!-- load scripts dynamically -->
<!--<script data-main="main" src="../../bower_components/requirejs/require.js"></script>-->
<script data-main="main" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.17/require.min.js"></script>

<!-- load bundled scripts -->
<script data-main="bundle" src="../../bower_components/requirejs/require.js"></script>
<!--<script data-main="bundle" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.17/require.min.js"></script>-->
</head>
<body ng-cloak>
<h1>{{ test }}</h1>
Expand Down
5 changes: 2 additions & 3 deletions build_examples/r.js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require.config({
paths: {
angular: '../../bower_components/angular/angular',
'js-data-angular': '../../dist/js-data-angular',
'JSData': '../../bower_components/js-data/dist/js-data'
'js-data': '../../bower_components/js-data/dist/js-data'
},
shim: {
'angular': {
Expand All @@ -13,8 +13,7 @@ require.config({

require([
'angular',
'app',
'JSData'
'app'
], function (angular, app) {
angular.element(document.getElementsByTagName('html')[0]).ready(function () {
// bootstrap the app manually
Expand Down
3 changes: 3 additions & 0 deletions build_examples/webpack/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
`browserify -x axios app.js > bundle.js` will produce `bundle.js`

Note the external dependency "axios" that is excluded from the build (it's not needed when using js-data-angular).
17 changes: 17 additions & 0 deletions build_examples/webpack/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// this is what you would do in a real app
// var angular = require('angular');

// for the example to work
var angular = require('../../node_modules/angular');

console.log(angular);

angular.module('app', [
// this is what you would do in a real app
// require('js-data-angular')

// for the example to work
require('../../dist/js-data-angular.js')
]).run(function (DS, DSVersion, $rootScope) {
$rootScope.test = 'It works! Using js-data ' + DSVersion.full;
});
11 changes: 11 additions & 0 deletions build_examples/webpack/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html ng-app="app">
<head>
<title>My App</title>
<!-- load bundled scripts -->
<script src="bundle.js"></script>
</head>
<body>
<h1>{{ test }}</h1>
</body>
</html>
12 changes: 12 additions & 0 deletions build_examples/webpack/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
entry: './app.js',
output: {
filename: 'bundle.js'
},
externals: ['axios'],
resolve: {
alias: {
'js-data-angular': '../dist/js-data-angular.js'
}
}
};
4 changes: 2 additions & 2 deletions dist/js-data-angular.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* js-data-angular
* @version 3.0.0-beta.1 - Homepage <https://www.js-data.io/docs/js-data-angular/>
* @version 3.0.0-beta.2 - Homepage <https://www.js-data.io/docs/js-data-angular/>
* @author Jason Dobry <jason.dobry@gmail.com>
* @copyright (c) 2014-2015 Jason Dobry
* @license MIT <https://github.com/js-data/js-data-angular/blob/master/LICENSE>
Expand All @@ -11,7 +11,7 @@
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("js-data"), require("angular"), (function webpackLoadOptionalExternalModule() { try { return require("axios"); } catch(e) {} }()));
else if(typeof define === 'function' && define.amd)
define(["JSData", "angular"], function webpackLoadOptionalExternalModuleAmd(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {
define(["js-data", "angular"], function webpackLoadOptionalExternalModuleAmd(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {
return factory(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, root["axios"]);
});
else if(typeof exports === 'object')
Expand Down
4 changes: 2 additions & 2 deletions dist/js-data-angular.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js-data-angular.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "js-data-angular",
"description": "Angular wrapper for js-data.",
"version": "3.0.0-beta.1",
"version": "3.0.0-beta.2",
"homepage": "http://www.js-data.io/docs/js-data-angular",
"repository": {
"type": "git",
Expand Down

0 comments on commit ab5575c

Please sign in to comment.