Commit Graph

21 Commits

Author SHA1 Message Date
Dave Lee 0e3117c972 Fix format specifier used in RCTCxxMethod
Summary:
[`CxxModule::Method::callbacks`](2161f92aaf/ReactCommon/cxxreact/CxxModule.h (L66)) is `size_t` which uses `%zu` as the format specifier. Newer versions of clang can warn or error on this. This change prevents that from happening.

Local builds with clang 5.
Closes https://github.com/facebook/react-native/pull/15402

Differential Revision: D5583710

Pulled By: javache

fbshipit-source-id: 1d1e740c275fddfea177cf9476cd1d03b7e27330
2017-08-08 11:55:17 -07:00
Pieter De Baets d42ccca2e1 Allow native modules to customize the main-thread init behaviour
Summary:
We've simplified a lot of the conditions for eager of the module init so now we can introduce a final switch to allow modules to opt-out (and in the future opt-in if they still require the behaviour).

We now require you to be explicit about the intended behaviour and implement the `+ (BOOL)requiresMainQueueSetup` method on your module. When you return YES from this method, it tells the bridge the module needs to be created on the main thread (and to avoid deadlocks, we do so eagerly during bridge startup). When you return NO, the native module will be initialised when it's first accessed from JS.

The current behaviour is maintained but a warning is emitted until the new API is adopted.

Reviewed By: fkgozali

Differential Revision: D5527788

fbshipit-source-id: 56d38f81e58cf950547b9780e89bfac4667eeaaa
2017-08-07 07:04:36 -07:00
Pieter De Baets 1cd276ab5c Specialize JSCValueEncoder for id instead of NSArray
Reviewed By: kathryngray

Differential Revision: D5355723

fbshipit-source-id: a992514c92143fcac52f8e35824c665a1cb44ea4
2017-08-07 06:45:34 -07:00
Pieter De Baets cb12080179 Replace exported method registration with statically allocated struct
Reviewed By: fromcelticpark

Differential Revision: D5389383

fbshipit-source-id: 9eb29b254b616574966b43ad24aa880d44589652
2017-07-24 07:01:53 -07:00
Pieter De Baets f1cbb11620 Replace -[RCTConvert folly_dynamic:] with direct calls to convertIdToFollyDynamic
Reviewed By: kathryngray

Differential Revision: D5355734

fbshipit-source-id: 4ba1533b75c8e271a86a2d5cc3a3354e52f83db2
2017-07-10 05:31:04 -07:00
Viacheslav Radchenko 879edf0d05 Added RCTInspectorDevServerHelper call in FBReactJSExecutor. Added UTF8StringForSourceURL
Reviewed By: javache

Differential Revision: D5246399

fbshipit-source-id: 179ff0b69886c4ff71911fc7b1d3491ff4d5967d
2017-06-14 14:10:10 -07:00
Pieter De Baets 6221053179 Improve systrace markers
Reviewed By: mhorowitz

Differential Revision: D4860135

fbshipit-source-id: ce963010883e6b9cc8e34f7ff01b4018cd195eba
2017-05-12 18:07:49 -07:00
Alex Dvornikov db0c22192c Added support for synchronous methods in native modules on iOS
Reviewed By: javache

Differential Revision: D4947556

fbshipit-source-id: 0ef73dc5d741201e59fef1fc048809afc65c75b5
2017-04-27 12:03:30 -07:00
Pieter De Baets 34bc6bd2ae Drop support for webworkers
Reviewed By: AaaChiuuu

Differential Revision: D4916449

fbshipit-source-id: a447233d3b7cfee98db2ce00f1c0505d513e2429
2017-04-25 05:37:54 -07:00
Pieter De Baets 9d1c62669b Add extra guards to DispatchMessageQueueThread
Reviewed By: bnham

Differential Revision: D4868432

fbshipit-source-id: 23d6c996aa97db82ea5e0e166e1988f4ce378b6f
2017-04-11 12:25:39 -07:00
Pieter De Baets 2336ac299c Improve constant extraction from RCTNativeModule
Reviewed By: dcaspi

Differential Revision: D4829671

fbshipit-source-id: 6b1cef1d31c7d8981c6f1e304d3742e885f8a83b
2017-04-08 15:18:08 -07:00
Pieter De Baets f3dfd616f4 Allow lazy Cxx modules to not initialize
Reviewed By: mhorowitz

Differential Revision: D4851596

fbshipit-source-id: cf5f5c51b9aaa0da96f7ab6fba1277b72c988400
2017-04-08 15:18:08 -07:00
Pieter De Baets ceac54ebe9 Use forward declaration in RCTCxxModule
Reviewed By: mhorowitz

Differential Revision: D4821449

fbshipit-source-id: 8e75a7b17e0986bc9416a0afde0d7dfa179d4fed
2017-04-07 09:30:33 -07:00
Pieter De Baets b2647ea335 Allow ModuleRegistry initialization to complete lazily
Reviewed By: mhorowitz

Differential Revision: D4794794

fbshipit-source-id: f3b7a5d02587b4cd4e214aa6b0368a0d214fb63f
2017-04-07 09:30:33 -07:00
Pieter De Baets ce270220e4 Extract module registry creation to helper
Reviewed By: mhorowitz

Differential Revision: D4721817

fbshipit-source-id: 2fa17ca5317a57d429aa75d6c1865932af27e02f
2017-03-17 07:08:14 -07:00
Pieter De Baets ea069b69de Make Cxx modules lazy on iOS
Reviewed By: mhorowitz

Differential Revision: D4716040

fbshipit-source-id: 08cc1317e15f0b3bd1df6d76c483a560f5c43d53
2017-03-17 07:08:14 -07:00
Ashok Menon d5dda1b136 Adding in missing wrapper invocation.
Reviewed By: javache

Differential Revision: D4714260

fbshipit-source-id: 641dfd07e8161bedf31cfd4cf94b1dc64beec0f9
2017-03-15 18:30:20 -07:00
Pieter De Baets 11e59e3ff4 Move some utilities to RCTCxxUtils
Reviewed By: mhorowitz

Differential Revision: D4551173

fbshipit-source-id: db01d3205ec1feb54c815c0f0fc688fc7a4823d0
2017-02-16 14:02:03 -08:00
Pieter De Baets 5d4ff693b4 Move RCTFollyConvert to the correct namespace
Reviewed By: mhorowitz

Differential Revision: D4551124

fbshipit-source-id: 40a0a8ca818710a7529798b8244d9c133eb5c22d
2017-02-16 06:59:27 -08:00
Pieter De Baets 8987d86718 Fix error handling for nested exceptions
Reviewed By: mhorowitz

Differential Revision: D4551110

fbshipit-source-id: e593c1ef0dea27e95a387bcde6250aeb22d2e9cc
2017-02-15 06:15:11 -08:00
Marc Horowitz b774820dc2 move C++ bridge into oss directory
Reviewed By: javache

Differential Revision: D4434052

fbshipit-source-id: ff2743eb7fe5d9cabb860752ca3d92d631a2f02b
2017-02-01 14:14:32 -08:00