Commit Graph

14 Commits

Author SHA1 Message Date
Hedger Wang 3a8c302ae8 NavigationExperimental: Add documentation for NavigationStateUtils.
Summary: Add docs to NavigationStateUtils.

Reviewed By: ericvicenti

Differential Revision: D3679295

fbshipit-source-id: 26fc1e4f39af58e11572b74b150e08b3094e36c6
2016-08-14 23:13:23 -07:00
Hedger Wang 614f3c68e6 Add `NavigationStateUtils.back()` and `NavigationStateUtils.forward()`.
Summary: This makes it easy to build Pager.

Reviewed By: ericvicenti

Differential Revision: D3479979

fbshipit-source-id: 71c0536eb190e8ad64feea99e4bda5e2d28801d2
2016-06-24 15:28:35 -07:00
Hedger Wang 67002e8ae3 Clean up NavigationStateUtils
Summary:
== API Breaking Change ==

- Add unit tests to ensure that NavigationStateUtils does the right thing.
- Remove the logics that lets NavigationStateUtils accept empty value as input
  and return a new state.
- Remove the method `NavigationStateUtils.getParent`, `NavigationStateUtils.set`. These methods are rarely used and they can be replaced by other methods.

Reviewed By: ericvicenti

Differential Revision: D3374934

fbshipit-source-id: 0fdf538d014d7c5b4aa1f15a0ee8db9dc91e33cd
2016-06-08 15:13:31 -07:00
Hedger Wang 69627bf914 Clean up examples.
Summary:
The recent and upcoming API refactoring works makes maintaining
the examples harder and harder.

This removes the old examples that use too much deprecated APIs such as
Reducers, Animated View.

The new examples will be forcus on using new API with all-in-one sample
codes and detailed documentation.

Reviewed By: ericvicenti

Differential Revision: D3354711

fbshipit-source-id: ac6360b1573989eb075d91cb9bf1ae8357dce7fa
2016-05-31 11:43:29 -07:00
Hedger Wang f7279b4074 Remove `key` from `NavigationState`.
Summary:
NavigationState is composed of many things such as `index`, `routes`.
The only way to effectively compare navigation states is to assume their immutability
and simply compare their references.

That said, `navigationState.key` does not really serves anything useful. The key does
not make a navigation state more unique or comparable.

This diff makes  `navigationState.key` irrelevant thus we could make NavigationState
simpler.

Reviewed By: ericvicenti

Differential Revision: D3351915

fbshipit-source-id: 75d5fa432d2a693f999a91b11e3bff1fdd42e61d
2016-05-26 18:13:23 -07:00
Hedger Wang 1e626027f5 Rename `navigationState.children` to `navigationState.routes`.
Summary:
[Experimental API breaking changes]

The notion of `parent` or `children` in navigaton is misleading. We have no intention to maintain or
build the nested or hierarchical navigation states. To be clear, rename `navigationState.children` to
`navigationState.route`.

Reviewed By: ericvicenti

Differential Revision: D3332115

fbshipit-source-id: c72ed08acaf030fb9c60abf22fb15cc0f44b3485
2016-05-22 16:28:27 -07:00
Hedger Wang 807726bcb4 Rename `NavigationState` to `NavigationRoute`, rename `NavigationParentState` to `NavigationState`.
Summary:
This is the first step to clarify and simplify the type definations about navigation state.
For now,  `NavigationParentState` is actually used as the real navigation state and `NavigationState` is used
as a route in navigation, which has been confusion among the APIs.

To be clear, our APIs has no intention and interest in dealing with nested or hierarchical navigation states,
and we should avoid have the name like `ParentState` or `children`.

To fully migrate the types, theer will be a lot of code changes and this is just the first step to rename.

= What's Next?

1. rename `navigationState.children` to `navigationState.routes` (breaking change!)
2. remove `navigationState.key` from its type defination.

Reviewed By: ericvicenti

Differential Revision: D3321403

fbshipit-source-id: 3e39b60f736c1135bc85d8bf2b89027d665e28d4
2016-05-20 14:28:35 -07:00
Hedger Wang 71e59761c9 Clean up APIs.
Reviewed By: ericvicenti

Differential Revision: D3010136

fb-gh-sync-id: 310864450bfc86ebc2d696f8ef4876b14fa3a57f
shipit-source-id: 310864450bfc86ebc2d696f8ef4876b14fa3a57f
2016-03-04 14:57:31 -08:00
Konstantin Raev 5ffeb9764c Back out of D3000972
Reviewed By: dmmiller

Differential Revision: D3003211

fb-gh-sync-id: e64f1f17dcbf19a32066de91d6e839d59cd5d27c
shipit-source-id: e64f1f17dcbf19a32066de91d6e839d59cd5d27c
2016-03-03 04:21:36 -08:00
Martin Konicek 8717b2d19c Rework the NavigationHeader
Reviewed By: dmmiller, ericvicenti

Differential Revision: D3000972

fb-gh-sync-id: fcd4e63b72a70440e611289f03ed4757e230dc5b
shipit-source-id: fcd4e63b72a70440e611289f03ed4757e230dc5b
2016-03-02 12:21:36 -08:00
David Aurelio eb531943aa Fix the last imports of `'invariant'`
Summary:This changes the last two imports of `'invariant'` that I could find to `'fbjs/lib/invariant'`.
Closes https://github.com/facebook/react-native/pull/6248

Differential Revision: D3000440

fb-gh-sync-id: 15ebd08bb749d1d82b12902dd3dec00914fc1ed5
shipit-source-id: 15ebd08bb749d1d82b12902dd3dec00914fc1ed5
2016-03-02 10:14:59 -08:00
Eric Vicenti dcb68db758 Add sub-reducer support to NavigationStackReducer
Summary: Revise APIs of reducers, and ensure the stack reducer can support sub-reducers

Reviewed By: javache

Differential Revision: D2959915

fb-gh-sync-id: 20b28b9ead7ace3373489a806486999048d32aef
shipit-source-id: 20b28b9ead7ace3373489a806486999048d32aef
2016-02-22 16:17:12 -08:00
Eric Vicenti 876ecb291f Adopt NavigationExperimental in UIExplorer
Summary:Use the new Navigation library to make the UIExplorer navigation more flexible.

Deep linking examples are coming soon (hint: we just need to convert URIs to UIExplorerActions!)

Reviewed By: javache

Differential Revision: D2798050

fb-gh-sync-id: c7775393e2d7a30a161d0770192309567dcc8b0c
shipit-source-id: c7775393e2d7a30a161d0770192309567dcc8b0c
2016-02-22 16:17:06 -08:00
Eric Vicenti a91466f84a Rename NavigationState module to NavigationStateUtils
Summary: There is a NavigationState type within this module so the name cannot be shared

Reviewed By: hedgerwang

Differential Revision: D2938311

fb-gh-sync-id: c5208755c9dfa5bf0e67666957c01e203ddd4218
shipit-source-id: c5208755c9dfa5bf0e67666957c01e203ddd4218
2016-02-19 01:24:54 -08:00