Skip to content

Commit

Permalink
build 0.0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Feb 2, 2015
1 parent d0c2bb7 commit f983d95
Show file tree
Hide file tree
Showing 22 changed files with 284 additions and 154 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,16 @@
<a name="0.0.12"></a>
### 0.0.13 (2015-02-02)

This release comes 2 days after 0.0.12 and fixes a couple of bugs

#### Bug Fixes

* **future:** fix modular build of futurestates ([abfdc34d](https://github.com/christopherthielen/ui-router-extras/commit/abfdc34d41afea34ca8cccd3db5f81bb3a856eb4), closes [#151](https://github.com/christopherthielen/ui-router-extras/issues/151))
* **statevis:** add dep from statevis to sticky ([1a488d84](https://github.com/christopherthielen/ui-router-extras/commit/1a488d84257060868f3c70b6ef7305f4936212eb), closes [#153](https://github.com/christopherthielen/ui-router-extras/issues/153))
* **sticky:** Fix modular sticky states build ([21d1d129](https://github.com/christopherthielen/ui-router-extras/commit/21d1d129963b8bfc724823f93ca0efc32868ec77), closes [#154](https://github.com/christopherthielen/ui-router-extras/issues/154))
* **transition:** transition promise now resolved correctly ([598452ed](https://github.com/christopherthielen/ui-router-extras/commit/598452ed5bae76b8add8707794740993d3242011), closes [#152](https://github.com/christopherthielen/ui-router-extras/issues/152))


<a name="0.0.12"></a>
### 0.0.12 (2015-01-31)

Expand Down
14 changes: 14 additions & 0 deletions banners.json
@@ -0,0 +1,14 @@
{
"banner": [
"/**\n",
" * UI-Router Extras: Sticky states, Future States, Deep State Redirect, Transition promise",
" * <%= module %>",
" * @version <%= pkg.version %>",
" * @link http://christopherthielen.github.io/ui-router-extras/",
" * @license MIT License, http://www.opensource.org/licenses/MIT",
" */"
],
"minbanner": [
"/** UI-Router Extras v.<%= pkg.version %> <%= module %> http://christopherthielen.github.io/ui-router-extras/ - MIT License */"
]
}
4 changes: 2 additions & 2 deletions bower.json
@@ -1,8 +1,8 @@
{
"name": "ui-router-extras",
"version": "0.0.12",
"version": "0.0.13",
"authors": [
"Chris Thielen <ui-router-extras@sandgnat.com>"
"Chris Thielen <christopherthielen@ikkyikkyikkypikangzoopboing.com>"
],
"description": "Extras for UI-Router including: Sticky States (a.k.a. parallel states), Deep State Redirect (for tab-like navigation), Future States (async state definition), Previous State ",
"keywords": [
Expand Down
6 changes: 4 additions & 2 deletions files.js
Expand Up @@ -20,10 +20,9 @@ var modules = _(moduleNames)
// sticky states has two src files
modules.sticky.src = ['src/stickyProvider.js'].concat(modules.sticky.src);
modules.core.src.push('src/util.js');

modules.future.test.push('src/fsfactories/ngload.js');
modules.future.test.push('src/fsfactories/iframe.js');
modules.statevis.test.push('build/modular/ct-ui-router-extras.sticky.js');
modules.previous.test.push('build/modular/ct-ui-router-extras.transition.js');

// Build the monolithic module 'all' which sucks in all the others
modules.all = {
Expand All @@ -38,6 +37,9 @@ modules.all = {
dest: 'build'
};

modules.statevis.test.push('build/modular/ct-ui-router-extras.sticky.js');
modules.previous.test.push('build/modular/ct-ui-router-extras.transition.js');


var otherFiles = {
testUtil: [ 'test/testUtil.js', 'bower_components/lodash/dist/lodash.js'],
Expand Down
15 changes: 3 additions & 12 deletions gulpfile.js
Expand Up @@ -8,18 +8,9 @@ var gulp = require('gulp'),
_ = require('lodash'),
notify = require('gulp-notify'),
uirExtrasModules = require('./files'),
banners = require('./banners.json'),
pkg = require('./package.json');


var banner = "" +
"/**\n" +
" * UI-Router Extras: Sticky states, Future States, Deep State Redirect, Transition promise\n" +
" * <%= module %>\n" +
" * @version <%= pkg.version %>\n" +
" * @link http://christopherthielen.github.io/ui-router-extras/\n" +
" * @license MIT License, http://www.opensource.org/licenses/MIT\n" +
" */";
var minbanner = "/** UI-Router Extras v.<%= pkg.version %> <%= module %> http://christopherthielen.github.io/ui-router-extras/ - MIT License */\n";
// Scripts
gulp.task('scripts', ['clean'], function() {
var jshint = require('gulp-jshint'),
Expand All @@ -35,12 +26,12 @@ gulp.task('scripts', ['clean'], function() {
.pipe(jshint.reporter('default'))
.pipe(concat(module.dist))
.pipe(wrap('(function(angular, undefined){\n"use strict";\n<%= contents %>\n})(angular);'))
.pipe(wrap(banner + '\n<%= contents %>\n', { pkg: pkg, module: description }))
.pipe(wrap(banners.banner.join("\n") + '\n<%= contents %>\n', { pkg: pkg, module: description }))
// .pipe(wrap('/* ' + module.dist + ' v.' + pkg.version + '*/\n<%= contents %>\n', { pkg: pkg, module: module }))
.pipe(gulp.dest(module.dest))
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(wrap(minbanner + '\n<%= contents %>\n', { pkg: pkg, module: description }))
.pipe(wrap(banners.minbanner.join("\n") + '\n<%= contents %>\n', { pkg: pkg, module: description }))
.pipe(gulp.dest(module.dest))
.pipe(notify({message: 'built ' + module.module}))
;
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"author": "Christopher Thielen",
"name": "ui-router-extras",
"version": "0.0.12",
"version": "0.0.13",
"description": "UI-Router Extras: Sticky states, Future States, Deep State Redirect, Transition promise",
"homepage": "http://christopherthielen.github.io/ui-router-extras/",
"dependencies": {},
Expand Down
157 changes: 92 additions & 65 deletions release/ct-ui-router-extras.js
@@ -1,3 +1,11 @@
/**
* UI-Router Extras: Sticky states, Future States, Deep State Redirect, Transition promise
* Monolithic build (all modules)
* @version 0.0.13
* @link http://christopherthielen.github.io/ui-router-extras/
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
(function(angular, undefined){
"use strict";
var mod_core = angular.module("ct.ui.router.extras.core", [ "ui.router" ]);
Expand Down Expand Up @@ -337,8 +345,13 @@ angular.module("ct.ui.router.extras.sticky", [ 'ct.ui.router.extras.core' ]);

var mod_sticky = angular.module("ct.ui.router.extras.sticky");

$StickyStateProvider.$inject = [ '$stateProvider' ];
function $StickyStateProvider($stateProvider) {
$StickyStateProvider.$inject = [ '$stateProvider', 'uirextras_coreProvider' ];
function $StickyStateProvider($stateProvider, uirextras_coreProvider) {
var core = uirextras_coreProvider;
var inheritParams = core.inheritParams;
var protoKeys = core.protoKeys;
var map = core.map;

// Holds all the states which are inactivated. Inactivated states can be either sticky states, or descendants of sticky states.
var inactiveStates = {}; // state.name -> (state)
var stickyStates = {}; // state.name -> true
Expand Down Expand Up @@ -721,7 +734,12 @@ angular.module("ct.ui.router.extras.sticky").run(["$stickyState", function ($sti
angular.module("ct.ui.router.extras.sticky").config(
[ "$provide", "$stateProvider", '$stickyStateProvider', '$urlMatcherFactoryProvider', 'uirextras_coreProvider',
function ($provide, $stateProvider, $stickyStateProvider, $urlMatcherFactoryProvider, uirextras_coreProvider) {
var internalStates = uirextras_coreProvider.internalStates;
var core = uirextras_coreProvider;
var internalStates = core.internalStates;
var inherit = core.inherit;
var inheritParams = core.inheritParams;
var map = core.map;
var filterObj = core.filterObj;

versionHeuristics.hasParamSet = !!$urlMatcherFactoryProvider.ParamSet;
// inactivePseudoState (__inactives) holds all the inactive locals which includes resolved states data, i.e., views, scope, etc
Expand Down Expand Up @@ -1085,76 +1103,83 @@ angular.module("ct.ui.router.extras.sticky").config(
};
return $state;
}]);
}
]
);

function debugTransition($log, currentTransition, stickyTransition) {
function message(path, index, state) {
return (path[index] ? path[index].toUpperCase() + ": " + state.self.name : "(" + state.self.name + ")");
}

var inactiveLogVar = map(stickyTransition.inactives, function (state) {
return state.self.name;
});
var enterLogVar = map(currentTransition.toState.path, function (state, index) {
return message(stickyTransition.enter, index, state);
});
var exitLogVar = map(currentTransition.fromState.path, function (state, index) {
return message(stickyTransition.exit, index, state);
});

var transitionMessage = currentTransition.fromState.self.name + ": " +
angular.toJson(currentTransition.fromParams) + ": " +
" -> " +
currentTransition.toState.self.name + ": " +
angular.toJson(currentTransition.toParams);

$log.debug(" Current transition: ", transitionMessage);
$log.debug("Before transition, inactives are: : ", map(_StickyState.getInactiveStates(), function (s) {
return s.self.name;
}));
$log.debug("After transition, inactives will be: ", inactiveLogVar);
$log.debug("Transition will exit: ", exitLogVar);
$log.debug("Transition will enter: ", enterLogVar);
}
function debugTransition($log, currentTransition, stickyTransition) {
function message(path, index, state) {
return (path[index] ? path[index].toUpperCase() + ": " + state.self.name : "(" + state.self.name + ")");
}

function debugViewsAfterSuccess($log, currentState, $state) {
$log.debug("Current state: " + currentState.self.name + ", inactive states: ", map(_StickyState.getInactiveStates(), function (s) {
return s.self.name;
}));
var inactiveLogVar = map(stickyTransition.inactives, function (state) {
return state.self.name;
});
var enterLogVar = map(currentTransition.toState.path, function (state, index) {
return message(stickyTransition.enter, index, state);
});
var exitLogVar = map(currentTransition.fromState.path, function (state, index) {
return message(stickyTransition.exit, index, state);
});

var viewMsg = function (local, name) {
return "'" + name + "' (" + local.$$state.name + ")";
};
var statesOnly = function (local, name) {
return name != 'globals' && name != 'resolve';
};
var viewsForState = function (state) {
var views = map(filterObj(state.locals, statesOnly), viewMsg).join(", ");
return "(" + (state.self.name ? state.self.name : "root") + ".locals" + (views.length ? ": " + views : "") + ")";
};
var transitionMessage = currentTransition.fromState.self.name + ": " +
angular.toJson(currentTransition.fromParams) + ": " +
" -> " +
currentTransition.toState.self.name + ": " +
angular.toJson(currentTransition.toParams);

$log.debug(" Current transition: ", transitionMessage);
$log.debug("Before transition, inactives are: : ", map(_StickyState.getInactiveStates(), function (s) {
return s.self.name;
}));
$log.debug("After transition, inactives will be: ", inactiveLogVar);
$log.debug("Transition will exit: ", exitLogVar);
$log.debug("Transition will enter: ", enterLogVar);
}

var message = viewsForState(currentState);
var parent = currentState.parent;
while (parent && parent !== currentState) {
if (parent.self.name === "") {
// Show the __inactives before showing root state.
message = viewsForState($state.$current.path[0]) + " / " + message;
}
message = viewsForState(parent) + " / " + message;
currentState = parent;
parent = currentState.parent;
}
function debugViewsAfterSuccess($log, currentState, $state) {
$log.debug("Current state: " + currentState.self.name + ", inactive states: ", map(_StickyState.getInactiveStates(), function (s) {
return s.self.name;
}));

var viewMsg = function (local, name) {
return "'" + name + "' (" + local.$$state.name + ")";
};
var statesOnly = function (local, name) {
return name != 'globals' && name != 'resolve';
};
var viewsForState = function (state) {
var views = map(filterObj(state.locals, statesOnly), viewMsg).join(", ");
return "(" + (state.self.name ? state.self.name : "root") + ".locals" + (views.length ? ": " + views : "") + ")";
};

var message = viewsForState(currentState);
var parent = currentState.parent;
while (parent && parent !== currentState) {
if (parent.self.name === "") {
// Show the __inactives before showing root state.
message = viewsForState($state.$current.path[0]) + " / " + message;
}
message = viewsForState(parent) + " / " + message;
currentState = parent;
parent = currentState.parent;
}

$log.debug("Views: " + message);
}

$log.debug("Views: " + message);
}


}
]
);

(function(angular, undefined) {
var app = angular.module('ct.ui.router.extras.future', [ 'ct.ui.router.extras.core' ]);

function _futureStateProvider($stateProvider, $urlRouterProvider, $urlMatcherFactory) {
_futureStateProvider.$inject = [ '$stateProvider', '$urlRouterProvider', '$urlMatcherFactoryProvider', 'uirextras_coreProvider' ];
function _futureStateProvider($stateProvider, $urlRouterProvider, $urlMatcherFactory, uirextras_coreProvider) {
var core = uirextras_coreProvider;
var internalStates = core.internalStates;
var stateFactories = {}, futureStates = {};
var lazyloadInProgress = false, resolveFunctions = [], initPromise, initDone = false;
var provider = this;
Expand Down Expand Up @@ -1418,7 +1443,7 @@ function debugViewsAfterSuccess($log, currentState, $state) {
];
}

app.provider('$futureState', [ '$stateProvider', '$urlRouterProvider', '$urlMatcherFactoryProvider', _futureStateProvider]);
app.provider('$futureState', _futureStateProvider);

var statesAddedQueue = {
state: function(state) {
Expand Down Expand Up @@ -1541,7 +1566,8 @@ angular.module("ct.ui.router.extras.transition", [ 'ct.ui.router.extras.core' ])
return function successFn(data) {
popStack();
$rootScope.$broadcast("$transitionSuccess", tSuccess);
return deferred.resolve(data);
deferred.resolve(data); // $transition$ deferred
return data;
};
}

Expand All @@ -1551,7 +1577,8 @@ angular.module("ct.ui.router.extras.transition", [ 'ct.ui.router.extras.core' ])
return function failureFn(error) {
popStack();
$rootScope.$broadcast("$transitionError", tFail, error);
return deferred.reject(error);
deferred.reject(error); // $transition$ deferred
return $q.reject(error);
};
}

Expand Down Expand Up @@ -1596,7 +1623,7 @@ angular.module("ct.ui.router.extras.transition", [ 'ct.ui.router.extras.core' ])
// statevis requires d3.
(function () {
"use strict";
var app = angular.module("ct.ui.router.extras.statevis", [ 'ct.ui.router.extras.core' ]);
var app = angular.module("ct.ui.router.extras.statevis", [ 'ct.ui.router.extras.core', 'ct.ui.router.extras.sticky' ]);

app.directive('stateVis', [ '$state', '$timeout', '$interval', stateVisDirective ]);

Expand Down
3 changes: 2 additions & 1 deletion release/ct-ui-router-extras.min.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions release/modular/ct-ui-router-extras.core.js
@@ -1,3 +1,11 @@
/**
* UI-Router Extras: Sticky states, Future States, Deep State Redirect, Transition promise
* Module: core
* @version 0.0.13
* @link http://christopherthielen.github.io/ui-router-extras/
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
(function(angular, undefined){
"use strict";
var mod_core = angular.module("ct.ui.router.extras.core", [ "ui.router" ]);
Expand Down
1 change: 1 addition & 0 deletions release/modular/ct-ui-router-extras.core.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions release/modular/ct-ui-router-extras.dsr.js
@@ -1,3 +1,11 @@
/**
* UI-Router Extras: Sticky states, Future States, Deep State Redirect, Transition promise
* Module: dsr
* @version 0.0.13
* @link http://christopherthielen.github.io/ui-router-extras/
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
(function(angular, undefined){
"use strict";
var ignoreDsr;
Expand Down
1 change: 1 addition & 0 deletions release/modular/ct-ui-router-extras.dsr.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f983d95

Please sign in to comment.