1.0.0-beta.1 (2016-06-30)
https://ui-router.github.io/new-ui-router-site/
These breaking changes are for users upgrading from a previous alpha, not from 0.x legacy series. This list is extensive, but typical users won't be affected by most of these changes.
The most common breaks will be #1 and #2
-
BC-BREAK: renamed all Ui* (lowercase 'i') symbols to UI* (uppercase 'I') for more consistent naming.
- UiView -> UIView
- UiSref -> UISref (and related directives)
- UiInjector -> UIInjector
-
BC-BREAK: Transition Hooks are no longer injected (onBefore/onStart/onExit/onRetain/onEnter/onFinish/onSuccess/onError)
Previously, a hook like
['$state', ($state) => $state.target('foo')]
would get$state
injected. Now, all hooks receive two parameters:- transition: the current Transition, which has an
injector()
function - state: for onEnter/onRetain/onExit hooks only, the State which the hook is being run for. This value will be null for onBefore/onStart/onFinish/onSuccess/onError hooks.
Refactor your hooks from:
['$state', 'mySvc', ($state, mySvc) => mySvc.foo() ? $state.target('foo')] : true
to:(trans) => trans.injector().get('mySvc').foo() ? trans.router.stateService.target('foo') : true
Note: for backwards compatiblity, angular 1 onEnter/onExit/onRetain hooks are still injected
- transition: the current Transition, which has an
-
BC-BREAK: - The (internal API) State object's .resolve property is now an array of Resolvables, built from your state definitions by the StateBuilder
-
BC-BREAK: - Removed the default resolve called
$resolve$
, which was added in a previous alpha -
BC-BREAK: -
Transition.addResolves()
replaced withTransition.addResolvable()
-
BC-BREAK: remove
ResolveContext.getResolvables()
in favor of.getToken()`` and
.getResolvable()` -
BC-BREAK: remove
ResolveContext.invokeLater()
and.invokeNow()
-
BC-BREAK: remove support for
JIT
resolves. This also eliminated the need for theloadAllControllerLocals
hook which was also removed -
BC-BREAK: Replaced
ViewConfig.node
withViewConfig.path
. Angular 1's$(element).data('$uiView')
is affected. Previously the .node was the node for the view. Now the last element in the path is the node for the view. -
BC-BREAK: Nodes no longer have (stateful)
.resolveContext
properties. Instead, a new ResolveContext is wrapped over a Path of Nodes. RemovedPathFactory.bindResolveContexts()
. -
BC-BREAK: ResolveContext.resolvePath returns a promise for resolved data as an array of tuples, instead of a promise for an object of resolved data. Removed
ResolveContext.resolvePathElement()
. -
BC-BREAK: Removed ResolvePolicy enum in favor of the ResolvePolicy interface
{ when: "", async: "" }
-
BC-BREAK: renamed
ResolveContext.isolateRootTo
tosubContext
-
BC-BREAK: rename
UIRouterGlobals
class toGlobals
; addUIRouterGlobals
back as an interface -
BC-BREAK: Moved
defaultErrorHandler
fromTransitionService
toStateService
- Resolve: Switch state.resolve to be an array of Resolvables (6743a60)
- Resolve: support ng2-like provide object literals. Support injection of arbitrary tokens, not just strings. (a7e5ea6)
- Resolve: support ng2-like provide object literals (a7e5ea6)
- Transition: expose the current
UiRouter
object as a public property (52f1308) - redirectTo: Process
redirectTo
property of a state as a redirect string/object/hook function (6becb12), closes #27 #948 - rejectFactory: separate transition aborted and transition errored reject types (55995fd)
- ParamType: allow a custom parameter Type to specify a default value for a parameter's
dynamic
property - Resolvable: Added a new Resolve Policy 'RXWAIT'. If an Observable is returned, pass the observable as the value, but also wait for it to emit its first value
- ng2.pushState: Properly match urls when base path set (b9be2dc), closes #2745
- ng2.UIRouterConfig: Allow new UIRouter() to finish before configuring it (a151f71)
- ng2.UiView: fix input resolve binding (4f53f81)
- ng2.UIView: Make routed to component appear inside UIView, not next to it. (558fc80)
- redirect: fix bug where redirected transitions with reload: true got wrong resolve values copied (bd0e3a3)
- Rejection: Silence "Error: Uncaught (in Exception)" (38432f4), closes #2676
- Trace: Fix error in console after $trace.enable() (013c77a), closes #2752
- ng2.UIView: Trigger change detection once for routed components
1.0.0-alpha.5 (2016-05-13)
- attachRoute: Do not update URL after syncing from url(8742511), closes #2730
- common: only use window if available(32ff988)
- coreservices: Use Promise.reject()/resolve()/all()(62b2ebc), closes #2683
- paramTypes.hash: Update hash for each transition(79d4fd7), closes #2742
- Rejection: Dont log an ignored trans as console.error(7522c26), closes #2676
- resolve: Fix regression; Allow resolve values to be service names(a34fd3b), closes #2588
- StateQueueManager: Do not throw on orphan states.(95ae0cf), closes #2546
- TransitionManager: Update url even when the Transition is ignored.(f9c3e3c), closes #2723
- ng1.component: Allow route-to-component "@" and optional bindings(71b3393), closes #2708
- view: only run ng1 route-to-component code if component: is a string(ec1c534)
- ng2.uiSrefStatus: Avoid "dehydrated detector" error(9111727), closes #2684
- ng2.uiView: Fix "Invalid left-hand in assignment"(3f711a1)
- build: declare external dep on
angular/core
in webpack bundle(adfbde3), closes #2687
- ng2.uiView: bind resolve data to input[] and @Input(), process bindings:(f6dae28)
- ng2.urlRouter: HTML5 PushState support(9842fb7), closes #2688
- ng2.UIRouter: update to ng2 beta.17(45c0758)
- ng2.UIRouter: Update ui-router for ng2 rc.1(3219406), closes #2722
1.0.0-alpha.4 (2016-04-06)
- ng2.uiView: Fix "Invalid left-hand in assignment" (3f711a1)
- view: only run ng1 route-to-component code if component: is a string (ec1c534)
- uiView: add support for hybrid ng1/ng2 ui-router apps via ng-upgrade and http://github.com/ui-router/ng1-to-ng2
- ng2.uiView: bind resolve data to input[] and @Input(), process bindings: (f6dae28)
1.0.0-alpha.2 (2016-04-03)
Changes between 1.0.0-alpha.1 and 1.0.0-alpha.2
This is the first release with angular 2 support. See http://github.com/ui-router/quickstart-ng2 for a small ui-router-ng2 app
- ViewHooks: Avoid calling $onInit if angular 1.5 will call it for us (d42b617), closes #2660
- ViewHooks: Fix problem with injecting uiCanExit (76ab22d), closes #2661
- view: temporary sanity check that a node exists (1c0edeb), closes #2657
- justjs.$q: Fix $q.all([..]) and $q.all({...}) (b1624c6)
- ng2.uiSref: Fix anchor href generation (98b5b42)
- ng2.uiSrefStatus: calculate target state parameters (46cdf4c)
- ng2.uiView: Dispose prev comp on empty viewconfig (f28e0c3)
- UIRouterConfig: Define UIRouterConfig class for router bootstrap (c16b9e6)
- UIRouterGlobals: Create UIRouterGlobals (0eb7406), closes #2525
- ui-router-ng2: Update providers and viewsBuilder to match new 1.0 API (ff54d61)
- ng2.uiSrefActive: Implement uiSrefStatus, uiSrefActive, uiSrefActiveEq (fcb15c5)
1.0.0-alpha.1 (2016-03-27)
We will maintain a list of Known BC from 0.2.x to 1.0 final to help people upgrade to the 1.0 release.
- date: Compare dates only using year, month, date (7a68ade), closes #2484
- params: Clone all properties of a Node. Introduce applyRawParams() (88c624d)
- RejectFactory: stringify rejections with circular dependency-aware stringify (199db79), closes #2538
- src/resolve: use injector's strictDi value in calls to .annotate (4c5b5d8)
- stateQueueManager: Use
location: true
for url-matched transitions (25e0c04), closes #2455 - stateService: Process reload: in the StateService.target() (081da32), closes #2537
- Transition: Do not reuse resolves for reloaded state during redirect (0c123c3), closes #2539
- Transition: Reject Transition promise when onBefore error (4b6d56f), closes #2561
- Transition: Reset URL to current state after aborted transition (3a1308b), closes #2611
- transition/transitionService: uses console.error to log error in default error handler (43a8fc5)
- ui-sref: update ui-sref-active/eq info when params change (dcbaebf), closes #2554
- ui-state: update ui-sref-active/eq info (025ebc8), closes #2488
- UrlMatcher: Format parent/child UrlMatchers properly (86e07ef), closes ##2504
- UrlMatcher: isOptional always false for empty parameter (4e85db4)
- params: Add uiOnParamsChanged controller callback (961c96d), closes #2608 #2470 #2391 #1967
- resolve: Allow all resolved data for a node to be injected as
$resolve$
(e432c27) - state: Expose the internal state API via
$$state()
(92053f1), closes #13 - ui-router-ng2: Initial angular2 support (217de70)
- uiCanExit: Add controller lifecycle hook "uiCanExit" (afcfe95)
- uiView: Expose the resolved data for a state as $scope.$resolve (0f6aea6), closes #2175 #2547
- uiView: Fire the $onInit hook (c8afc38), closes #2559
- uiView: Put $animate promises on element.data('$uiView') (a5578de), closes #2562 #2579
- view: Route a view to a directive using
component:
(1552032), closes #2627
Many of these commits are merged from 0.2.x legacy
branch
- uiSrefActive: allow multiple classes (120d7ad), closes #2481 #2482
- justjs: provide naive implementation of most of the coreservices api (426f134)
- resolve: add $resolve service back to 1.0 (70c6659)
- uiSrefActive: allow active & active-eq on same element (d9a676b), closes #1997
- uiSrefActive: provide a ng-{class,style} like interface (a9ff6fe), closes #1431
- uiSrefActive: Added support for multiple nested uiSref directives (b184494)
- uiState: add ui-state directive (3831af1), closes #395 #900 #1932
- urlMatcher: add support for optional spaces (4b7f304)
- urlMatcher: Add param only type names (6a371f9)
- $IncludedByStateFilter: add parameters to $IncludedByStateFilter (963f6e7), closes #1735
- $state: make state data inheritance prototypical (c4fec8c)
- $state: Inject templateProvider with resolved values (afa20f2)
- $state: added 'state' to state reload method (feat no.1612) (b8f0457)
- $state: broadcast $stateChangeCancel event when event.preventDefault() is called in $sta (ecefb75)
- $state: inject resolve params into controllerProvider (b380c22), closes #1131
- $state: support URLs with #fragments (3da0a17)
- $uiViewScroll: change function to return promise (c2a9a31), closes #1702
This is a maintenance release which fixes a few known bugs introduced in 0.2.16.
- $urlRouter: revert BC: resolve clashing of routes This reverts commit b5c57c8ec2e14e17e75104 (2f1ebefc, closes #2501)
- uiState: Corrected typo for 'ref' variable (#2488, #2508) (b8f3c144)
- $urlMatcherFactory: Fix to make the YUI Javascript compressor work (ad9c41d2)
- stateBuilder: fix non-url params on a state without a url. The parameters are now applied when (d6d8c332, closes #2025)
- ui-view: (ui-view) use static renderer when no animation is present for a ui-view (2523bbdb, closes #2485). This allows a ui-view scope to be destroyed when switching states, before the next view is initialized.
- ui-view: Add noanimation attribute to specify static renderer. (2523bbdb, closes #2485). This allows a ui-view scope to be destroyed before the next ui-view is initialized, when ui-view animation is not present.
- $state:
- statechangeCancel: Avoid infinite digest in .otherwise/redirect case. Don't clobber url if a new transition has started. Closes #222 (e00aa695, closes #2238)
- transitionTo: Allow hash (#) value to be read as toParams['#'] in events. Re-add the saved hash before broadcasting $stateChangeStart event. (8c1bf30d)
- $stateParams: Fix for testing: reset service instance between tests (2aeb0c4b)
- $urlRouter:
- UrlMatcher:
- Properly encode/decode slashes in parameters Closes #2172 Closes #2250 Closes #1 (02e98660, closes #2339)
- Array types: Fix default value for array query parameters. Pass empty arrays through in handler. (20d6e243, closes #2222)
- Remove trailing slash, if parameter is optional and was squashed from URL (77fa11bf, closes #1902)
- Allow a parameter declaration to configure the parameter type by name. closes #2294 (e4010249)
- include the slash when recognizing squashed params in url (b5130bb1, closes #2064)
- Allow url query param names to contain periods (d31b3337)
- reloadOnSearch: Update
locals.globals.$stateParams
when reloadOnSearch=false (350d3e87, closes #2356) - ui-view:
- uiSref:
- $IncludedByStateFilter: add parameters to $IncludedByStateFilter (963f6e71, closes #1735)
- isStateFilter: Include optional state params. (71d74699)
- $state: make state data inheritance prototypical (c4fec8c7)
- $stateChangeStart: Add options to event (a1f07559)
- UrlMatcher: Add param only type names (6a371f9b)
- uiSrefActive:
- uiState: add ui-state directive (3831af1d, closes #395, #900, #1932)
- urlMatcher: add support for optional spaces in params (4b7f3046)
- $state: reloadOnSearch should not affect non-search param changes. (6ca0d770, closes #1079)
- urlMatcherFactory: Revert to 0.2.13 behavior where all string parameters are considered optional fi (495a02c3, closes #1963)
- urlRouter: allow .when() to redirect, even after a successful $state.go() - This partially (48aeaff6, closes #1584)
- $state: Inject templateProvider with resolved values (afa20f22)
- $StateRefDirective: resolve missing support for svg anchor elements #1667 (0149a7bb)
- $urlMatcherFactory:
- $state: allow about.*.** glob patterns (e39b27a2)
- uiSref:
- uiSrefActive: Apply active classes on lazy loaded states (f0ddbe7b)
- uiView: add
$element
to locals for view controller (db68914c)
- $state:
- $uiViewScroll: change function to return promise (c2a9a311, closes #1702)
- uiSrefActive: Added support for multiple nested uiSref directives (b1844948)
This release primarily fixes issues reported against 0.2.12
- $state: fix $state.includes/.is to apply param types before comparisions fix(uiSref): ma (19715d15, closes #1513)
- $urlMatcherFactory:
- Built-in date type uses local time zone (d726bedc)
- make date type fn check .is before running (aa94ce3b, closes #1564)
- early binding of array handler bypasses type resolution (ada4bc27)
- add 'any' Type for non-encoding non-url params (3bfd75ab, closes #1562)
- fix encoding slashes in params (0c983a08, closes #1119)
- fix mixed path/query params ordering problem (a479fbd0, closes #1543)
- ArrayType:
- Param: fix default value shorthand declaration (831d812a, closes #1554)
- common: fixed the _.filter clone to not create sparse arrays (750f5cf5, closes #1563)
- ie8: fix calls to indexOf and filter (dcb31b84, closes #1556)
- add json parameter Type (027f1fcf)
- $resolve: use resolve fn result, not parent resolved value of same name (67f5e00c, closes [#1317], [#1353])
- $state:
- $urlMatcherFactory:
- register types at config (4533fe36, closes [#1476])
- made path params default value "" for backwards compat (8f998e71)
- Pre-replace certain param values for better mapping (6374a3e2)
- fixed ParamSet.$$keys() ordering (9136fecb)
- empty string policy now respected in Param.value() (db12c85c)
- "string" type now encodes/decodes slashes (3045e415, closes [#1119])
- allow arrays in both path and query params (fdd2f2c1, closes [#1073], [#1045], [#1486], [#1394])
- typed params in search (8d4cab69, closes #1488)
- no longer generate unroutable urls (cb9fd9d8, closes #1487)
- handle optional parameter followed by required parameter in url format. (efc72106)
- default to parameter string coersion. (13a468a7, closes #1414)
- concat respects strictMode/caseInsensitive (dd72e103, closes [#1395])
- ui-sref:
- uiView:
- urlRouter: html5Mode accepts an object from angular v1.3.0-rc.3 (7fea1e9d)
- stateFilters: mark state filters as stateful. (a00b353e, closes [#1479])
- ui-router: re-add IE8 compatibility for map/filter/keys (8ce69d9f, closes [#1518], [#1383])
- package: point 'main' to a valid filename (ac903350)
- travis: make CI build faster (0531de05)
This release includes a lot of bug fixes around default/optional and typed parameters. As such, 0.2.12 is the first release where we recommend those features be used.
- $state:
- $templateFactory: request templateURL as text/html (ccd60769, closes [#1287])
- $urlMatcherFactory: Made a Params and ParamSet class (0cc1e6cc)
- $resolve: Resolves only inherit from immediate parent fixes #702 (df34e20c)
- $state:
- $urlMatcherFactory:
- UrlMatcher:
- travis: update Node version to fix build (d6b95ef2)
- uiSref:
- uiView: Fixed infinite loop when is called .go() from a controller. (e13988b8, closes #1194)
- docs:
- $state:
- typescript: Add typescript definitions for component builds (521ceb3f)
- uiSref: extend syntax for ui-sref (71cad3d6)
- uiSrefActive:
-
Also activate for child states. (bf163ad6, closes #818)
- BREAKING CHANGE Since ui-sref-active now activates even when child states are active you may need to swap out your ui-sref-active with ui-sref-active-eq, thought typically we think devs want the auto inheritance.
-
uiSrefActiveEq: new directive with old ui-sref-active behavior
-
- $urlRouter:
- $urlMatcherFactory:
- UrlMatcher:
- handle query string arrays (9cf764ef, closes #373)
- injectable functions as defaults (00966ecd)
- default values & type decoding for query params (a472b301)
- allow shorthand definitions (5b724304)
- validates whole interface (32b27db1)
- implement non-strict matching (a3e21366)
- add per-param config support (07b3029f)
- BREAKING CHANGE: the
params
option in state configurations must now be an object keyed by parameter name.
- BREAKING CHANGE: the
- $state: use $browser.baseHref() when generating urls with .href() (cbcc8488)
- bower.json: JS files should not be ignored (ccdab193)
- dev: karma:background task is missing, can't run grunt:dev. (d9f7b898)
- sample: Contacts menu button not staying active when navigating to detail states. Need t (2fcb8443)
- uiSref: support mock-clicks/events with no data (717d3ff7)
- uiView:
- $state: includes() allows glob patterns for state matching. (2d5f6b37)
- UrlMatcher: Add support for case insensitive url matching (642d5247)
- uiSref: add support for transition options (2ed7a728)
- uiView: add controllerAs config with function (1ee7334a)
This release is identical to 0.2.8. 0.2.8 was re-tagged in git to fix a problem with bower.