-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(TransitionHook): Transition hooks no longer expose the internal S…
…tateObject BREAKING CHANGE: Transition hooks no longer expose the internal `State` object (now named `StateObject`) - #### Before: ```js import { State } from "ui-router-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: ```js import { StateDeclaration } from "ui-router-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()`.
- Loading branch information
1 parent
3a5d055
commit 2b0e48b
Showing
7 changed files
with
116 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.