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: ui-router/core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5.0.17
Choose a base ref
...
head repository: ui-router/core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5.0.18
Choose a head ref
Loading
Showing with 4,587 additions and 3,110 deletions.
  1. +1 −0 .gitignore
  2. +2 −0 .prettierignore
  3. +5 −0 .prettierrc.json
  4. +9 −25 .travis.yml
  5. +13 −0 CHANGELOG.md
  6. +12 −15 karma.conf.js
  7. +0 −4 migrate/migrate.json
  8. +0 −10 migrate/migratewarn.js
  9. +36 −34 package.json
  10. +5 −10 rollup.config.js
  11. +90 −67 src/common/common.ts
  12. +8 −6 src/common/glob.ts
  13. +15 −27 src/common/hof.ts
  14. +9 −9 src/common/predicates.ts
  15. +3 −5 src/common/queue.ts
  16. +19 −22 src/common/strings.ts
  17. +45 −32 src/common/trace.ts
  18. +5 −3 src/hooks/coreResolvables.ts
  19. +1 −1 src/hooks/ignoredTransition.ts
  20. +2 −2 src/hooks/invalidTransition.ts
  21. +11 −11 src/hooks/lazyLoad.ts
  22. +3 −4 src/hooks/onEnterExitRetain.ts
  23. +2 −2 src/hooks/redirectTo.ts
  24. +8 −13 src/hooks/resolve.ts
  25. +1 −1 src/hooks/updateGlobals.ts
  26. +1 −1 src/hooks/url.ts
  27. +2 −3 src/hooks/views.ts
  28. +8 −0 src/index.metadata.json
  29. +1 −1 src/interface.ts
  30. +3 −5 src/params/interface.ts
  31. +29 −18 src/params/param.ts
  32. +26 −15 src/params/paramType.ts
  33. +20 −18 src/params/paramTypes.ts
  34. +2 −3 src/params/stateParams.ts
  35. +1 −1 src/path/pathNode.ts
  36. +27 −20 src/path/pathUtils.ts
  37. +9 −9 src/resolve/interface.ts
  38. +20 −18 src/resolve/resolvable.ts
  39. +14 −12 src/resolve/resolveContext.ts
  40. +5 −7 src/router.ts
  41. +0 −1 src/state/index.ts
  42. +16 −15 src/state/interface.ts
  43. +96 −64 src/state/stateBuilder.ts
  44. +9 −7 src/state/stateMatcher.ts
  45. +19 −21 src/state/stateObject.ts
  46. +16 −13 src/state/stateQueueManager.ts
  47. +8 −6 src/state/stateRegistry.ts
  48. +43 −30 src/state/stateService.ts
  49. +5 −8 src/state/targetState.ts
  50. +49 −34 src/transition/hookBuilder.ts
  51. +52 −25 src/transition/hookRegistry.ts
  52. +0 −1 src/transition/index.ts
  53. +36 −23 src/transition/interface.ts
  54. +75 −5 src/transition/rejectFactory.ts
  55. +86 −53 src/transition/transition.ts
  56. +10 −9 src/transition/transitionEventType.ts
  57. +25 −37 src/transition/transitionHook.ts
  58. +149 −77 src/transition/transitionService.ts
  59. +12 −8 src/url/interface.ts
  60. +103 −64 src/url/urlMatcher.ts
  61. +10 −13 src/url/urlMatcherFactory.ts
  62. +33 −22 src/url/urlRouter.ts
  63. +25 −19 src/url/urlRule.ts
  64. +39 −20 src/url/urlService.ts
  65. +2 −2 src/vanilla/baseLocationService.ts
  66. +6 −5 src/vanilla/browserLocationConfig.ts
  67. +1 −2 src/vanilla/hashLocationService.ts
  68. +13 −4 src/vanilla/injector.ts
  69. +2 −2 src/vanilla/interface.ts
  70. +1 −1 src/vanilla/memoryLocationConfig.ts
  71. +18 −6 src/vanilla/plugins.ts
  72. +1 −2 src/vanilla/pushStateLocationService.ts
  73. +11 −5 src/vanilla/q.ts
  74. +27 −13 src/vanilla/utils.ts
  75. +16 −22 src/view/view.ts
  76. +0 −1 test/_matchers.d.ts
  77. +3 −6 test/_matchers.ts
  78. +21 −26 test/_testUtils.ts
  79. +30 −17 test/commonSpec.ts
  80. +35 −24 test/hookBuilderSpec.ts
  81. +72 −59 test/hooksSpec.ts
  82. +1 −2 test/index.js
  83. +84 −59 test/lazyLoadSpec.ts
  84. +2 −2 test/paramSpec.ts
  85. +4 −4 test/pluginSpec.ts
  86. +343 −172 test/resolveSpec.ts
  87. +16 −9 test/stateBuilderSpec.ts
  88. +19 −6 test/stateMatcherSpec.ts
  89. +33 −11 test/stateRegistrySpec.ts
  90. +352 −178 test/stateServiceSpec.ts
  91. +2 −2 test/targetStateSpec.ts
  92. +586 −390 test/transitionSpec.ts
  93. +198 −155 test/urlMatcherFactorySpec.ts
  94. +59 −55 test/urlRouterSpec.ts
  95. +0 −1 test/urlServiceSpec.ts
  96. +3 −5 test/vanilla.browserLocationConfigSpec.ts
  97. +1 −3 test/viewServiceSpec.ts
  98. +0 −19 tsconfig.esm.json
  99. +3 −4 tsconfig.json
  100. +26 −18 tslint.json
  101. +9 −14 typedoc.json
  102. +1,198 −795 yarn.lock
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ build_packages
_bundles
site
stats.html
yarn-error.log

# common
*~
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package.json
CHANGELOG.md
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 120
}
34 changes: 9 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,24 @@
language: node_js
node_js: 8.9.1
before_install: yarn global add greenkeeper-lockfile@1 yalc
install: yarn --check-files
before_script: greenkeeper-lockfile-update && greenkeeper-lockfile-upload
before_install:
- sh -e /etc/init.d/xvfb start
- export PATH=$HOME/.yarn/bin:$PATH
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.5.1
script:
- if [ "x${DOWNSTREAM_PKGS}x" != "xx" ] ; then npm run test:downstream ; else tsc
&& npm test ; fi
- tsc &&
yarn test &&
yarn docs &&
yarn test:downstream
env:
global:
secure: bEGHePu9rkjcy5Pq3RQQfCIRzAfCSxH7dZsdOJd3pAXEGbkhuCOAGFV0v+NVbRBWNYv0yIExwwu2VOVfAPGqmmuhzE8Uq/WZeLWUbUA1oSIN7t9IkYRKIdoE36o85eyRxSTP6w3dtMHXLeMvPbgtgEUVrgPztBVe3ySoQ+nA3jbgZ/fBpuEevJ2dAxwybbtRwZBflplUumpwmy1pSiLHptdFXsxmmLr0hOjx+WZd38jMZo4H4vV9zo6wz34hjf+j1f0jsjmsKgpRVPLADtLTcqIfEegSG7vLmlFJLGBtBZ6UhIioZseZTVOi2wq1hK0E+3SzPJVXhu3h7VsIBVgCaaYJQ07p7q9LszwWwxHHzePLBtV77J6mJ1zZFbS/PHmVHnfU/gz5+l2Te2KSkvFYbq9uVXd4CLLeR1xdECwX8qiXMtUOk7IauVVzFtLCPRVksmEjClJNf1tAi+j9nKezYHQ8LPSqTyoxo/0PhQJ0U3pCQuKGTxO9lDi63Gks9lr87N+yrn81W+2wbGKL6iqItKPAQ5Tcl5FbhmwUk40p0Sz1KNjBWepREQAeCgRKFN4y/Xhi6Mn1TydwE9zHXdfIiWNYaxl0LjXMnAMahvO2+m5NClDWhzBii21JsdMyUS3TUFGyVIfok2M+uaM2NZn7GLNRSOGarBpLhF/5lci/9kY=
matrix:
- DOWNSTREAM_PKGS=
- DOWNSTREAM_PKGS=typescript2.2,typescript2.3,typescript2.4,typescript2.5,typescript2.6
- DOWNSTREAM_PKGS=angular,sample-app-angular
- DOWNSTREAM_PKGS=angularjs,sample-app-angularjs
- DOWNSTREAM_PKGS=react
- DOWNSTREAM_PKGS=sticky-states
#- DOWNSTREAM_PKGS=react,sample-app-react
matrix:
fast_finish: true
allow_failures:
- env: DOWNSTREAM_PKGS=react,sample-app-react
- env: DOWNSTREAM_PKGS=angular,sample-app-angular
- env: DOWNSTREAM_PKGS=angularjs,sample-app-angularjs
- env: DOWNSTREAM_PKGS=react
# - env: DOWNSTREAM_PKGS=react,sample-app-react
notifications:
slack:
on_success: change
on_success: never
rooms:
secure: YXAdbpNslKfzMVgby/amCLSJqsQ1ZUYnWzG6MJTIt7/UyMjbyasqknefSV2yFGdbWXCIkyh1ClTArFRxGfzJA9YKadWuueWJ64cOusz6fsY4G1iAFeDWGa4kOffVntk9f4ZXgkeP4Hk1Bce3iPXMIFXy3R10LLvBb3BcBge5ynPJm+arIDtKoMR6yXqz7Jj0ZOn1oBNV8SgyQHEvs6eBggGnPJubmUd1HVfQ/PXvJXk6szlD4mlcNgUnBhxy0zA0AG1TPKidk+fyLC0YjqR/2GfUQIcnhfOTQhJfKy6UOTIYQQPYSrTSHX8rS7H8T+7ZSTu5nCCiVjVP3CNjEIUF57exdT4wjWQv+gpTYesUEgkaf0200YCzwZez0l2pSpAZhKi2cyzmanO36xUHeqR3bdaDyFPDTkd2z4ZiyO/MXkIWpU5ktepHvx5UtD/rRaFQ4u6wchVxfJBB2Wr8FbW1rOZtdn5y7mQCU90JzSZvF9d19zjF2bOTHqsqh8YtPAlGcQb1c9O1mQkSYWklSRTO/68Os59fUbrat9lQvqMnT8/pV275lCDu7xCSEKY1ORfgzgmD2CditdeC15haP4n8eOoToE8dj3rzCcMRtHBGe9wqIKb97aSO4wJzY6NDN5U/2p1/PtPKwcSk75N/aPFrCbwe5jUezHMe7hJfqevYX1A=
sudo: false
git:
depth: 3
cache:
yarn: true
directories:
- node_modules
- ".downstream_cache"
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 5.0.18 (2018-04-29)
[Compare `@uirouter/core` versions 5.0.17 and 5.0.18](https://github.com/ui-router/core/compare/5.0.17...5.0.18)

### Bug Fixes

* **angular:** A hack to force the Angular compiler to import from module index ([d56a2be](https://github.com/ui-router/core/commit/d56a2be))
* **StateRegistry:** Notify listeners of added states when there are orphans in the state queue ([5a9bac9](https://github.com/ui-router/core/commit/5a9bac9))
* **transition:** Fix typing of Transition.params() ([ebea30e](https://github.com/ui-router/core/commit/ebea30e))
* **transition:** Normalize `error()` to always return `Rejection` ([9bcc5db](https://github.com/ui-router/core/commit/9bcc5db))




## 5.0.17 (2018-02-12)
[Compare `@uirouter/core` versions 5.0.16 and 5.0.17](https://github.com/ui-router/core/compare/5.0.16...5.0.17)

27 changes: 12 additions & 15 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -2,15 +2,15 @@
var karma = require('karma');
var ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

module.exports = function (karma) {
module.exports = function(karma) {
var config = {
singleRun: true,
autoWatch: false,
autoWatchInterval: 0,

// level of logging
// possible values: LOG_DISABLE, LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG
logLevel: "warn",
logLevel: 'warn',
// possible values: 'dots', 'progress'
reporters: 'dots',
colors: true,
@@ -20,44 +20,42 @@ module.exports = function (karma) {
// base path, that will be used to resolve files and exclude
basePath: '.',

// Start these browsers, currently available:
// Chrome, ChromeCanary, Firefox, Opera, Safari, PhantomJS
browsers: ['PhantomJS'],
browsers: ['ChromeHeadlessNoSandbox'],
customLaunchers: {
ChromeHeadlessNoSandbox: { base: 'ChromeHeadless', flags: ['--no-sandbox'] },
},

frameworks: ['jasmine'],

plugins: [
require('karma-chrome-launcher'),
require('karma-firefox-launcher'),
require('karma-jasmine'),
require('karma-phantomjs-launcher'),
require('karma-sourcemap-loader'),
require('karma-webpack'),
],

webpack: {
devtool: 'inline-source-map',
mode: 'development',

resolve: {
extensions: ['.js', '.ts']
extensions: ['.js', '.ts'],
},

module: {
rules: [
{
{
test: /\.ts$/,
loader: 'ts-loader',
options: {
configFile: 'test/tsconfig.json',
transpileOnly: true,
},
}
]
},
],
},

plugins: [
new ForkTsCheckerWebpackPlugin()
],
plugins: [new ForkTsCheckerWebpackPlugin()],
},

webpackMiddleware: {
@@ -69,7 +67,6 @@ module.exports = function (karma) {
preprocessors: {
'test/index.js': ['webpack', 'sourcemap'],
},

};

karma.set(config);
4 changes: 0 additions & 4 deletions migrate/migrate.json

This file was deleted.

10 changes: 0 additions & 10 deletions migrate/migratewarn.js

This file was deleted.

70 changes: 36 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
{
"name": "@uirouter/core",
"description": "UI-Router Core: Framework agnostic, State-based routing for JavaScript Single Page Apps",
"version": "5.0.17",
"version": "5.0.18",
"scripts": {
"clean": "shx rm -rf lib lib-esm _bundles",
"compile": "npm run clean && tsc && tsc -m es6 --outDir lib-esm",
"clean": "shx rm -rf lib lib-esm _bundles .cache _doc",
"compile": "npm run clean && tsc && tsc -m es6 --outDir lib-esm && shx cp src/*.json lib",
"build": "run-s compile fixdts bundle fixmaps:*",
"bundle": "rollup -c && rollup -c --environment MINIFY",
"fixdts": "dts-downlevel 'lib/**/*.d.ts' 'lib-esm/**/*.d.ts'",
"fixmaps:lib": "tweak_sourcemap_paths -a --include 'lib/**/*.js.map' 'lib-esm/**/*.js.map'",
"fixmaps:bundle": "tweak_sourcemap_paths -a --include '_bundles/**/*.js.map'",
"install": "node migrate/migratewarn.js",
"prepublishOnly": "npm run build",
"test": "karma start",
"test:downstream": "npm run build && test_downstream_projects",
"docs": "generate_docs && publish_docs",
"docs": "generate_docs",
"docs:publish": "generate_docs && publish_docs",
"watch": "run-p watch:*",
"watch:buildjs": "tsc -w",
"watch:buildesm": "tsc -w -m es6 --outDir lib-esm",
"watch:dts-downlevel": "npm run fixdts",
"watch:test": "karma start --singleRun=false --autoWatch=true --autoWatchInterval=1",
"debug": "karma start --singleRun=false --autoWatch=true --autoWatchInterval=1 --browsers=ChromeCanary",
"changelog": "update_changelog",
"release": "release"
"release": "release",
"precommit": "pretty-quick --staged"
},
"homepage": "https://ui-router.github.io",
"contributors": [
@@ -65,33 +66,34 @@
"jsnext:main": "lib-esm/index.js",
"license": "MIT",
"devDependencies": {
"@types/jasmine": "2.8.6",
"@types/jquery": "3.3.0",
"@uirouter/publish-scripts": "2.3.1",
"core-js": "2.5.3",
"dts-downlevel": "0.3.0",
"fork-ts-checker-webpack-plugin": "0.3.0",
"glob": "7.1.2",
"jasmine-core": "3.0.0",
"karma": "2.0.0",
"karma-chrome-launcher": "2.2.0",
"karma-firefox-launcher": "1.1.0",
"karma-jasmine": "1.1.1",
"karma-phantomjs-launcher": "1.0.4",
"karma-script-launcher": "1.0.0",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "2.0.9",
"npm-run-all": "4.1.2",
"rollup": "0.55.5",
"rollup-plugin-node-resolve": "3.0.2",
"rollup-plugin-sourcemaps": "0.4.2",
"rollup-plugin-uglify": "3.0.0",
"shelljs": "0.8.1",
"shx": "0.2.2",
"ts-loader": "3.4.0",
"tslint": "5.9.1",
"tslint-eslint-rules": "4.1.1",
"typescript": "2.7.1",
"webpack": "3.11.0"
"@types/jasmine": "^2.8.6",
"@types/jquery": "^3.3.1",
"@uirouter/publish-scripts": "^2.3.3",
"dts-downlevel": "^0.3.0",
"fork-ts-checker-webpack-plugin": "^0.4.1",
"glob": "^7.1.2",
"husky": "^0.14.3",
"jasmine-core": "^3.1.0",
"karma": "^2.0.2",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.1.0",
"karma-jasmine": "^1.1.1",
"karma-script-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^3.0.0",
"npm-run-all": "^4.1.2",
"prettier": "^1.11.1",
"pretty-quick": "^1.4.1",
"rollup": "^0.58.0",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-uglify": "^3.0.0",
"shelljs": "^0.8.1",
"shx": "^0.2.2",
"ts-loader": "^4.1.0",
"tslint": "^5.9.1",
"tslint-eslint-rules": "^5.1.0",
"typescript": "^2.8.3",
"webpack": "^4.2.0"
}
}
15 changes: 5 additions & 10 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -5,8 +5,7 @@ import sourcemaps from 'rollup-plugin-sourcemaps';
const MINIFY = process.env.MINIFY;

const pkg = require('./package.json');
const banner =
`/**
const banner = `/**
* ${pkg.description}
* @version v${pkg.version}
* @link ${pkg.homepage}
@@ -15,25 +14,21 @@ const banner =

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

const onwarn = (warning) => {
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}),
sourcemaps(),
];
const plugins = [nodeResolve({ jsnext: true }), sourcemaps()];

if (MINIFY) plugins.push(uglify(uglifyOpts));

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

const CONFIG = {
input: 'lib-esm/index.js',
Loading