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.22
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.23
Choose a head ref
Loading
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 5.0.23 (2019-01-28)
[Compare `@uirouter/core` versions 5.0.22 and 5.0.23](https://github.com/ui-router/core/compare/5.0.22...5.0.23)

### Bug Fixes

* **test_downstream_projects:** don't double build core while testing downstreams ([148b16b](https://github.com/ui-router/core/commit/148b16b))
* **typescript:** Fix typing of onChange callback in UrlService ([961ed0f](https://github.com/ui-router/core/commit/961ed0f)), closes [#229](https://github.com/ui-router/core/issues/229)
* **typescript:** Mark `params` as optional in StateService.href ([614bfb4](https://github.com/ui-router/core/commit/614bfb4)), closes [#287](https://github.com/ui-router/core/issues/287)
* **vanilla:** Fix baseHref parsing with chrome-extension:// urls ([f11be4d](https://github.com/ui-router/core/commit/f11be4d)), closes [#304](https://github.com/ui-router/core/issues/304)




## 5.0.22 (2019-01-10)
[Compare `@uirouter/core` versions 5.0.21 and 5.0.22](https://github.com/ui-router/core/compare/5.0.21...5.0.22)

5 changes: 5 additions & 0 deletions downstream_projects.json
Original file line number Diff line number Diff line change
@@ -4,6 +4,11 @@
"typescript2.4": "./test/typescript2.4",
"typescript2.5": "./test/typescript2.5",
"typescript2.6": "./test/typescript2.6",
"typescript2.7": "./test/typescript2.7",
"typescript2.8": "./test/typescript2.8",
"typescript3.0": "./test/typescript3.0",
"typescript3.1": "./test/typescript3.1",
"typescript3.2": "./test/typescript3.2",
"angular": "https://github.com/ui-router/angular.git",
"angularjs": "https://github.com/angular-ui/ui-router.git",
"react": "https://github.com/ui-router/react.git",
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@uirouter/core",
"description": "UI-Router Core: Framework agnostic, State-based routing for JavaScript Single Page Apps",
"version": "5.0.22",
"version": "5.0.23",
"scripts": {
"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",
@@ -12,7 +12,7 @@
"fixmaps:bundle": "tweak_sourcemap_paths -a --include '_bundles/**/*.js.map'",
"prepublishOnly": "npm run build",
"test": "karma start",
"test:downstream": "npm run build && test_downstream_projects",
"test:downstream": "test_downstream_projects",
"docs": "generate_docs",
"docs:publish": "generate_docs && publish_docs",
"watch": "run-p watch:*",
@@ -21,7 +21,7 @@
"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",
"changelog": "show_changelog",
"release": "release"
},
"homepage": "https://ui-router.github.io",
@@ -68,12 +68,12 @@
"devDependencies": {
"@types/jasmine": "^3.3.5",
"@types/jquery": "^3.3.2",
"@uirouter/publish-scripts": "^2.3.24",
"@uirouter/publish-scripts": "^2.3.25",
"dts-downlevel": "^0.3.0",
"fork-ts-checker-webpack-plugin": "^0.5.2",
"husky": "^1.3.1",
"jasmine-core": "^3.3.0",
"karma": "^3.1.4",
"karma": "^4.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.1.0",
"karma-jasmine": "^2.0.1",
2 changes: 1 addition & 1 deletion src/state/stateService.ts
Original file line number Diff line number Diff line change
@@ -500,7 +500,7 @@ export class StateService {
*
* @returns {string} compiled state url
*/
href(stateOrName: StateOrName, params: RawParams, options?: HrefOptions): string {
href(stateOrName: StateOrName, params?: RawParams, options?: HrefOptions): string {
const defaultHrefOpts = {
lossy: true,
inherit: true,
2 changes: 1 addition & 1 deletion src/url/urlService.ts
Original file line number Diff line number Diff line change
@@ -269,5 +269,5 @@ export class UrlService implements LocationServices, UrlSyncApi {
* @param callback a function that will be called when the url is changing
* @return a function that de-registers the callback
*/
public onChange = (callback: Function): Function => this.router.locationService.onChange(callback);
public onChange = (callback: EventListener): Function => this.router.locationService.onChange(callback);
}
2 changes: 1 addition & 1 deletion src/vanilla/browserLocationConfig.ts
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ export class BrowserLocationConfig implements LocationConfig {
private getBaseHref() {
const baseTag: HTMLBaseElement = document.getElementsByTagName('base')[0];
if (baseTag && baseTag.href) {
return baseTag.href.replace(/^(https?:)?\/\/[^/]*/, '');
return baseTag.href.replace(/^([^/:]*:)?\/\/[^/]*/, '');
}

return this._isHtml5 ? '/' : location.pathname || '/';
2 changes: 2 additions & 0 deletions test/typescript2.7/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { UIRouter } from '@uirouter/core';
console.log(UIRouter);
15 changes: 15 additions & 0 deletions test/typescript2.7/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@uirouter/core-test-typescript2.7",
"version": "1.0.0",
"description": "Test against Typescript 2.7",
"scripts": {
"test": "tsc"
},
"author": "",
"license": "MIT",
"dependencies": {
"@uirouter/core": "latest",
"typescript": "2.7"
},
"devDependencies": {}
}
12 changes: 12 additions & 0 deletions test/typescript2.7/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"moduleResolution": "node",
"module": "commonjs",
"lib": ["es6", "dom"],
"noImplicitAny": true,
"noEmit": true,
"target": "es5",
"typeRoots": ["node_modules/@types"]
},
"files": ["index.ts"]
}
2 changes: 2 additions & 0 deletions test/typescript2.8/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { UIRouter } from '@uirouter/core';
console.log(UIRouter);
15 changes: 15 additions & 0 deletions test/typescript2.8/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@uirouter/core-test-typescript2.8",
"version": "1.0.0",
"description": "Test against Typescript 2.8",
"scripts": {
"test": "tsc"
},
"author": "",
"license": "MIT",
"dependencies": {
"@uirouter/core": "latest",
"typescript": "2.8"
},
"devDependencies": {}
}
12 changes: 12 additions & 0 deletions test/typescript2.8/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"moduleResolution": "node",
"module": "commonjs",
"lib": ["es6", "dom"],
"noImplicitAny": true,
"noEmit": true,
"target": "es5",
"typeRoots": ["node_modules/@types"]
},
"files": ["index.ts"]
}
2 changes: 2 additions & 0 deletions test/typescript3.0/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { UIRouter } from '@uirouter/core';
console.log(UIRouter);
15 changes: 15 additions & 0 deletions test/typescript3.0/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@uirouter/core-test-typescript3.0",
"version": "1.0.0",
"description": "Test against Typescript 3.0",
"scripts": {
"test": "tsc"
},
"author": "",
"license": "MIT",
"dependencies": {
"@uirouter/core": "latest",
"typescript": "3.0"
},
"devDependencies": {}
}
13 changes: 13 additions & 0 deletions test/typescript3.0/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"moduleResolution": "node",
"module": "commonjs",
"lib": ["es6", "dom"],
"noImplicitAny": true,
"noEmit": true,
"strict": true,
"target": "es5",
"typeRoots": ["node_modules/@types"]
},
"files": ["index.ts"]
}
2 changes: 2 additions & 0 deletions test/typescript3.1/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { UIRouter } from '@uirouter/core';
console.log(UIRouter);
15 changes: 15 additions & 0 deletions test/typescript3.1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@uirouter/core-test-typescript3.1",
"version": "1.0.0",
"description": "Test against Typescript 3.1",
"scripts": {
"test": "tsc"
},
"author": "",
"license": "MIT",
"dependencies": {
"@uirouter/core": "latest",
"typescript": "3.1"
},
"devDependencies": {}
}
13 changes: 13 additions & 0 deletions test/typescript3.1/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"moduleResolution": "node",
"module": "commonjs",
"lib": ["es6", "dom"],
"noImplicitAny": true,
"noEmit": true,
"strict": true,
"target": "es5",
"typeRoots": ["node_modules/@types"]
},
"files": ["index.ts"]
}
2 changes: 2 additions & 0 deletions test/typescript3.2/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { UIRouter } from '@uirouter/core';
console.log(UIRouter);
15 changes: 15 additions & 0 deletions test/typescript3.2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@uirouter/core-test-typescript3.2",
"version": "1.0.0",
"description": "Test against Typescript 3.2",
"scripts": {
"test": "tsc"
},
"author": "",
"license": "MIT",
"dependencies": {
"@uirouter/core": "latest",
"typescript": "3.2"
},
"devDependencies": {}
}
13 changes: 13 additions & 0 deletions test/typescript3.2/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"moduleResolution": "node",
"module": "commonjs",
"lib": ["es6", "dom"],
"noImplicitAny": true,
"noEmit": true,
"strict": true,
"target": "es5",
"typeRoots": ["node_modules/@types"]
},
"files": ["index.ts"]
}
18 changes: 18 additions & 0 deletions test/vanilla.browserLocationConfigSpec.ts
Original file line number Diff line number Diff line change
@@ -128,6 +128,24 @@ describe('BrowserLocationConfig implementation', () => {
expect(blc.baseHref()).toBe('/base');
});

it('strips off the http origin', () => {
applyBaseTag('http://localhost/base');
const blc = new BrowserLocationConfig();
expect(blc.baseHref()).toBe('/base');
});

it('strips off the https origin', () => {
applyBaseTag('https://localhost/base');
const blc = new BrowserLocationConfig();
expect(blc.baseHref()).toBe('/base');
});

it('supports chrome-extension:// urls', () => {
applyBaseTag('chrome-extension://cckppebifaokhmbkciccdindfbmacjcj/baseHref/');
const blc = new BrowserLocationConfig();
expect(blc.baseHref()).toBe('/baseHref/');
});

it('uses location.pathname if <base> is not present', () => {
const blc = new BrowserLocationConfig();
expect(blc.baseHref()).toBe(location.pathname);
Loading