Commit Graph

170 Commits

Author SHA1 Message Date
Héctor Ramos 1151c096da Update copyright headers to yearless format
Summary: This change drops the year from the copyright headers and the LICENSE file.

Reviewed By: yungsters

Differential Revision: D9727774

fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
2018-09-11 15:33:07 -07:00
Kevin Gozali 6a1f48e06d TM iOS: rollout strategy 1 - added RCTEnableJSINativeModule(BOOL)
Summary:
To be able to test out new approach for NativeModules, introduce a simple runtime flag to enable the new system (doesn't exist yet). In addition, each module should declare a static `+ (BOOL)allowJSIBinding` in the objc class to be considered for the new approach. Doing so skips the processing of the module during bridge startup.

Note: this doesn't do anything special for `- (NSArray *)extraModulesForBridge:(RCTBridge *)bridge` impl yet.

Differential Revision: D9554296

fbshipit-source-id: 3508db6589e9f72367f62aa7ca15fce3d3adda72
2018-08-29 15:48:59 -07:00
Mehdi Mulani 3d8b83927b Use module copies in RCTBridge APIs
Summary: This array can be modified while it's being iterated, so we need to take a copy. I also found another crash and guarded against it.

Reviewed By: fkgozali

Differential Revision: D8955708

fbshipit-source-id: 76250bc5d451776e74505733c0f3c14e555fb576
2018-07-23 14:47:45 -07:00
Douglas 569061dd83 Suppress spurious warning about RCTCxxModule (#19880)
Summary:
<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

On a relatively stock / default setup of RN on iOS you'll see the warning "Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?" pop up on every launch. This change resolves that issue.

Fixes #14806 .

This supersedes PR #19794 .

Try a fresh project by following the RN iOS tutorial, and observe that there are no more warnings after making this change.

[IOS] [MINOR] [CxxBridge] - Fix "Class RCTCxxModule was not exported"
Closes https://github.com/facebook/react-native/pull/19880

Differential Revision: D8653809

Pulled By: hramos

fbshipit-source-id: c48529c2d74ddd40a90bc0e06e405078e25b72e3
2018-06-26 17:47:28 -07:00
Dmitry Zakharov 2f53573d4f Fix Modules concurrent access
Reviewed By: fkgozali

Differential Revision: D8379392

fbshipit-source-id: 72495950ea5fcf37f5b1cc3413666879dfc81e5c
2018-06-18 07:47:26 -07:00
David Aurelio edd22bf49d Log bridge description for e2e reloads
Reviewed By: mhorowitz

Differential Revision: D7577953

fbshipit-source-id: 96871c664cb7ec84570bc76f2edb36ff8c8c6aeb
2018-04-10 19:29:58 -07:00
David Aurelio 48c339ddc7 Add `RCTJavaScriptWillStartExecutingNotification`
Summary:
`RCTJavaScriptWillStartLoadingNotification` is being posted when starting the bridge, not when starting to execute JS code.

Here, we add `RCTJavaScriptWillStartExecutingNotification`, and in post it before executing JS with `RCTCxxBridge`.

Reviewed By: fromcelticpark

Differential Revision: D7153659

fbshipit-source-id: 902075308d54a47bef43b6f57edf2e624f621ceb
2018-03-06 11:05:25 -08:00
Dan Zimmerman 19a4a7d3cb Remove callFunctionSync experimental APIs
Reviewed By: michalgr

Differential Revision: D6124038

fbshipit-source-id: 219afe30783da92cf10f800dc35e64823b61cf4b
2018-03-05 14:32:00 -08:00
Sophie Alpert 1490ab12ef Update license headers for MIT license
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
2018-02-16 18:31:53 -08:00
Kevin Gozali 5f48bd84aa iOS: allow getting an instance of a js-bound module via the bridge
Reviewed By: sebmarkbage

Differential Revision: D6982785

fbshipit-source-id: 7bbcc5416e1d1a3a577328349a7c18af5c0f8577
2018-02-13 22:38:55 -08:00
Marc Horowitz 816d417189 Delete RCTBatchedBridge
Summary:
I've talked to several major community users, and they're all ok with deleting this
code.  There's several doc fixes which will make it easier for third
party developers which should land about the same time this will.

Also buried along with it is RCTJSCExecutor.

Reviewed By: javache

Differential Revision: D6880781

fbshipit-source-id: b4cb1143def6fd23a96290e478fa728adbedacd3
2018-02-05 12:02:35 -08:00
Yujie Liu 0b1e6444bb remove embeddedBundleURL
Reviewed By: fromcelticpark

Differential Revision: D6501542

fbshipit-source-id: c6f1adddc4e671f73195afde927face28ee79342
2017-12-12 13:11:14 -08:00
Adam Ernst 9180d4eb82 Make RCTPackagerConnection a singleton
Reviewed By: fromcelticpark

Differential Revision: D6361741

fbshipit-source-id: 96e92dff5dd3d7aa1f7555442b0eba90e7dbf47c
2017-11-20 18:36:27 -08:00
Alex Dvornikov 681278947e Adopt new split segments registration approach on iOS
Differential Revision: D6284479

fbshipit-source-id: d0d7e8c6a6ce4ecab63739149be69f25df7fbe6f
2017-11-09 12:23:49 -08:00
Yujie Liu ae5ef653cb Rename bundleSource to embeddedBundle
Reviewed By: fromcelticpark

Differential Revision: D6274101

fbshipit-source-id: f62da158d165cb3ce4a510ebc4eed24a8a719381
2017-11-09 09:33:00 -08:00
Yujie Liu b983de9c54 Share bundled source URL to RN
Differential Revision: D6192988

fbshipit-source-id: efa584ee2340a34156956990d6cd96d37ba4ab60
2017-11-07 16:46:53 -08:00
Dan Zimmerman 55f75dfd65 Remove the experimental concept of whitelisted modules
Reviewed By: dcaspi

Differential Revision: D6124036

fbshipit-source-id: af3771ce2204b3695f79265d5aade7e321e12a3e
2017-10-25 08:20:48 -07:00
Ben Nham 259161f872 add files changed count to reload metrics
Reviewed By: alexeylang

Differential Revision: D5694813

fbshipit-source-id: 2e2517e60a7547e261a7c15a3a9138dbb3cb9783
2017-08-31 05:34:48 -07:00
Paco Estevez Garcia edf60ce640 Fix ENABLE_INSPECTOR ifdef not found during dev
Reviewed By: bnham

Differential Revision: D5680963

fbshipit-source-id: d38c4575387ba58e3819f5aa5c35078ed8ed3e87
2017-08-24 10:46:50 -07:00
Ben Nham 1ce7e4c1e5 add notifications for dev reload
Reviewed By: alexeylang

Differential Revision: D5630472

fbshipit-source-id: 1c44a52fddead361b43551384bbfc73e2d89438f
2017-08-17 17:16:19 -07:00
Paco Estevez Garcia 14e67a379b Fix dev support calls made without an ifdef guard
Reviewed By: danzimm

Differential Revision: D5650480

fbshipit-source-id: d21e76f2bf5bb239a7f21d9d507f054b276568e8
2017-08-17 12:32:06 -07:00
Paco Estevez Garcia 41504103ce Force the debugger to disconnect before a bundle reload
Reviewed By: bnham

Differential Revision: D5594238

fbshipit-source-id: feff9f179534c8e617f8fa7c8a7b1bc525c07cae
2017-08-14 08:16:52 -07:00
Dmitry Zakharov cf38b083dd Implement lazy discovery scaffolding for loading NativeModules on demand.
Reviewed By: javache

Differential Revision: D5364734

fbshipit-source-id: 5162f7d41434a3ba38c82fa610e84f865bfacf50
2017-08-11 06:41:33 -07:00
Alex Dvornikov c143313a20 Make RCTSamplingProfilerPackagerMethod not depend on RCTBridge
Reviewed By: javache

Differential Revision: D5245899

fbshipit-source-id: a99de4cbf0ddd9c8ee98cbbf438f8930a57e917c
2017-06-15 12:07:34 -07:00
Marc Horowitz dd45e7e1c4 Switch default bridge to CxxBridge
Reviewed By: javache

Differential Revision: D4981911

fbshipit-source-id: 49900a0e86d13045aa8930a865b073e1dec35e93
2017-05-03 14:52:56 -07:00
Pieter De Baets 5767b98f4d Add JSC utility header to RCTBridge
Reviewed By: shergin

Differential Revision: D4823509

fbshipit-source-id: 79c96d3bc183d89a5dec7da06b0a0a710d8c7dea
2017-04-07 11:16:59 -07:00
Pieter De Baets 76b93e1253 Add block-based initializer for RCTModuleData
Reviewed By: shergin

Differential Revision: D4821772

fbshipit-source-id: 2cd35ec6726b6fe1494a92966ade5aa0b86e769b
2017-04-07 11:16:59 -07:00
Pieter De Baets e12e57eb77 Move bindKeys to RCTBridge setUp
Reviewed By: shergin

Differential Revision: D4794788

fbshipit-source-id: 0839829f4ed010bf2fb2574092a8f68f4c95341a
2017-03-31 05:31:26 -07:00
Pieter De Baets 5af30382d5 Improve fbsystrace support
Reviewed By: mhorowitz

Differential Revision: D4756318

fbshipit-source-id: 7811f680a7ad044b5ae028ee9b2fed5f46ce2a63
2017-03-30 06:53:16 -07:00
Marc Horowitz ba149d7277 Tease apart React and RCTBatchedBridge targets
Reviewed By: javache

Differential Revision: D4679655

fbshipit-source-id: 8123488c2d50dd7cc2329b5131e99998fe1f1e2f
2017-03-21 18:31:23 -07:00
Marc Horowitz d9ac00735c Make the choice of bridge based on an optional delegate method
Reviewed By: javache

Differential Revision: D4679644

fbshipit-source-id: f53e554e283fdb0b59c41623e690fd1a21e03a57
2017-03-21 18:31:23 -07:00
Alexey Lang ba029becbe Support QuickPerformanceLogger.js in CxxBridge
Reviewed By: javache

Differential Revision: D4573567

fbshipit-source-id: 3ef9da38fb178cf4c1400b4a991a9e85f3ec3755
2017-02-17 06:00:54 -08:00
Adam Ernst 617eb309a1 Refactor reload command in React Native
Summary: Introduces an API to register a weakly-held listener for the reload (Cmd+R) command. This allows external infrastructure to hook into the reload command before the `RCTBridge` object is even created.

Reviewed By: javache

Differential Revision: D4286980

fbshipit-source-id: 51012fb8cbeb433dc880d9d98d847b07fdbb4c4f
2016-12-07 20:13:22 -08:00
Pieter De Baets 286a1b2e5e Remove deprecated RCTReloadNotification
Reviewed By: adamjernst

Differential Revision: D4294180

fbshipit-source-id: 6837597df2a798661c993c6f63ec430989954de6
2016-12-07 16:28:33 -08:00
Marc Horowitz af5c8a8fd2 Add support for new ios bridge to FBReactBridgeJSExecutor
Reviewed By: javache

Differential Revision: D3897535

fbshipit-source-id: 35bdaf885b03c0c95017a68b69f1f506e6943f2b
2016-09-28 14:13:55 -07:00
Marc Horowitz 51df83d7d5 Move batchedbridge start out of init
Reviewed By: javache

Differential Revision: D3913304

fbshipit-source-id: 7d9b5b352d95dd770757cc99dddcce510cdd4909
2016-09-26 16:14:11 -07:00
Pieter De Baets 31b158c9fe Export native modules without RCT or RK prefix
Reviewed By: mmmulani

Differential Revision: D3901600

fbshipit-source-id: 7d4a027f0f2478e2a9ac9916326b91279bec3cb3
2016-09-23 11:14:11 -07:00
Pieter De Baets bd4cd6ea5d Fix non-exported module warnings for superclasses
Reviewed By: mhorowitz

Differential Revision: D3841655

fbshipit-source-id: b855f9bef6c53a0964c59e1977e5eb23452edce3
2016-09-19 04:44:12 -07:00
Alexey Lang 532751f8a8 Start measuring RCTPLBridgeStartup and RCTPLTTI early
Reviewed By: javache

Differential Revision: D3828404

fbshipit-source-id: 7cbfa2eeb60e249be8aad09da5314be998213f0e
2016-09-08 07:28:41 -07:00
Ben Roth afde9da93d Scope RCTReloadNotification to one bridge
Summary:
At the moment, posting RCTReloadNotification in any circumstance causes all RCTBridge instances to reload. This change scopes the notification to the bridge for which it was intended.
Closes https://github.com/facebook/react-native/pull/8762

Differential Revision: D3831914

fbshipit-source-id: ff29574f574ecd1a403057ddd0458dea38f0136e
2016-09-07 17:28:47 -07:00
Pieter De Baets 1a7c231ef3 Remove last arg from RCTProfileEnd, make macro's function-like
Reviewed By: tadeuzagallo

Differential Revision: D3801302

fbshipit-source-id: 297a58db876366e21e232094c1361aa0dcd9016d
2016-09-05 11:13:33 -07:00
Pieter De Baets 0222107170 Customize main thread initialization of native modules (2nd try)
Reviewed By: majak

Differential Revision: D3671197

fbshipit-source-id: e8df7669be79303d335f2c881e97310b5fed47f9
2016-08-05 11:28:32 -07:00
Pieter De Baets b83ccb5749 Reverted commit D3580025
Reviewed By: mhorowitz

Differential Revision: D3580025

fbshipit-source-id: 4422b6b97ef844158e369e022d62d6f0ae641222
2016-08-02 14:13:27 -07:00
Pieter De Baets 47d6d289d4 Customize main thread initialization of native modules
Reviewed By: mhorowitz

Differential Revision: D3580025

fbshipit-source-id: 18abc15b894c745f584d91da47035c6db036aafa
2016-08-02 10:27:25 -07:00
Pieter De Baets 82c8129627 Fix double React perflogger creation
Reviewed By: mmmulani

Differential Revision: D3599003

fbshipit-source-id: 25090309c92127b403d1df6a8b7c18ad5a088b5e
2016-07-22 09:58:29 -07:00
Pieter De Baets 23e28eca11 Add completion callback to enqueueJSCall
Reviewed By: majak

Differential Revision: D3423580

fbshipit-source-id: c063c9c5d8961d5c9cb14c32d70767c67d78430a
2016-07-18 07:13:32 -07:00
Pieter De Baets 7b7ecdf337 Cleanup warnings
Reviewed By: majak

Differential Revision: D3542606

fbshipit-source-id: 41246a012a32fafc4ddbb307c7b9919e3c203393
2016-07-12 05:59:12 -07:00
Alexey Lang 97299260b6 Refactor RCTPerformanceLogger to avoid having global state
Reviewed By: javache

Differential Revision: D3509004

fbshipit-source-id: c4ab12b3f1defa32c2b1c211e775f6782ede4b7f
2016-07-07 07:29:57 -07:00
Siqi Liu 1e88c1261c Disable the double R shortcut to reload JS in iOS
Summary: Disable double R shortcut temporarily to fix a bug.

Reviewed By: majak

Differential Revision: D3428043

fbshipit-source-id: 23795b72433230e49d5ab559c0cb828bce8196ea
2016-06-14 05:30:30 -07:00
Nick Lockwood 72b363d7fc Replaced isMainThread checks with a proper test for main queue
Summary:
As per https://twitter.com/olebegemann/status/738656134731599872, our use of "main thread" to mean "main queue" seems to be unsafe.

This diff replaces the `NSThread.isMainQueue` checks with dispatch_get_specific(), which is the recommended approach.

I've also replaced all use of "MainThread" terminology with "MainQueue", and taken the opportunity to deprecate the "sync" param of `RCTExecuteOnMainThread()`, which, while we do still use it in a few places, is incredibly unsafe and shouldn't be encouraged.

Reviewed By: javache

Differential Revision: D3384910

fbshipit-source-id: ea7c216013372267b82eb25a38db5eb4cd46a089
2016-06-06 07:58:36 -07:00