Comparing version 8.0.1 to 8.0.2
@@ -0,41 +1,56 @@ | ||
## v8.0.2 (2022-02-09) | ||
- [#332] Correct more incorrect TypeScript types | ||
## v8.0.1 (2022-02-03) | ||
- [#331] Correct some incorrect TypeScript types | ||
## v8.0.0 (2022-02-02) | ||
#### :boom: Breaking Change | ||
* [#329](https://github.com/tildeio/router.js/pull/329) Better Types ([@wagenet](https://github.com/wagenet)) | ||
- [#329](https://github.com/tildeio/router.js/pull/329) Better Types ([@wagenet](https://github.com/wagenet)) | ||
#### Committers: 1 | ||
- Peter Wagenet ([@wagenet](https://github.com/wagenet)) | ||
## v7.3.0 (2021-03-07) | ||
#### :rocket: Enhancement | ||
* [#321](https://github.com/tildeio/router.js/pull/321) Add `isIntermediate` flag to Transition ([@sly7-7](https://github.com/sly7-7)) | ||
- [#321](https://github.com/tildeio/router.js/pull/321) Add `isIntermediate` flag to Transition ([@sly7-7](https://github.com/sly7-7)) | ||
#### :house: Internal | ||
* [#320](https://github.com/tildeio/router.js/pull/320) Remove testing for multiple platforms. ([@rwjblue](https://github.com/rwjblue)) | ||
- [#320](https://github.com/tildeio/router.js/pull/320) Remove testing for multiple platforms. ([@rwjblue](https://github.com/rwjblue)) | ||
#### Committers: 2 | ||
- Robert Jackson ([@rwjblue](https://github.com/rwjblue)) | ||
- Sylvain MINA ([@sly7-7](https://github.com/sly7-7)) | ||
## v7.2.0 (2021-03-07) | ||
#### :bug: Bug Fix | ||
* [#319](https://github.com/tildeio/router.js/pull/319) Ensure query params are preserved through an intermediate loading state transition ([@sly7-7](https://github.com/sly7-7)) | ||
- [#319](https://github.com/tildeio/router.js/pull/319) Ensure query params are preserved through an intermediate loading state transition ([@sly7-7](https://github.com/sly7-7)) | ||
#### :memo: Documentation | ||
* [#316](https://github.com/tildeio/router.js/pull/316) Publish type declaration ([@xg-wang](https://github.com/xg-wang)) | ||
- [#316](https://github.com/tildeio/router.js/pull/316) Publish type declaration ([@xg-wang](https://github.com/xg-wang)) | ||
#### :house: Internal | ||
* [#318](https://github.com/tildeio/router.js/pull/318) add livereload so tests reload when i make changes ([@stefanpenner](https://github.com/stefanpenner)) | ||
* [#309](https://github.com/tildeio/router.js/pull/309) Refactor TransitionAbort to builder interface ([@rwjblue](https://github.com/rwjblue)) | ||
* [#306](https://github.com/tildeio/router.js/pull/306) Simplify TransitionState resolution system. ([@rwjblue](https://github.com/rwjblue)) | ||
* [#314](https://github.com/tildeio/router.js/pull/314) [Closes [#313](https://github.com/tildeio/router.js/issues/313)] Fix Typo shouldSupercede -> shouldSupersede ([@stefanpenner](https://github.com/stefanpenner)) | ||
* [#315](https://github.com/tildeio/router.js/pull/315) Fix other typo’s ([@stefanpenner](https://github.com/stefanpenner)) | ||
* [#312](https://github.com/tildeio/router.js/pull/312) Upgrade `devDependencies` ([@stefanpenner](https://github.com/stefanpenner)) | ||
* [#311](https://github.com/tildeio/router.js/pull/311) Upgrade CI ([@stefanpenner](https://github.com/stefanpenner)) | ||
- [#318](https://github.com/tildeio/router.js/pull/318) add livereload so tests reload when i make changes ([@stefanpenner](https://github.com/stefanpenner)) | ||
- [#309](https://github.com/tildeio/router.js/pull/309) Refactor TransitionAbort to builder interface ([@rwjblue](https://github.com/rwjblue)) | ||
- [#306](https://github.com/tildeio/router.js/pull/306) Simplify TransitionState resolution system. ([@rwjblue](https://github.com/rwjblue)) | ||
- [#314](https://github.com/tildeio/router.js/pull/314) [Closes [#313](https://github.com/tildeio/router.js/issues/313)] Fix Typo shouldSupercede -> shouldSupersede ([@stefanpenner](https://github.com/stefanpenner)) | ||
- [#315](https://github.com/tildeio/router.js/pull/315) Fix other typo’s ([@stefanpenner](https://github.com/stefanpenner)) | ||
- [#312](https://github.com/tildeio/router.js/pull/312) Upgrade `devDependencies` ([@stefanpenner](https://github.com/stefanpenner)) | ||
- [#311](https://github.com/tildeio/router.js/pull/311) Upgrade CI ([@stefanpenner](https://github.com/stefanpenner)) | ||
#### Committers: 4 | ||
- Robert Jackson ([@rwjblue](https://github.com/rwjblue)) | ||
@@ -46,40 +61,42 @@ - Stefan Penner ([@stefanpenner](https://github.com/stefanpenner)) | ||
## v7.1.1 (2020-11-06) | ||
#### :bug: Bug Fix | ||
* [#308](https://github.com/tildeio/router.js/pull/308) Provide transition to `setupContext` for internal transition ([@rreckonerr](https://github.com/rreckonerr)) | ||
- [#308](https://github.com/tildeio/router.js/pull/308) Provide transition to `setupContext` for internal transition ([@rreckonerr](https://github.com/rreckonerr)) | ||
#### Committers: 1 | ||
- Volodymyr Radchenko ([@rreckonerr](https://github.com/rreckonerr)) | ||
## v7.1.0 (2020-09-09) | ||
#### :rocket: Enhancement | ||
* [#305](https://github.com/tildeio/router.js/pull/305) Add better Transition debugging information. ([@rwjblue](https://github.com/rwjblue)) | ||
- [#305](https://github.com/tildeio/router.js/pull/305) Add better Transition debugging information. ([@rwjblue](https://github.com/rwjblue)) | ||
#### Committers: 1 | ||
- Robert Jackson ([@rwjblue](https://github.com/rwjblue)) | ||
## v7.0.0 (2020-07-21) | ||
#### :boom: Breaking Change | ||
* [#297](https://github.com/tildeio/router.js/pull/297) Update TypeScript to 3.9 ([@xg-wang](https://github.com/xg-wang)) | ||
* [#294](https://github.com/tildeio/router.js/pull/294) Drop Node < 10. ([@rwjblue](https://github.com/rwjblue)) | ||
* [#289](https://github.com/tildeio/router.js/pull/289) Upgrade TypeScript to 3.5 ([@xg-wang](https://github.com/xg-wang)) | ||
- [#297](https://github.com/tildeio/router.js/pull/297) Update TypeScript to 3.9 ([@xg-wang](https://github.com/xg-wang)) | ||
- [#294](https://github.com/tildeio/router.js/pull/294) Drop Node < 10. ([@rwjblue](https://github.com/rwjblue)) | ||
- [#289](https://github.com/tildeio/router.js/pull/289) Upgrade TypeScript to 3.5 ([@xg-wang](https://github.com/xg-wang)) | ||
#### :house: Internal | ||
* [#301](https://github.com/tildeio/router.js/pull/301) Add automated release setup. ([@rwjblue](https://github.com/rwjblue)) | ||
* [#300](https://github.com/tildeio/router.js/pull/300) Update Babel to latest. ([@rwjblue](https://github.com/rwjblue)) | ||
* [#299](https://github.com/tildeio/router.js/pull/299) Update remaining dependencies/devDependencies to latest. ([@rwjblue](https://github.com/rwjblue)) | ||
* [#298](https://github.com/tildeio/router.js/pull/298) Update prettier to 2.0.5. ([@rwjblue](https://github.com/rwjblue)) | ||
* [#296](https://github.com/tildeio/router.js/pull/296) Migrate from TSLint to ESLint ([@rwjblue](https://github.com/rwjblue)) | ||
* [#295](https://github.com/tildeio/router.js/pull/295) Add GitHub Actions CI setup ([@rwjblue](https://github.com/rwjblue)) | ||
- [#301](https://github.com/tildeio/router.js/pull/301) Add automated release setup. ([@rwjblue](https://github.com/rwjblue)) | ||
- [#300](https://github.com/tildeio/router.js/pull/300) Update Babel to latest. ([@rwjblue](https://github.com/rwjblue)) | ||
- [#299](https://github.com/tildeio/router.js/pull/299) Update remaining dependencies/devDependencies to latest. ([@rwjblue](https://github.com/rwjblue)) | ||
- [#298](https://github.com/tildeio/router.js/pull/298) Update prettier to 2.0.5. ([@rwjblue](https://github.com/rwjblue)) | ||
- [#296](https://github.com/tildeio/router.js/pull/296) Migrate from TSLint to ESLint ([@rwjblue](https://github.com/rwjblue)) | ||
- [#295](https://github.com/tildeio/router.js/pull/295) Add GitHub Actions CI setup ([@rwjblue](https://github.com/rwjblue)) | ||
#### Committers: 2 | ||
- Robert Jackson ([@rwjblue](https://github.com/rwjblue)) | ||
- Thomas Wang ([@xg-wang](https://github.com/xg-wang)) | ||
export { default } from './router'; | ||
export { default as InternalTransition, PublicTransition as Transition, logAbort, STATE_SYMBOL, PARAMS_SYMBOL, QUERY_PARAMS_SYMBOL, } from './transition'; | ||
export { default as TransitionState, TransitionError } from './transition-state'; | ||
export { default as InternalRouteInfo, IModel, ModelFor, Route, RouteInfo, RouteInfoWithAttributes, } from './route-info'; | ||
export { default as InternalRouteInfo, ModelFor, Route, RouteInfo, RouteInfoWithAttributes, } from './route-info'; |
@@ -9,3 +9,3 @@ import { Promise } from 'rsvp'; | ||
export declare type ModelFor<T> = T extends Route<infer V> ? V : never; | ||
export interface Route<T extends IModel = {}> { | ||
export interface Route<T = unknown> { | ||
inaccessibleByURL?: boolean; | ||
@@ -43,4 +43,4 @@ routeName: string; | ||
} | ||
export declare function toReadOnlyRouteInfo<R extends Route<{}>>(routeInfos: InternalRouteInfo<R>[], queryParams?: Dict<unknown>, includeAttributes?: boolean): RouteInfoWithAttributes[] | RouteInfo[]; | ||
export default class InternalRouteInfo<R extends Route<{}>> { | ||
export declare function toReadOnlyRouteInfo<R extends Route>(routeInfos: InternalRouteInfo<R>[], queryParams?: Dict<unknown>, includeAttributes?: boolean): RouteInfoWithAttributes[] | RouteInfo[]; | ||
export default class InternalRouteInfo<R extends Route> { | ||
private _routePromise?; | ||
@@ -73,3 +73,3 @@ private _route?; | ||
} | ||
export declare class ResolvedRouteInfo<R extends Route<{}>> extends InternalRouteInfo<R> { | ||
export declare class ResolvedRouteInfo<R extends Route> extends InternalRouteInfo<R> { | ||
isResolved: boolean; | ||
@@ -80,3 +80,3 @@ context: ModelFor<R> | undefined; | ||
} | ||
export declare class UnresolvedRouteInfoByParam<R extends Route<{}>> extends InternalRouteInfo<R> { | ||
export declare class UnresolvedRouteInfoByParam<R extends Route> extends InternalRouteInfo<R> { | ||
params: Dict<unknown>; | ||
@@ -86,3 +86,3 @@ constructor(router: Router<R>, name: string, paramNames: string[], params: Dict<unknown> | undefined, route?: R); | ||
} | ||
export declare class UnresolvedRouteInfoByObject<R extends Route<{}>> extends InternalRouteInfo<R> { | ||
export declare class UnresolvedRouteInfoByObject<R extends Route> extends InternalRouteInfo<R> { | ||
serializer?: SerializerFunc<ModelFor<R>>; | ||
@@ -89,0 +89,0 @@ constructor(router: Router<R>, name: string, paramNames: string[], context: ModelFor<R> | PromiseLike<ModelFor<R>> | undefined); |
import RouteRecognizer, { MatchCallback } from 'route-recognizer'; | ||
import { Promise } from 'rsvp'; | ||
import { Dict, Maybe, Option } from './core'; | ||
import InternalRouteInfo, { IModel, ModelFor, Route, RouteInfo, RouteInfoWithAttributes } from './route-info'; | ||
import InternalRouteInfo, { ModelFor, Route, RouteInfo, RouteInfoWithAttributes } from './route-info'; | ||
import InternalTransition, { OpaqueTransition, PublicTransition as Transition } from './transition'; | ||
@@ -9,3 +9,3 @@ import { TransitionIntent } from './transition-intent'; | ||
import { ChangeList, ModelsAndQueryParams } from './utils'; | ||
export interface SerializerFunc<T extends IModel> { | ||
export interface SerializerFunc<T> { | ||
(model: T, params: string[]): Dict<unknown>; | ||
@@ -17,3 +17,3 @@ } | ||
} | ||
export default abstract class Router<R extends Route<{}>> { | ||
export default abstract class Router<R extends Route> { | ||
private _lastQueryParams; | ||
@@ -235,3 +235,3 @@ log?: (message: string) => void; | ||
} | ||
export interface RoutePartition<R extends Route<{}>> { | ||
export interface RoutePartition<R extends Route> { | ||
updatedContext: InternalRouteInfo<R>[]; | ||
@@ -238,0 +238,0 @@ exited: InternalRouteInfo<R>[]; |
@@ -222,3 +222,3 @@ "use strict"; | ||
if (lastArg !== undefined && lastArg.hasOwnProperty('queryParams')) { | ||
if (lastArg && Object.prototype.hasOwnProperty.call(lastArg, 'queryParams')) { | ||
// We just checked this. | ||
@@ -225,0 +225,0 @@ // TODO: Use an assertion? |
@@ -5,3 +5,3 @@ import { Route } from './route-info'; | ||
export declare type OpaqueIntent = TransitionIntent<any>; | ||
export declare abstract class TransitionIntent<R extends Route<{}>> { | ||
export declare abstract class TransitionIntent<R extends Route> { | ||
data: {}; | ||
@@ -8,0 +8,0 @@ router: Router<R>; |
@@ -6,3 +6,3 @@ import { Dict } from '../core'; | ||
import TransitionState from '../transition-state'; | ||
export default class NamedTransitionIntent<R extends Route<{}>> extends TransitionIntent<R> { | ||
export default class NamedTransitionIntent<R extends Route> extends TransitionIntent<R> { | ||
name: string; | ||
@@ -9,0 +9,0 @@ pivotHandler?: Route; |
@@ -5,3 +5,3 @@ import { Route } from '../route-info'; | ||
import TransitionState from '../transition-state'; | ||
export default class URLTransitionIntent<R extends Route<{}>> extends TransitionIntent<R> { | ||
export default class URLTransitionIntent<R extends Route> extends TransitionIntent<R> { | ||
preTransitionState?: TransitionState<R>; | ||
@@ -8,0 +8,0 @@ url: string; |
@@ -8,3 +8,3 @@ import { Promise } from 'rsvp'; | ||
} | ||
export default class TransitionState<R extends Route<{}>> { | ||
export default class TransitionState<R extends Route> { | ||
routeInfos: InternalRouteInfo<R>[]; | ||
@@ -11,0 +11,0 @@ queryParams: Dict<unknown>; |
@@ -30,3 +30,3 @@ import { Promise } from 'rsvp'; | ||
*/ | ||
export default class Transition<R extends Route<{}>> implements Partial<Promise<R>> { | ||
export default class Transition<R extends Route> implements Partial<Promise<R>> { | ||
[STATE_SYMBOL]: TransitionState<R>; | ||
@@ -33,0 +33,0 @@ from: Maybe<RouteInfoWithAttributes>; |
export { default } from './router'; | ||
export { default as InternalTransition, PublicTransition as Transition, logAbort, STATE_SYMBOL, PARAMS_SYMBOL, QUERY_PARAMS_SYMBOL, } from './transition'; | ||
export { default as TransitionState, TransitionError } from './transition-state'; | ||
export { default as InternalRouteInfo, IModel, ModelFor, Route, RouteInfo, RouteInfoWithAttributes, } from './route-info'; | ||
export { default as InternalRouteInfo, ModelFor, Route, RouteInfo, RouteInfoWithAttributes, } from './route-info'; |
@@ -9,3 +9,3 @@ import { Promise } from 'rsvp'; | ||
export declare type ModelFor<T> = T extends Route<infer V> ? V : never; | ||
export interface Route<T extends IModel = {}> { | ||
export interface Route<T = unknown> { | ||
inaccessibleByURL?: boolean; | ||
@@ -43,4 +43,4 @@ routeName: string; | ||
} | ||
export declare function toReadOnlyRouteInfo<R extends Route<{}>>(routeInfos: InternalRouteInfo<R>[], queryParams?: Dict<unknown>, includeAttributes?: boolean): RouteInfoWithAttributes[] | RouteInfo[]; | ||
export default class InternalRouteInfo<R extends Route<{}>> { | ||
export declare function toReadOnlyRouteInfo<R extends Route>(routeInfos: InternalRouteInfo<R>[], queryParams?: Dict<unknown>, includeAttributes?: boolean): RouteInfoWithAttributes[] | RouteInfo[]; | ||
export default class InternalRouteInfo<R extends Route> { | ||
private _routePromise?; | ||
@@ -73,3 +73,3 @@ private _route?; | ||
} | ||
export declare class ResolvedRouteInfo<R extends Route<{}>> extends InternalRouteInfo<R> { | ||
export declare class ResolvedRouteInfo<R extends Route> extends InternalRouteInfo<R> { | ||
isResolved: boolean; | ||
@@ -80,3 +80,3 @@ context: ModelFor<R> | undefined; | ||
} | ||
export declare class UnresolvedRouteInfoByParam<R extends Route<{}>> extends InternalRouteInfo<R> { | ||
export declare class UnresolvedRouteInfoByParam<R extends Route> extends InternalRouteInfo<R> { | ||
params: Dict<unknown>; | ||
@@ -86,3 +86,3 @@ constructor(router: Router<R>, name: string, paramNames: string[], params: Dict<unknown> | undefined, route?: R); | ||
} | ||
export declare class UnresolvedRouteInfoByObject<R extends Route<{}>> extends InternalRouteInfo<R> { | ||
export declare class UnresolvedRouteInfoByObject<R extends Route> extends InternalRouteInfo<R> { | ||
serializer?: SerializerFunc<ModelFor<R>>; | ||
@@ -89,0 +89,0 @@ constructor(router: Router<R>, name: string, paramNames: string[], context: ModelFor<R> | PromiseLike<ModelFor<R>> | undefined); |
import RouteRecognizer, { MatchCallback } from 'route-recognizer'; | ||
import { Promise } from 'rsvp'; | ||
import { Dict, Maybe, Option } from './core'; | ||
import InternalRouteInfo, { IModel, ModelFor, Route, RouteInfo, RouteInfoWithAttributes } from './route-info'; | ||
import InternalRouteInfo, { ModelFor, Route, RouteInfo, RouteInfoWithAttributes } from './route-info'; | ||
import InternalTransition, { OpaqueTransition, PublicTransition as Transition } from './transition'; | ||
@@ -9,3 +9,3 @@ import { TransitionIntent } from './transition-intent'; | ||
import { ChangeList, ModelsAndQueryParams } from './utils'; | ||
export interface SerializerFunc<T extends IModel> { | ||
export interface SerializerFunc<T> { | ||
(model: T, params: string[]): Dict<unknown>; | ||
@@ -17,3 +17,3 @@ } | ||
} | ||
export default abstract class Router<R extends Route<{}>> { | ||
export default abstract class Router<R extends Route> { | ||
private _lastQueryParams; | ||
@@ -235,3 +235,3 @@ log?: (message: string) => void; | ||
} | ||
export interface RoutePartition<R extends Route<{}>> { | ||
export interface RoutePartition<R extends Route> { | ||
updatedContext: InternalRouteInfo<R>[]; | ||
@@ -238,0 +238,0 @@ exited: InternalRouteInfo<R>[]; |
@@ -178,3 +178,3 @@ import RouteRecognizer from 'route-recognizer'; | ||
let queryParams = {}; | ||
if (lastArg !== undefined && lastArg.hasOwnProperty('queryParams')) { | ||
if (lastArg && Object.prototype.hasOwnProperty.call(lastArg, 'queryParams')) { | ||
// We just checked this. | ||
@@ -181,0 +181,0 @@ // TODO: Use an assertion? |
@@ -5,3 +5,3 @@ import { Route } from './route-info'; | ||
export declare type OpaqueIntent = TransitionIntent<any>; | ||
export declare abstract class TransitionIntent<R extends Route<{}>> { | ||
export declare abstract class TransitionIntent<R extends Route> { | ||
data: {}; | ||
@@ -8,0 +8,0 @@ router: Router<R>; |
@@ -6,3 +6,3 @@ import { Dict } from '../core'; | ||
import TransitionState from '../transition-state'; | ||
export default class NamedTransitionIntent<R extends Route<{}>> extends TransitionIntent<R> { | ||
export default class NamedTransitionIntent<R extends Route> extends TransitionIntent<R> { | ||
name: string; | ||
@@ -9,0 +9,0 @@ pivotHandler?: Route; |
@@ -5,3 +5,3 @@ import { Route } from '../route-info'; | ||
import TransitionState from '../transition-state'; | ||
export default class URLTransitionIntent<R extends Route<{}>> extends TransitionIntent<R> { | ||
export default class URLTransitionIntent<R extends Route> extends TransitionIntent<R> { | ||
preTransitionState?: TransitionState<R>; | ||
@@ -8,0 +8,0 @@ url: string; |
@@ -8,3 +8,3 @@ import { Promise } from 'rsvp'; | ||
} | ||
export default class TransitionState<R extends Route<{}>> { | ||
export default class TransitionState<R extends Route> { | ||
routeInfos: InternalRouteInfo<R>[]; | ||
@@ -11,0 +11,0 @@ queryParams: Dict<unknown>; |
@@ -30,3 +30,3 @@ import { Promise } from 'rsvp'; | ||
*/ | ||
export default class Transition<R extends Route<{}>> implements Partial<Promise<R>> { | ||
export default class Transition<R extends Route> implements Partial<Promise<R>> { | ||
[STATE_SYMBOL]: TransitionState<R>; | ||
@@ -33,0 +33,0 @@ from: Maybe<RouteInfoWithAttributes>; |
{ | ||
"name": "router_js", | ||
"version": "8.0.1", | ||
"version": "8.0.2", | ||
"description": "A lightweight JavaScript library is built on top of route-recognizer and rsvp.js to provide an API for handling routes", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -74,3 +74,3 @@ # router.js | ||
router.getHandler = function(name) { | ||
router.getRoute = function(name) { | ||
return myHandlers[name]; | ||
@@ -77,0 +77,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
362553
0