Commit Graph

56 Commits

Author SHA1 Message Date
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
Tim Yung e3c6f38773 RNTester: Relax Bridge Release Check
Reviewed By: mmmulani

Differential Revision: D6665596

fbshipit-source-id: 2c59ea8add039d2bfc6b76701d16e82088fa8aad
2018-01-05 15:05:31 -08:00
Spencer Ahrens 3bcb912786 Report all errors from running tests
Reviewed By: jingc

Differential Revision: D6526057

fbshipit-source-id: 00ebbb42aab17295350a24b92773c04593452608
2017-12-08 16:46:55 -08:00
Chris Zheng 266ab7a006 Pass scriptURL to RCTTestRunner
Summary:
Pass scriptURL to RCTTestRunner.
If the scriptURL passed to RCTTestRunner is not nil, then RCTTestRunner will use it.
else, RCTTestRunner will use whatever it has before.

Differential Revision: D6215186

fbshipit-source-id: c3a5643021d60579fc8e60a69de150f6a4a39237
2017-11-12 13:36:22 -08:00
Spencer Ahrens af2e3fea1b Improve DX for FBReactKitIntegrationTests
Summary:
- Enable logging so `console.log` shows up in Xcode console (and CI?)
- Allow loading from bundler for rapid JS iteration.
- Add option to enable JS debugging, although it's a little ghetto.

Reviewed By: mmmulani

Differential Revision: D5869085

fbshipit-source-id: 9c4831859f1491f7f75786f730d8549d69623888
2017-09-21 18:30:38 -07:00
Pieter De Baets dacb1fbc11 Increase RCTTestRunner timeouts
Reviewed By: shergin

Differential Revision: D5706622

fbshipit-source-id: 2185e673913d366afca234d121eaf601ff7c5887
2017-08-25 10:00:39 -07:00
Pieter De Baets b1bb0a71d5 Wait for bridge to disappear when running tests
Reviewed By: fkgozali

Differential Revision: D5592347

fbshipit-source-id: c9a672f2d79c8656b72f585aac7c6f5fec6e72b0
2017-08-09 09:50:44 -07:00
Alex Kring 407b8b4d1f Fixing compiler warning
Summary:
Compiler is giving a warning about an unused variable.

Tested by compiling the source code and verifying the warning is removed.
Closes https://github.com/facebook/react-native/pull/13819

Differential Revision: D5189680

Pulled By: shergin

fbshipit-source-id: 89848fcd3e988d1c256b315cfa2ef60a62c2ad56
2017-06-05 23:30:34 -07:00
Marc Horowitz 325228d6cf Remove RCTBatchedBridge rule and all uses from the tree
Reviewed By: AaaChiuuu, javache

Differential Revision: D4889438

fbshipit-source-id: ba103ace8802f0976e09af6b491442e9aa723f49
2017-04-19 17:00:43 -07:00
Pieter De Baets 8dcef96fd8 Log to console in RCTTestRunner
Reviewed By: fkgozali

Differential Revision: D4875352

fbshipit-source-id: 68f9caf4f350d34b2fd180ff19353c698bfce452
2017-04-13 04:49:51 -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
Shruti Malugu edbb48c67a Replacing all instances of [UIApplication sharedApplication] wi…
Summary:
…th RCTSharedApplication()

Thanks for submitting a PR! Please read these instructions carefully:

- [ ] Explain the **motivation** for making this change.
          Using React Native latest version with Cocoapods 1.2.0 causes the following error inside iOS app extensions

> /react-native/React/Modules/RCTAccessibilityManager.m:67:70: ‘sharedApplication’ is unavailable: not available on iOS (App Extension) — Use view controller based solutions where appropriate instead.

Moving the use of [UIApplication sharedApplication] to RCTSharedApplication() which is safe on app extension

- [ ] Provide a **test plan** demonstrating that the code is solid.
        I am not sure how to test such that all the features which touch the modified code are tested.

- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.

What existing problem does the pull request solve?
    Using React Native latest v
Closes https://github.com/facebook/react-native/pull/13227

Differential Revision: D4816338

Pulled By: javache

fbshipit-source-id: e3e3c77882990ad1817b0b633521cff52571ecd0
2017-04-01 03:34:41 -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
Pieter De Baets c92ad5f6ae Apple TV support 4: support for input (tvOS focus engine)
Reviewed By: shergin

Differential Revision: D4333546

fbshipit-source-id: 8655070e81dbb62a80ab1f00a43ef6c2d9654618
2016-12-19 06:28:40 -08:00
Pieter De Baets 439092742a Fix imports in UIExplorerUnitTests
Reviewed By: bestander

Differential Revision: D4231271

fbshipit-source-id: 84f903f6b14256ed1958ad1800f128133590a3dc
2016-11-24 09:58:31 -08:00
Pieter De Baets e1577df1fd Move all header imports to "<React/..>"
Summary:
To make React Native play nicely with our internal build infrastructure we need to properly namespace all of our header includes.

Where previously you could do `#import "RCTBridge.h"`, you must now write this as `#import <React/RCTBridge.h>`. If your xcode project still has a custom header include path, both variants will likely continue to work, but for new projects, we're defaulting the header include path to `$(BUILT_PRODUCTS_DIR)/usr/local/include`, where the React and CSSLayout targets will copy a subset of headers too. To make Xcode copy headers phase work properly, you may need to add React as an explicit dependency to your app's scheme and disable "parallelize build".

Reviewed By: mmmulani

Differential Revision: D4213120

fbshipit-source-id: 84a32a4b250c27699e6795f43584f13d594a9a82
2016-11-23 07:58:39 -08:00
dlowder-salesforce 64a4c6070d Travis CI reliability fixes: preload package manager and increase tim…
Summary:
- Consolidate common code in iOS and tvOS test scripts
- Start the packager before starting tests, to improve reliability
- Increase timeout value in RCTTestRunner.m
Closes https://github.com/facebook/react-native/pull/10378

Differential Revision: D4028364

Pulled By: bestander

fbshipit-source-id: 24c2124a1c62643a02f0668b60a67b971e08d1a3
2016-10-16 15:43:44 -07:00
Pieter De Baets a0b3565847 Fix snapshottests under iOS10
Reviewed By: dinhviethoa

Differential Revision: D3722988

fbshipit-source-id: 4345b757e28700ac61e1de38b61430e78948e58a
2016-08-17 10:44:01 -07:00
Pieter De Baets 7fa677f7c3 Add MessageQueue method for executing function and returning its result
Reviewed By: majak

Differential Revision: D3175793

fbshipit-source-id: e1e66e3dcde8b1fb35973340e12d947a0e955775
2016-07-18 07:13:32 -07:00
Nathan Azaria 913b4ccee4 Changed RUNNING_ON_CI to CI_USE_PACKAGER environment variable.
Reviewed By: javache

Differential Revision: D3327726

fbshipit-source-id: 6293b71a2ca7783b089f16fe2089c8893e93a621
2016-05-23 04:44:11 -07:00
Pieter De Baets 8772a6a542 Wait for JSExecutor to tear down in RCTBridgeTests
Reviewed By: tadeuzagallo

Differential Revision: D2803092

fb-gh-sync-id: 71ccac2c13221bfbcb2f09a14d48ac2d2901d04e
2016-01-05 15:30:33 -08:00
Justin Spahr-Summers a5d82c2823 Add context executor API for sync hooks
Summary:
public

This exposes a proper API for adding synchronous callbacks to JS, as an optional feature of the executor.

This is based on nicklockwood's work in D2764492, but avoids refactoring bridge/executor interactions for the time being, since we agree on this API and can move the actual callsites around later.

Reviewed By: nicklockwood

Differential Revision: D2799506

fb-gh-sync-id: af209d9a0be927f3404205feb16e59745cc37aec
2016-01-05 08:00:38 -08:00
Tadeu Zagallo 809627379b Rename RCTContextExecutor to RCTJSCExecutor
Summary:
public

Rename the executor to so it actually says something about the implementation.

Reviewed By: jspahrsummers, nicklockwood

Differential Revision: D2759688

fb-gh-sync-id: 5b1ac447e75109fbbc2ee71c804710d9926785aa
2015-12-16 02:51:28 -08:00
Nick Lockwood 060664fd3d Refactored module access to allow for lazy loading
Summary: public

The `bridge.modules` dictionary provides access to all native modules, but this API requires that every module is initialized in advance so that any module can be accessed.

This diff introduces a better API that will allow modules to be initialized lazily as they are needed, and deprecates `bridge.modules` (modules that use it will still work, but should be rewritten to use `bridge.moduleClasses` or `-[bridge moduleForName/Class:` instead.

The rules are now as follows:

* Any module that overrides `init` or `setBridge:` will be initialized on the main thread when the bridge is created
* Any module that implements `constantsToExport:` will be initialized later when the config is exported (the module itself will be initialized on a background queue, but  `constantsToExport:` will still be called on the main thread.
* All other modules will be initialized lazily when a method is first called on them.

These rules may seem slightly arcane, but they have the advantage of not violating any assumptions that may have been made by existing code - any module written under the original assumption that it would be initialized synchronously on the main thread when the bridge is created should still function exactly the same, but modules that avoid overriding `init` or `setBridge:` will now be loaded lazily.

I've rewritten most of the standard modules to take advantage of this new lazy loading, with the following results:

Out of the 65 modules included in UIExplorer:

* 16 are initialized on the main thread when the bridge is created
* A further 8 are initialized when the config is exported to JS
* The remaining 41 will be initialized lazily on-demand

Reviewed By: jspahrsummers

Differential Revision: D2677695

fb-gh-sync-id: 507ae7e9fd6b563e89292c7371767c978e928f33
2015-11-25 04:49:45 -08:00
Nick Lockwood fa0b45c58b Replaced RCTSparseArray with NSDictionary
Reviewed By: jspahrsummers

Differential Revision: D2651920

fb-gh-sync-id: 953e2ea33abfc7a3a553da95b13e9ab2bccc5a1c
2015-11-14 10:28:28 -08:00
Pawel Sienkowski 3a42661b47 Custom logic blocks for RCTTestRunner's runTest: method
Reviewed By: majak

Differential Revision: D2626497

fb-gh-sync-id: c78e3b47be4ee192e899594bd05b13521af7172e
2015-11-13 08:38:31 -08:00
Pieter De Baets 215872c2eb Provide log source to handler
Reviewed By: majak

Differential Revision: D2615567

fb-gh-sync-id: a245813220436f2d83ae2ae28bde916cecb3f416
2015-11-11 06:44:30 -08:00
Nick Lockwood c5b990f65f Added lightweight generic annotations
Summary: public

Added lightweight genarics annotations to make the code more readable and help the compiler catch bugs.

Fixed some type bugs and improved bridge validation in a few places.

Reviewed By: javache

Differential Revision: D2600189

fb-gh-sync-id: f81e22f2cdc107bf8d0b15deec6d5b83aacc5b56
2015-11-03 14:49:30 -08:00
Pieter De Baets 15c53f7563 Fix ReferenceImages resolving for `buck test`
Reviewed By: nicklockwood

Differential Revision: D2605694

fb-gh-sync-id: 90e65974c73405d482476c9eb2ddf1377f9a1401
2015-11-02 11:02:29 -08:00
Pieter De Baets f3a6466fcd Check if test runner is of right type before accessing its internals
Summary: I previously added this check to make the test complete waits until all teardown completed but if you're running tests with any other executor than the JSC one, this would crash.

@​public

Reviewed By: @jspahrsummers

Differential Revision: D2493967
2015-10-01 04:22:24 -07:00
Pieter De Baets 9b1f6c9e30 Make RCTTestRunner wait for JS context to deallocate 2015-09-04 03:24:16 -08:00
Felix Oghina 53fc5624e4 [reactnative] send platform arg with all packager requests 2015-08-29 06:36:18 -08:00
Nick Lockwood 88e0bbc469 Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
Nick Lockwood 26c4be62c8 Fixed test flakiness due to a race condition with RCTRedBox
Summary:
The test runner relied on checking the current error message in the RCTRedbox, which is a singleton (yay, shared mutable state!). This lead to some tests that worked individually but failed when run together due to error messages in RCTRedBox left over from previous tests.

I've replaced the call to -[RCTRedBox currentErrorMessage] by injecting a custom logging function to intercept the errors at source, which is a much more reliable solution.
2015-08-19 03:41:31 -07:00
Nick Lockwood 8d1e02b8bd Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
Pieter De Baets 261f9434e5 Avoid dispatch_async in RCTRootView when bridge has already started
Summary:
There's no good reason for initialProperties to be mutable after the RCTRootView has been created. Passing it in through the constructor means we can skip one dispatch_async.
2015-08-17 05:34:25 -07:00
Nick Lockwood 1b7699f671 Migrate unit tests from FBReactKitModules to FBReactKit 2015-07-07 16:39:35 -08:00
Alex Kotliarskyi 64d7933e66 [ReactNative] Ignore _UILayoutGuide in tests 2015-06-25 08:09:13 -08:00
Nick Lockwood 6573d256ba Improve test architecture so failures don't crash the simulator 2015-06-17 07:09:23 -08:00
Nick Lockwood 650fc9de4c Increased warning levels to -Wall -Wextra, and fixed Xcode 7 beta issues
Summary:
@public

I've increased the warning levels in the OSS frameworks, which caught a bunch of minor issues. I also fixed some new errors in Xcode 7 relating to designated initializers and TLS security.

Test Plan:
* Test the sample apps and make sure they still work.
* Run tests.
2015-06-15 07:52:50 -08:00
Tadeu Zagallo 1a564eed77 [ReactNative] Run UIExplorer tests on sandcastle 2015-06-05 05:36:06 -08:00
Andy Street 435125f4a0 Revert "[ReactNative] Run UIExplorer tests on sandcastle" 2015-06-03 10:57:19 -08:00
Tadeu Zagallo e1454c29c5 [ReactNative] Run UIExplorer tests on sandcastle 2015-06-03 06:24:12 -08:00
Alex Kotliarskyi 735f67337a [ReactNative] Fail faster in OSS tests 2015-05-06 09:33:20 -07:00
Tadeu Zagallo 132a9170f1 [ReactNative] Create private underlying bridge to prevent retain cycles 2015-05-04 10:36:20 -08:00
Nick Lockwood eb0476074f Improved debug and fixed macros 2015-04-30 09:59:16 -08:00
Nick Lockwood b1a15004de Fixed release builds on UIExplorer 2015-04-21 18:22:34 -08:00
Nick Lockwood ead0f2e020 Implemented thread control for exported methods 2015-04-18 11:13:39 -08:00
guru inamdar 7a68691686 MapView to support MKPointAnnotation using new attribute annotate in Map...
Summary:
### MapView to support Pin annotation

    var pinLocation = {
			latitude: property.latitude,
			longitude: property.longitude,
			title: property.title
    };
    this.state = {propertyPoint: pinLocation};
    <MapView style={styles.map} region={this.state.region} annotate={this.state.propertyPoint}>
    </MapView>
![mapview-pinannotation](https://cloud.githubusercontent.com/assets/845379/7100280/6c1ffc08-dfe5-11e4-9d1b-8da6a65da1bc.png)

Closes https://github.com/facebook/react-native/pull/810
Github Author: guru inamdar <guru.inamdar@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-14 18:03:37 -08:00
Nick Lockwood 26fd24dc50 Cleanup 2015-04-11 14:19:49 -08:00