Skip to content

2.0.0

Compare
Choose a tag to compare
@christopherthielen christopherthielen released this 08 Jan 19:48
· 1178 commits to master since this release

ui-router-core changes

2.0.0 (2016-12-09)

Bug Fixes

  • lazyLoad: Sync by URL after nested lazy load triggered by URL (1c6220c)
  • redirect: Do not allow onBefore hooks to cause infinite redirect loops (5c5f7eb), closes #6
  • redirectTo: Do not puke when redirectTo returns undefined (bde9c0f)
  • redirectTo: fix TS type signature of redirectTo (2c059c4)
  • StateQueueManager: Compare parsed url parameters using typed parameters (beca1f5)
  • StateRegistry: Fix error message: State '' is already defined (f5bd96b)
  • StateService: Compare typed parameters in .is() and .includes() (b1a5155)
  • TargetState: Narrow name() return type to String (a02f4a7)
  • typescript: Emit TS 1.8 compatible .d.ts files (65badf4)
  • view: Load view prerequisites in onFinish (cc85e76)
  • view.load: Allow view.load to return synchronously (8619cf9)

Features

  • Create router.dispose() to dispose a router instance and resources. (0690917)
  • assertMap: Add a [].map() helper that asserts that each element is truthy (f044f53)
  • futureState: States with a .** name suffix (i.e., foo.**) are considered future states (ec50da4), closes #8 #4
  • HookBuilder: Allow custom hook types (to be defined by a plugin) (3f146e6)
  • onCreate: Add onCreate transition hook (f486ced)
  • plugin: Allow all plugins to be gotted. (e324973)
  • plugin: Allow registration by ES6 class, JS constructor fn, JS factory fn (b9f4541)
  • plugin: Create plugin API (36a5215), closes #7
  • Transition: Support treechange paths in API for Resolve+transition (beedc82)
  • vanilla: Implement in-memory-only location api (f64aace)

BREAKING CHANGES

  • typescript: move ViewService.viewConfigFactory and rootContext to _pluginapi.*
    This BC happened in commit 6c42285
  • futureState: Previously, a state with a lazyLoad function was considered a future state.
    Now, a state whose name ends with .** (i.e., a glob pattern which matches all children) is a future state.

All future states should be given a name that ends in .**.

Change your future states from:

{ name: 'future', url: '/future', lazyLoad: () => ... }

to:

{ name: 'future.**', url: '/future', lazyLoad: () => ... }
  • onCreate: Hook errors are all normalized to a "Rejection" type. To access the detail of the error thrown (throw "Error 123"), use .detail, i.e.:

    Before

$state.go('foo').catch(err => { if (err === "Error 123") .. });

New way

$state.go('foo').catch(err => { if (err.detail === "Error 123") .. });