Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: angular-ui/ui-router
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.6
Choose a base ref
...
head repository: angular-ui/ui-router
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.0.7
Choose a head ref
  • 8 commits
  • 8 files changed
  • 1 contributor

Commits on Aug 13, 2017

  1. Copy the full SHA
    450f548 View commit details
  2. Copy the full SHA
    61f7dfe View commit details

Commits on Sep 30, 2017

  1. Copy the full SHA
    6b690bd View commit details
  2. Copy the full SHA
    2f7a3f2 View commit details
  3. Copy the full SHA
    54e40b1 View commit details
  4. Copy the full SHA
    2741a6f View commit details
  5. 1.0.7

    christopherthielen committed Sep 30, 2017
    Copy the full SHA
    9ed25de View commit details
  6. Release 1.0.7

    christopherthielen committed Sep 30, 2017
    Copy the full SHA
    03d9234 View commit details
Showing with 757 additions and 126 deletions.
  1. +29 −0 CHANGELOG.md
  2. +1 −1 bower.json
  3. +15 −14 package.json
  4. +48 −28 rollup.config.js
  5. +3 −2 src/interface.ts
  6. +14 −0 test/stateSpec.js
  7. +1 −1 tsconfig.json
  8. +646 −80 yarn.lock
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
## 1.0.7 (2017-09-30)
[Compare `@uirouter/angularjs` versions 1.0.6 and 1.0.7](https://github.com/angular-ui/ui-router/compare/1.0.6...1.0.7)

### Bug Fixes

* **typings:** Allow views: { foo: 'string' } in Ng1StateDeclaration ([2f7a3f2](https://github.com/angular-ui/ui-router/commit/2f7a3f2))

### Updated `@uirouter/core` from 5.0.6 to 5.0.8 (2017-09-30)
[Compare `@uirouter/core` versions 5.0.6 and 5.0.8](https://github.com/ui-router/core/compare/5.0.6...5.0.8)

### Bug Fixes

* **bundle:** Rollup: Do not warn on THIS_IS_UNDEFINED ([a4581b1](https://github.com/ui-router/core/commit/a4581b1))
* **globals:** Use shallow copy to update the globals.params / $state.params object ([e883afc](https://github.com/ui-router/core/commit/e883afc))
* **Injector:** When getting tokens from native injector, only throw on undefined (not on falsey values) ([ada9ca2](https://github.com/ui-router/core/commit/ada9ca2))
* **redirectTo:** Fix typings for redirectTo. Allow a function that returns a target state or a promise for one. ([3904487](https://github.com/ui-router/core/commit/3904487))
* **trace:** Fall back to console.log if .table is unavailable (IE) ([c8110fc](https://github.com/ui-router/core/commit/c8110fc))
* **trace:** Support tracing of object-parameters with circular references ([2f1ae9a](https://github.com/ui-router/core/commit/2f1ae9a))
* **url:** Add CustomEvent polyfill for IE ([a50db21](https://github.com/ui-router/core/commit/a50db21))
* **vanilla:** fix base path handling for vanilla push state ([ad61d74](https://github.com/ui-router/core/commit/ad61d74))
* **vanilla:** Use `self` instead of `window` for webworker compat ([a4629ee](https://github.com/ui-router/core/commit/a4629ee))


### Features

* **TargetState:** Add builder methods .withState, .withParams, and .withOptions ([6b93142](https://github.com/ui-router/core/commit/6b93142))



## `@uirouter/angularjs` 1.0.6 (2017-08-12)
[Compare `@uirouter/angularjs` versions 1.0.5 and 1.0.6](https://github.com/angular-ui/ui-router/compare/1.0.5...1.0.6)

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"angular-ui-router","description":"State-based routing for AngularJS","license":"MIT","main":"./release/angular-ui-router.js","dependencies":{"angular":">= 1.2.0"},"ignore":["**/.*","**/tsconfig.json","**/tsconfig.typedoc.json","**/webpack.config.js","**/node_modules","package.json","scripts","test","src"],"version":"1.0.6"}
{"name":"angular-ui-router","description":"State-based routing for AngularJS","license":"MIT","main":"./release/angular-ui-router.js","dependencies":{"angular":">= 1.2.0"},"ignore":["**/.*","**/tsconfig.json","**/tsconfig.typedoc.json","**/webpack.config.js","**/node_modules","package.json","scripts","test","src"],"version":"1.0.7"}
29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "@uirouter/angularjs",
"description": "State-based routing for AngularJS 1.x",
"version": "1.0.6",
"version": "1.0.7",
"scripts": {
"clean": "shx rm -rf lib lib-esm _doc build release *.log",
"compile": "tsc && tsc -m es6 --outDir lib-esm && npm run fixdts",
"fixdts": "dts-downlevel 'lib/**/*.d.ts' 'lib-esm/**/*.d.ts'",
"fixmaps": "modify_sourcemap_paths",
"build": "npm run clean && npm run compile && npm run bundle && npm run fixmaps",
"package": "npm run build",
"bundle": "npm run bundle_router && npm run bundle_monolithic_router && npm run bundle_events && npm run bundle_resolve",
"bundle_monolithic_router": "rollup -c --environment ROUTER,MONOLITHIC && rollup -c --environment ROUTER,MINIFY,MONOLITHIC",
"bundle_router": "rollup -c --environment ROUTER && rollup -c --environment ROUTER,MINIFY",
@@ -72,7 +73,7 @@
"jsnext:main": "lib-esm/index.js",
"typings": "lib/index.d.ts",
"dependencies": {
"@uirouter/core": "=5.0.6"
"@uirouter/core": "5.0.8"
},
"peerDependencies": {
"angular": ">=1.2.0"
@@ -83,12 +84,12 @@
"@types/angular-mocks": "^1.5.5",
"@types/jasmine": "^2.2.34",
"@types/jquery": "^1.10.31",
"@uirouter/publish-scripts": "^1.0.4",
"awesome-typescript-loader": "3.0.0-beta.10",
"@uirouter/publish-scripts": "1.0.7",
"awesome-typescript-loader": "3.2.3",
"babel-core": "^5.8.14",
"clone": "^1.0.2",
"conventional-changelog": "^1.1.0",
"conventional-changelog-cli": "^1.1.1",
"conventional-changelog": "1.1.5",
"conventional-changelog-cli": "1.3.3",
"dts-downlevel": "^0.3.0",
"glob": "^7.0.5",
"jasmine-core": "^2.4.1",
@@ -105,21 +106,21 @@
"readline-sync": "^1.4.5",
"remap-istanbul": "^0.6.3",
"replace-in-file": "^2.0.3",
"rollup": "^0.38.0",
"rollup-plugin-node-resolve": "^2.0.0",
"rollup-plugin-progress": "^0.1.0",
"rollup": "0.50.0",
"rollup-plugin-node-resolve": "3.0.0",
"rollup-plugin-progress": "0.4.0",
"rollup-plugin-sourcemaps": "^0.4.1",
"rollup-plugin-uglify": "^1.0.1",
"rollup-plugin-visualizer": "^0.1.5",
"rollup-plugin-uglify": "2.0.1",
"rollup-plugin-visualizer": "0.3.1",
"shelljs": "^0.7.0",
"shx": "^0.1.4",
"shx": "0.2.2",
"systemjs": "^0.18.4",
"tslint": "^5.1.0",
"tslint": "5.7.0",
"typedoc": "~0.5.0",
"typedoc-plugin-external-module-name": "^1.0.2",
"typedoc-plugin-internal-external": "^1.0.0",
"typedoc-plugin-ui-router": "^1.0.0",
"typescript": "~2.4.0",
"typescript": "2.5.3",
"ui-router-typedoc-themes": "^1.0.1",
"watch": "^0.18.0",
"webpack": "1.x",
76 changes: 48 additions & 28 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -4,14 +4,14 @@ import progress from 'rollup-plugin-progress';
import sourcemaps from 'rollup-plugin-sourcemaps';
import visualizer from 'rollup-plugin-visualizer';

var MINIFY = process.env.MINIFY;
var MONOLITHIC = process.env.MONOLITHIC;
var ROUTER = process.env.ROUTER;
var EVENTS = process.env.EVENTS;
var RESOLVE = process.env.RESOLVE;
const MINIFY = process.env.MINIFY;
const MONOLITHIC = process.env.MONOLITHIC;
const ROUTER = process.env.ROUTER;
const EVENTS = process.env.EVENTS;
const RESOLVE = process.env.RESOLVE;

var pkg = require('./package.json');
var banner =
const pkg = require('./package.json');
let banner =
`/**
* ${pkg.description}`;
if (ROUTER && MONOLITHIC) {
@@ -30,12 +30,20 @@ banner += `
* @license MIT License, http://www.opensource.org/licenses/MIT
*/`;

var uglifyOpts = { output: {} };
const uglifyOpts = { output: {} };
// retain multiline comment with @license
uglifyOpts.output.comments = (node, comment) =>
comment.type === 'comment2' && /@license/i.test(comment.value);

var plugins = [
const onwarn = (warning) => {
// Suppress this error message... https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined
const ignores = ['THIS_IS_UNDEFINED'];
if (!ignores.some(code => code === warning.code)) {
console.error(warning.message);
}
};

const plugins = [
nodeResolve({jsnext: true}),
progress({ clearLine: false }),
sourcemaps(),
@@ -44,47 +52,59 @@ var plugins = [
if (MINIFY) plugins.push(uglify(uglifyOpts));
if (ROUTER && MINIFY) plugins.push(visualizer({ sourcemap: true }));

var extension = MINIFY ? ".min.js" : ".js";
const extension = MINIFY ? ".min.js" : ".js";

const BASE_CONFIG = {
sourceMap: true,
format: 'umd',
sourcemap: true,
exports: 'named',
plugins: plugins,
banner: banner,
onwarn: onwarn,
};

const ROUTER_CONFIG = Object.assign({
moduleName: '@uirouter/angularjs',
entry: 'lib-esm/index.js',
dest: 'release/ui-router-angularjs' + extension,
globals: { angular: 'angular', '@uirouter/core': '@uirouter/core' },
input: 'lib-esm/index.js',
external: ['angular', '@uirouter/core'],
output: {
file: 'release/ui-router-angularjs' + extension,
format: 'umd',
name: '@uirouter/angularjs',
globals: { angular: 'angular', '@uirouter/core': '@uirouter/core' },
},
}, BASE_CONFIG);

// Also bundles the code from @uirouter/core into the same bundle
const MONOLITHIC_ROUTER_CONFIG = Object.assign({
moduleName: '@uirouter/angularjs',
entry: 'lib-esm/index.js',
dest: 'release/angular-ui-router' + extension,
globals: { angular: 'angular' },
input: 'lib-esm/index.js',
external: 'angular',
output: {
file: 'release/angular-ui-router' + extension,
format: 'umd',
name: '@uirouter/angularjs',
globals: { angular: 'angular' },
},
}, BASE_CONFIG);

const EVENTS_CONFIG = Object.assign({}, BASE_CONFIG, {
moduleName: '@uirouter/angularjs-state-events',
entry: 'lib-esm/legacy/stateEvents.js',
dest: 'release/stateEvents' + extension,
globals: { angular: 'angular', '@uirouter/core': '@uirouter/core' },
input: 'lib-esm/legacy/stateEvents.js',
external: ['angular', '@uirouter/core'],
output: {
file: 'release/stateEvents' + extension,
format: 'umd',
name: '@uirouter/angularjs-state-events',
globals: { angular: 'angular', '@uirouter/core': '@uirouter/core' },
},
});

const RESOLVE_CONFIG = Object.assign({}, BASE_CONFIG, {
moduleName: '@uirouter/angularjs-resolve-service',
entry: 'lib-esm/legacy/resolveService.js',
dest: 'release/resolveService' + extension,
globals: { angular: 'angular', '@uirouter/core': '@uirouter/core' },
input: 'lib-esm/legacy/resolveService.js',
external: ['angular', '@uirouter/core'],
output: {
file: 'release/resolveService' + extension,
format: 'umd',
name: '@uirouter/angularjs-resolve-service',
globals: { angular: 'angular', '@uirouter/core': '@uirouter/core' },
},
});

const CONFIG =
5 changes: 3 additions & 2 deletions src/interface.ts
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@ export interface _Ng1StateDeclaration extends StateDeclaration {
onExit?: any;
onRetain?: any;
onEnter?: any;
views?: any;
}

/**
@@ -272,7 +273,7 @@ export interface Ng1StateDeclaration extends _Ng1StateDeclaration, Ng1ViewDeclar
* - controllerAs
* - controllerProvider
*/
views?: { [key: string]: Ng1ViewDeclaration; };
views?: { [key: string]: string | Ng1ViewDeclaration; };

/**
* A state hook invoked when a state is being entered.
@@ -745,4 +746,4 @@ declare module "@uirouter/core/lib/state/stateRegistry" {
interface StateRegistry {
register(state: Ng1StateDeclaration);
}
}
}
14 changes: 14 additions & 0 deletions test/stateSpec.js
Original file line number Diff line number Diff line change
@@ -1413,6 +1413,18 @@ describe('state', function () {
expect($state.current.name).toBe("about");
}));

// test for https://github.com/ui-router/core/issues/74
it('should allow param objects containing $scope', inject(function ($state, $q, $rootScope, $transitions) {
var errorhandler = jasmine.createSpy('errorhandler');
$state.defaultErrorHandler(errorhandler);

$state.go('types', { nonurl: { errorscope: $rootScope } });
$q.flush();

expect(errorhandler).not.toHaveBeenCalled();
expect($state.params.nonurl && $state.params.nonurl.errorscope).toBe($rootScope);
}));

function expectStateUrlMappingFn($state, $rootScope, $q, $location) {
return function (state, url, params, defaults, nonurlparams) {
$state.go(state, extend({}, nonurlparams, params));
@@ -1937,10 +1949,12 @@ describe('$stateParams', function () {
it('should start empty', inject(function ($stateParams) {
expect($stateParams.foo).toBeUndefined();
}));

it('should allow setting values on it', inject(function ($stateParams) {
$stateParams.foo = 'bar';
expect($stateParams.foo).toBeDefined();
}));

it('should be cleared between tests', inject(function ($stateParams) {
expect($stateParams.foo).toBeUndefined();
}));
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
"outDir": "lib",
"declaration": true,
"skipLibCheck": true,
"inlineSourceMap": true,
"sourceMap": true,
"inlineSources": true
},
"files": [
Loading