Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uirouter/core

Package Overview
Dependencies
Maintainers
4
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uirouter/core - npm Package Versions

123

5.0.9

Diff

Changelog

Source

5.0.9 (2017-10-02)

Compare @uirouter/core versions 5.0.8 and 5.0.9

Bug Fixes

  • redirectTo: Allow void in RedirectToResult

Features

  • TransitionHook: Add hook registration option invokeLimit to limit the number of times a hook is invoked before being auto-deregistered. (2cb17ef)
christopherthielen
published 5.0.8 •

Changelog

Source

5.0.8 (2017-09-30)

Compare @uirouter/core versions 5.0.7 and 5.0.8

Bug Fixes

  • bundle: Rollup: Do not warn on THIS_IS_UNDEFINED (a4581b1)
  • redirectTo: Fix typings for redirectTo. Allow a function that returns a target state or a promise for one. (3904487)

Features

  • TargetState: Add builder methods .withState, .withParams, and .withOptions (6b93142)
christopherthielen
published 5.0.7 •

Changelog

Source

5.0.7 (2017-09-23)

Compare @uirouter/core versions 5.0.6 and 5.0.7

Bug Fixes

  • globals: Use shallow copy to update the globals.params / $state.params object (e883afc)
  • Injector: When getting tokens from native injector, only throw on undefined (not on falsey values) (ada9ca2)
  • trace: Fall back to console.log if .table is unavailable (IE) (c8110fc)
  • trace: Support tracing of object-parameters with circular references (2f1ae9a)
  • url: Add CustomEvent polyfill for IE (a50db21)
  • vanilla: fix base path handling for vanilla push state (ad61d74)
  • vanilla: Use self instead of window for webworker compat (a4629ee)
christopherthielen
published 5.0.6 •

Changelog

Source

Changes in @uirouter/core between versions 5.0.5 and 5.0.6 (2017-08-12)

Bug Fixes

  • sourceMaps: Embed typescript sources in sourcemaps (10558a3)
  • typescript: Fix strictNullCheck type error (0ae585e)
  • urlRouter: Fix absolute 'href' generation by using location.hostname (not location.host) (a28b68a)
  • urlService: Fix priority sorting of URL rules (73a1fe0)
christopherthielen
published 5.0.5 •

Changelog

Source

Changes in @uirouter/core between versions 5.0.5 and 5.0.6 (2017-08-12)

Bug Fixes

  • sourceMaps: Embed typescript sources in sourcemaps (10558a3)
  • typescript: Fix strictNullCheck type error (0ae585e)
  • urlRouter: Fix absolute 'href' generation by using location.hostname (not location.host) (a28b68a)
  • urlService: Fix priority sorting of URL rules (73a1fe0)
christopherthielen
published 5.0.4 •

Changelog

Source

Changes in @uirouter/core between versions 5.0.4 and 5.0.5 (2017-06-29)

Bug Fixes

  • typescript: Update to typescript 2.4 (ce1669b)

Features

  • urlMatcher: add support for multiline urls (5b11ce0)

@uirouter/core changes

christopherthielen
published 5.0.3 •

Changelog

Source

5.0.3 (2017-05-07)

Bug Fixes

  • common: Re-fix implementation of 'pick' using for .. in (f2da7f4)

@uirouter/core changes

christopherthielen
published 5.0.2 •

Changelog

Source

5.0.2 (2017-05-06)

Bug Fixes

  • common: Fix implementation of 'pick' -- use hasOwnProperty (09848a4)

Features

  • build: Build and distribute UMD bundles (0a8da85)

@uirouter/core changes

christopherthielen
published 5.0.1 •

Changelog

Source

5.0.1 (2017-05-03)

Bug Fixes

  • transition: Do not ignore transitions which have states being entered or exited (175717e)

@uirouter/core changes

christopherthielen
published 5.0.0 •

Changelog

Source

5.0.0 (2017-04-21)

Bug Fixes

  • BrowserLocationConfig: fixed protocol + port value (#38) (5559382)
  • lazyLoad: Wait for future state to be replaced before registering lazy children (4bdce47)
  • noImplicitAny: Fix noimplicitany compliance (1a6cdfc)
  • redirect: Do not update URL after redirect with { location: false } (652a760)
  • tfs: Rename $q.ts and $injector.ts files, removing leading dollar signs (cb653ee)
  • trace: Re-add transitionStart trace (b019036)
  • transitionHook: Do not process transition hooks after router has been disposed. (666c6d7)
  • TransitionHook: Transition hooks no longer expose the internal StateObject (2b0e48b)
  • typings: Allow strictNullChecks for HookMatchCriteria (d92d4d5)
  • ui-sref: Improve performance of generating hrefs (c3967bd)
  • view: Do not throw when uiView doesn't have a state context (f76ee2a)
  • view: Update views in order of ui-view depth and also by state depth (46dea2b)

Features

  • abort: Add API to manually abort/cancel a transition (39f8a53)
  • common: Perf improvements in hot functions: (4193244)
  • core: Switch to @uirouter/core npm module (e3f389f)
  • decorators: Add state, resolve and resolve data decorators (642df0b)
  • defaultErrorHandler: Do not invoke default error handler for ABORTED transitions (b07a24b)
  • Globals: implement Disposable and delete global transition data (a794018)
  • onBefore: Run onBefore hooks asynchronously. (30b82aa)
  • onEnter/Exit/Retain: Use onExit/onEnter/onRetain from 56955state(), not state.self (bc1f554)
  • Rejection: Add $id to ease debugging of transition rejections (d456d54)
  • State: Support registration of ES6 state classes (as opposed to object literals) (3a5d055)
  • State: Switch Internal State Object to prototypally inherit from the State Declaration (027c995), closes #34
  • StateObject: Rename internal State object to StateObject (feceaf9)
  • StateRegistry: improve perf for: .register() and StateMatcher.find() misses (fdb3ab9)
  • transition: Ignore duplicate transitions (double clicks) (bd1bd0b)
  • transition: Improve supersede logic: Do not supersede if the new trans is aborted before onStart (3141a8f)
  • transition: Run hooks synchronously in current stack, when possible (953e618)
  • Transition: deprecate Transition.is() which was never implemented (1edff4b)
  • Transition: Normalize all transition errors to a Rejection. (a7464bb)
  • UrlService: (UrlRouter) improve perf of registering Url Rules and sorting Url Rules (64fbfff)
  • UrlService: Add rules.initial("/home") to config initial state (like otherwise) (bbe4209)

BREAKING CHANGES

TransitionHook: Transition hooks no longer expose the internal State object (now named StateObject)

Before:
import { State } from "@uirouter/core";
const match = { to: (state: State) => state.data.auth };
transitionsvc.onEnter(match, (trans: Transition, state: State) => {
  // state is the internal State object
  if (state.includes["foo"]) { // internal ui-router API
    return false;
  }
}
Now:
import { StateDeclaration } from "@uirouter/core";
const match = { to: (state: StateDeclaration) => state.data.auth };
transitionsvc.onEnter(match, (trans: Transition, state: StateDeclaration) => {
  // state === the state object you registered
  // Access internal ui-router API using $$state()
  if (state.$$state().includes["foo"]) {
    return false;
  }
}
Motivation:

The State object (now named StateObject) is an internal API and should not be exposed via any public APIs. If you depend on the internal APIs, you can still access the internal object by calling state.$$state().

BC Likelihood

How likely is this BC to affect me?

Medium: You will likely be affected you 1) have transition hooks, 2) are using typescript and/or 3) use the internal ui-router State API.

BC Severity

How severe is this BC?

Low: Access to the internal api is still available using $$state().

StateObject: Renamed internal API State object to StateObject

Before:
import {State} from "@uirouter/core";
Now:
import {StateObject} from "@uirouter/core";
Motivation:

We'd like to use the State name/symbol as a public API. It will be an ES7/TS decorator for ES6/TS state definition classes, i.e:

@State("foo")
export class FooState implements StateDeclaration {
  url = "/foo";
  component = FooComponent;

  @Resolve({ deps: [FooService] })
  fooData(fooService) {
    return fooService.getFoos();
  }
}
BC Likelihood

How likely is this to affect me?

Low: This only affects code that imports the internal API symbol State. You will likely be affected you 1) import that symbol, 2) are using typescript and 3) explicitly typed a variable such as let internalStateObject = state.$$state();

BC Severity

How severe is this change?

Low: Find all places where State is imported and rename to StateObject

Transition: All Transition errors are now wrapped in a Rejection object.

Before:

Previously, if a transition hook returned a rejected promise:

.onStart({}, () => Promise.reject('reject transition'));

In onError or transtion.promise.catch(), the raw rejection was returned:

.onError({}, (trans, err) => err === 'reject transition')
Now:

Now, the error is wrapped in a Rejection object.

  • The detail (thrown error or rejected value) is still available as .detail.
.onError({}, (trans, err) =>
    err instanceof Rejection && err.detail === 'reject transition')
  • The Rejection object indicates the .type of transition rejection (ABORTED, ERROR, SUPERSEDED and/or redirection).
.onError({}, (trans, err) => {
  err.type === RejectType.ABORTED === 3
});
Motivation:

Errors thrown from a hook and rejection values returned from a hook can now be processed in the same way.

BC Likelihood

How likely is this to affect me?

Medium: apps which have onError handlers for rejected values

BC Severity

How severe is this change?

Low: Find all error handlers (or .catch/.then chains) that do not understand Rejection. Add err.detail processing.

onBefore: onBefore hooks are now run asynchronously like all the other hooks.

Old behavior

Previously, the onBefore hooks were run in the same stackframe as transitionTo. If they threw an error, it could be caught using try/catch.

transitionService.onBefore({ to: 'foo' }), () => { throw new Error('doh'); });
try {
  stateService.go('foo');
} catch (error) {
  // handle error
}
New behavior

Now, onBefore hooks are processed asynchronously. To handle errors, use any of the async error handling paradigms:

  • Chain off the promise
    transitionService.onBefore({ to: 'foo' }), () => { throw new Error('doh'); });
    stateService.go('foo').catch(error => { //handle error });
    
  • Define an error handler
    transitionService.onBefore({ to: 'foo' }), () => { throw new Error('doh'); });
    transitionService.onError({ to: 'foo' }), () => { // handle error });
    stateService.go('foo');
    
  • Use the global defaultErrorHandler
    transitionService.onBefore({ to: 'foo' }), () => { throw new Error('doh'); });
    stateService.go('foo');
    stateService.defaultErrorHandler(error => { // global error handler });
    
Motivation

Why introduce a BC?

  • No subtle behavior differences by hook type
  • Simpler code and mental model
  • Fewer edge cases to account for
BC Liklihood

How likely is this to affect my app?

Very Low: Apps that registered onBefore hooks and depend on synchronous execution are affected.

BC Severity

How severe is this BC?

Low: Switch to asynchronous handling, such as chaining off the transition promise

defaultErrorHandler: ABORTED transitions do not invoke the defaultErrorHandler

Returning false from a transition hook will abort the transition.

Old behavior

Previously, this case was considered an error and was logged by defaultErrorHandler. After your feedback, we agree that this is not typically an error.

New behavior

Now, aborted transitions do not trigger the defaultErrorHandler

Motivation:

Why introduce a BC?

Most users do not consider ABORT to be an error. The default error handler should match this assumption.

BC liklihood

How likely am I to be affected?

Low: Most users do not consider ABORT to be an error. For most users this will not be a BC.

BC severity

How severe is this BC?

Low: Users who want to handle all transition rejections can register a .onError handler and filter/process accordingly.

@uirouter/core changes

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc