Summary:
There are a few important states that didn't reset correctly when reloading JS:
* the RCTSurfaceStage was stuck at all bits enabled, hence no further stage change happened (even though the state "reset" to `RCTSurfaceStageBridgeDidLoad`)
* the RCTSurfaceView didn't get recreated, because the _view ivar was never cleared
* similarly, the _touchHandler ivar attached to the _view was never re-setup --> all touches after JS reload were dropped before this diff
Reviewed By: mmmulani
Differential Revision: D7178038
fbshipit-source-id: ba49bc205f8bf43842471b7ab748cef8549ea212
Summary: When reloading JS during development, surface needs to make sure the root view gets re-registered before attempting to remount it. This fixes redbox on JS reload.
Reviewed By: shergin
Differential Revision: D7170416
fbshipit-source-id: c84b999d2cdc35cb9e26feef2a1e1a7ce35cfa70
Summary:
So, all initial operations can now be done synchronously (and on the main thread).
To do so, instancitate `RCTSurface` object and call `synchronouslyWaitForStage:timeout:` method like that:
RCTSurface *surface = [[RCTSurface alloc] initWithBridge:... moduleName:... initialProperties:...];
BOOL success = [surface synchronouslyWaitForStage:RCTSurfaceStageSurfaceDidInitialMounting timeout:timeout];
or
RCTSurfaceHostingView *surfaceHostingView = [[RCTSurfaceHostingView alloc] initWithBridge:... moduleName:... initialProperties:...];
BOOL success = [surfaceHostingView.surface synchronouslyWaitForStage:RCTSurfaceStageSurfaceDidInitialMounting timeout:timeout];
Reviewed By: fkgozali
Differential Revision: D7014178
fbshipit-source-id: c3c13904a3587ff2a222fa71623c40c8f30bc8af
Summary:
See the comment in code.
If we on the main thread on registering time, we can/will break sequentiality of registering and mounting processes doing registration asynchronously.
We need this to make sync mouting eventually possible.
Reviewed By: fkgozali
Differential Revision: D7014176
fbshipit-source-id: 110ad5e5d86e3422eac15c3b1bdb29ae04acd7e6
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.
find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.
Reviewed By: TheSavior, yungsters
Differential Revision: D7007050
fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
Summary: Waiting for layout is now available on main thread.
Reviewed By: mmmulani
Differential Revision: D6719836
fbshipit-source-id: ef655095e999df5f77e69c5931459cce1aaeb1f0
Summary:
Essentially, we had `dispatch_async` inside `delloc` method which tried to retain `self`, which is disallowed operation in ObjC runtime.
However, we don't need to notify anything `surface`-related in `_stop` because it always is called from `dealloc`.
Reviewed By: mmmulani
Differential Revision: D6665631
fbshipit-source-id: ed0d192946f3323f4f54ecb99b30e56e0942f174
Summary: Because we already support this for all kinds of shadow views!
Reviewed By: mmmulani
Differential Revision: D6665636
fbshipit-source-id: ceee7e4952ede4bbe54aedde5545587a1d13ea5a
Summary: See `RCTShadowView+Layout.m` for more info about differences between CGFLOAT_MAX and INFINITY in Yoga and UIKit.
Reviewed By: mmmulani
Differential Revision: D6665635
fbshipit-source-id: 270ba5366c3dfe78e38474de5380d7d5d251e628
Summary: We need this trivial funcs to unify spinner appearance logic.
Reviewed By: rsnara
Differential Revision: D6367072
fbshipit-source-id: 70e288bc1fed5911828a5f6deaa829597bf8ebff
Summary: We don't really need sync dispatch here. We only need sequential execution of our UIManager blocks.
Reviewed By: rsnara
Differential Revision: D6367069
fbshipit-source-id: cc675aafd6c762506048bcf65c24e54080b013a5
Summary: We previously incorrectly communicated to the delegate changed fragment instead of compound value.
Reviewed By: rsnara
Differential Revision: D6367070
fbshipit-source-id: 373a7c14a79a4727a7e8f61178dea3ca16ea1f40
Summary:
RCTSurface instance represents React Native-powered piece of a user interface
which can be a full-screen app, separate modal view controller,
or even small widget. It is called "Surface".
The RCTSurface instance is completely thread-safe by design;
it can be created on any thread, and any its method can be called from
any thread (if the opposite is not mentioned explicitly).
The primary goals of the RCTSurface are:
- ability to measure and layout the surface in a thread-safe and synchronous manner;
- ability to create a UIView instance on demand (later);
- ability to communicate the current stage of the surface granularly.
Differential Revision: D6202576
fbshipit-source-id: 8e644c87fcaad2b6a9c9304b58384d7192747556