Граф коммитов

59 Коммитов

Автор SHA1 Сообщение Дата
Héctor Ramos 9fb2ca0b53 Bump Xcode to 11.2.1 (#27434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/27434
Pull Request resolved: https://github.com/facebook/react-native/pull/27295

- Use Xcode version 11.2.1 in both internal and external tests.
- Update snapshot reference images to use iPhone 8 test device.

Xcode 11.3.0 will be available in Sandcastle in the next week or so.

Changelog:

[Internal] - Bump Xcode version used in tests to 11.2.1.
[Internal] - Update iOS Snapshots.

Reviewed By: cs01

Differential Revision: D18849584

fbshipit-source-id: 9e3b92f080a4dc6a15dac0535b7562ff6a5c08a9
2020-01-14 13:30:05 -08:00
Héctor Ramos 7e6fae2a20 Fix test-ios by bumping Xcode version (#27356)
Summary:
iOS tests have been failing due to iOS 12.4 not being supported by Xcode 10.2.1. Bumping to 10.3 solves it.

Ideally, we'd bump to Xcode 11.2.1 and iOS 13.2.2. We can do this once all of our internal CI machines have Xcode 11.2.1 available.

## Changelog

[iOS] [Fixed] - Fix CI iOS tests by bumping Xcode version used in Circle CI
Pull Request resolved: https://github.com/facebook/react-native/pull/27356

Test Plan: Circle

Differential Revision: D18765501

Pulled By: hramos

fbshipit-source-id: 1a1ca78c5d8f8596476b0e56740ea1bdf7422161
2019-12-02 10:49:37 -08:00
Mike Grabowski 2c7a907b08 Update integration snapshots (#27059)
Summary:
This commit a397d330a4 changes colors in the RNTester slightly and makes snapshots to fail.

I have re-generated them and made sure it was just the background color (and few other minor gray shades) that were different.

I haven't spotted any other visual changes.
Pull Request resolved: https://github.com/facebook/react-native/pull/27059

Differential Revision: D18223898

Pulled By: cpojer

fbshipit-source-id: ccc269bba0023233bc27254bd1a6bc0fb09a390a
2019-10-30 11:04:53 -07:00
Andres Suarez 3b31e69e28 Tidy up license headers [2/n]
Summary: Changelog: [General] [Fixed] - License header cleanup

Reviewed By: yungsters

Differential Revision: D17952694

fbshipit-source-id: 17c87de7ebb271fa2ac8d00af72a4d1addef8bd0
2019-10-16 10:06:34 -07:00
Christoph Nakazawa 9a0ebe0aba Move ART JS files to FB internal
Summary: This is part of Lean Core.

Reviewed By: rubennorte

Differential Revision: D17343246

fbshipit-source-id: 1185e6c1f75e8272048ce1a24c2f195728d436c4
2019-09-13 07:47:57 -07:00
Brian Vaughn 92a3c9da0a React DevTools v4 integration
Summary:
This Diff is being posted for discussion purposes. It will not be ready to land until React DevTools v4 has been published to NPM.

Update React Native to be compatible with the [new version 4 React DevTools extension](https://github.com/bvaughn/react-devtools-experimental).

**Note that this is a breaking change**, as the version 3 and version 4 backends are **not compatible**. Once this update ships (in React Native) users will be required to update their version of the [`react-devtools` NPM package](https://www.npmjs.com/package/react-devtools). The same will be true for IDEs like Nuclide as well as other developer tools like Flipper and [React Native Debugger](https://github.com/jhen0409/react-native-debugger).

Related changes also included in this diff are:
* Pass an explicit whitelist of style props for the React Native style editor (to improve developer experience when adding new styles).
* Update `YellowBox` console patching to coordinate with DevTools own console patching.
  * Also improved formatting slightly by not calling `stringifySafe` for strings (since this adds visible quotation marks).

Regarding the console patching- component stacks will be appended by default when there's no DevTools frontend open. The frontend will provide an option to turn this behavior off though:

{F168852162}

React DevTools will detect if the new version is used with an older version of React Native, and offer inline upgrade instructions:

{F169306863}

**Note that the change to the `RCTEnableTurboModule` will not be included in this Diff**. I've just turned those off temporarily so I can use v8+Chrome for debugging.

Reviewed By: rickhanlonii

Differential Revision: D15973709

fbshipit-source-id: bb9d83fc829af4693e7a10a622acc95a411a48e4
2019-08-26 23:56:59 -07:00
Moti Zilberman 2dadb9e2b0 Move React error message formatting into ExceptionsManager
Summary:
# Context

In https://github.com/facebook/react/pull/16141 we imported `ReactFiberErrorDialog` unchanged from React. That implementation was not idempotent: if passed the same error instance multiple times, it would amend its `message` property every time, eventually leading to bloat and low-signal logs.

The message bloat problem is most evident when rendering multiple `lazy()` components that expose the same Error reference to React (e.g. due to some cache that vends the same rejected Promise multiple times).

More broadly, there's a need for structured, machine-readable logging to replace stringly-typed interfaces in both the production and development use cases.

# This diff

* We leave the user-supplied `message` field intact and instead do all the formatting inside `ExceptionsManager`. To avoid needless complexity, this **doesn't** always have the exact same output as the old code (but it does come close). See tests for the specifics.
* The only mutation we do on React-captured error instances is setting the `componentStack` expando property. This replaces any previously-captured component stack rather than adding to it, and so doesn't create bloat.
* We also report the exception fields `componentStack`, unformatted `message` (as `originalMessage`) and `name` directly to `NativeExceptionsManager` for future use.

Reviewed By: cpojer

Differential Revision: D16331228

fbshipit-source-id: 7b0539c2c83c7dd4e56db8508afcf367931ac71d
2019-07-31 02:34:15 -07:00
Moti Zilberman 71c84cf6be Implement globalEvalWithSourceUrl
Summary:
Implements a new host function on the global object in debug builds, called `globalEvalWithSourceUrl`. This performs a global `eval()` and attaches a URL/filename to the evaluated script (in stack traces, debuggers, etc).

It serves a similar purpose to the `//# sourceURL=` directive (which most JS engines support, but JSC doesn't) and to the old `nativeInjectHMRUpdate` function which was dropped in the JSC->JSI migration.

Reviewed By: cpojer

Differential Revision: D16491506

fbshipit-source-id: bd9a89311dcbb1d0baece77ead16b9ecfb13bfe3
2019-07-25 10:23:42 -07:00
James Treanor 8131b7bb7b CocoaPods frameworks compatibility: Step 2 (#25619)
Summary:
This is my proposal for fixing `use_frameworks!` compatibility without breaking all `<React/*>` imports I outlined in https://github.com/facebook/react-native/pull/25393#issuecomment-508457700. If accepted, it will fix https://github.com/facebook/react-native/issues/25349.

It builds on the changes I made in https://github.com/facebook/react-native/pull/25496 by ensuring each podspec has a unique value for `header_dir` so that framework imports do not conflict. Every podspec which should be included in the `<React/*>` namespace now includes it's headers from `React-Core.podspec`.

The following pods can still be imported with `<React/*>` and so should not have breaking changes: `React-ART`,`React-DevSupport`, `React-CoreModules`, `React-RCTActionSheet`, `React-RCTAnimation`, `React-RCTBlob`, `React-RCTImage`, `React-RCTLinking`, `React-RCTNetwork`, `React-RCTPushNotification`, `React-RCTSettings`, `React-RCTText`, `React-RCTSettings`, `React-RCTVibration`, `React-RCTWebSocket` .

There are still a few breaking changes which I hope will be acceptable:

- `React-Core.podspec` has been moved to the root of the project. Any `Podfile` that references it will need to update the path.
- ~~`React-turbomodule-core`'s headers now live under `<turbomodule/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-turbomodulesamples`'s headers now live under `<turbomodulesamples/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-TypeSaferty`'s headers now live under `<TypeSafety/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511040967.
- ~~`React-jscallinvoker`'s headers now live under `<jscallinvoker/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- Each podspec now uses `s.static_framework = true`. This means that a minimum of CocoaPods 1.5 ([released in April 2018](http://blog.cocoapods.org/CocoaPods-1.5.0/)) is now required. This is needed so that the ` __has_include` conditions can still work when frameworks are enabled.

Still to do:

- ~~Including `React-turbomodule-core` with `use_frameworks!` enabled causes the C++ import failures we saw in https://github.com/facebook/react-native/issues/25349. I'm sure it will be possible to fix this but I need to dig deeper (perhaps a custom modulemap would be needed).~~ Addressed by 33573511f0.
- I haven't got Fabric working yet. I wonder if it would be acceptable to move Fabric out of the `<React/*>` namespace since it is new? �

## Changelog

[iOS] [Fixed] - Fixed compatibility with CocoaPods frameworks.
Pull Request resolved: https://github.com/facebook/react-native/pull/25619

Test Plan:
### FB

```
buck build catalyst
```

### Sample Project

Everything should work exactly as before, where `use_frameworks!` is not in `Podfile`s. I have a branch on my [sample project](https://github.com/jtreanor/react-native-cocoapods-frameworks) here which has `use_frameworks!` in its `Podfile` to demonstrate this is fixed.

You can see that it works with these steps:

1. `git clone git@github.com:jtreanor/react-native-cocoapods-frameworks.git`
2. `git checkout fix-frameworks-subspecs`
3. `cd ios && pod install`
4. `cd .. && react-native run-ios`

The sample app will build and run successfully. To see that it still works without frameworks, remove `use_frameworks!` from the `Podfile` and do steps 3 and 4 again.

### RNTesterPods

`RNTesterPodsPods` can now work with or without `use_frameworks!`.

1. Go to the `RNTester` directory and run `pod install`.
2. Run the tests in `RNTesterPods.xcworkspace` to see that everything still works fine.
3. Uncomment the `use_frameworks!` line at the top of `RNTester/Podfile` and run `pod install` again.
4. Run the tests again and see that it still works with frameworks enabled.

Reviewed By: PeteTheHeat

Differential Revision: D16465247

Pulled By: PeteTheHeat

fbshipit-source-id: cad837e9cced06d30cc5b372af1c65c7780b9e7a
2019-07-24 23:27:09 -07:00
Samuel Susla 631992b093 Back out "[react-native][PR] Use CALayers to draw text"
Summary:
Original commit changeset: c45409a8413e

I was unable to find the cause of the problem.

Reviewed By: yungsters

Differential Revision: D16240754

fbshipit-source-id: c1e3f0aa615422f1156706f919e8f851f82c18b0
2019-07-13 09:00:51 -07:00
Héctor Ramos 9ece5bda9b Use CocoaPods-based RNTesterPods for iOS tests (#25416)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/25416

Use CocoaPods-based RNTesterPods workspace to run iOS unit tests and integration tests.

This is necessary as new iOS projects now use CocoaPods by default. CocoaPods also powers the new package auto-linking feature.

In order to provide test coverage for this new default configuration, our iOS tests are being migrated to use a CocoaPods-managed RNTester workspace. This applies to both Circle CI, and Sandcastle.

Changelog:

[iOS] [Changed] - Use RNTesterPods for iOS Tests

Reviewed By: fkgozali

Differential Revision: D16052466

fbshipit-source-id: 724b0c51008882d3c06a9074693fe23e74abe86b
2019-06-28 19:18:10 -07:00
Daryl Johnas Sison 64282fd5b9 Revert D15958209: [RN] [RNTesterPods 5] Use CocoaPods-based RNTesterPods for iOS tests
Differential Revision:
D15958209

Original commit changeset: b51fb907812c

fbshipit-source-id: f0c499d8720ac91d5933c560281788e123269478
2019-06-28 00:57:57 -07:00
Héctor Ramos 39ab66793b Use CocoaPods-based RNTesterPods for iOS tests (#25416)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/25416

Use CocoaPods-based RNTesterPods workspace to run iOS unit tests and integration tests.

This is necessary as new iOS projects now use CocoaPods by default. CocoaPods also powers the new package auto-linking feature.

In order to provide test coverage for this new default configuration, our iOS tests are being migrated to use a CocoaPods-managed RNTester workspace. This applies to both Circle CI, and Sandcastle.

Reviewed By: fkgozali

Differential Revision: D15958209

fbshipit-source-id: b51fb907812cb2d4d78cce445d39bc253ae5acf8
2019-06-27 23:57:45 -07:00
Janic Duplessis 690e85db04 Use CALayers to draw text (#24387)
Summary:
The current technique we use to draw text uses linear memory, which means that when text is too long the UIView layer is unable to draw it. This causes the issue described [here](https://github.com/facebook/react-native/issues/19453). On an iOS simulator the bug happens at around 500 lines which is quite annoying. It can also happen on a real device but requires a lot more text.

To be more specific the amount of text doesn't actually matter, it is the size of the UIView that we use to draw the text. When we use `[drawRect:]` the view creates a bitmap to send to the gpu to render, if that bitmap is too big it cannot render.

To fix this we can use `CATiledLayer` which will split drawing into smaller parts, that gets executed when the content is about to be visible. This drawing is also async which means the text can seem to appear during scroll. See https://developer.apple.com/documentation/quartzcore/calayer?language=objc.

`CATiledLayer` also adds some overhead that we don't want when rendering small amount of text. To fix this we can use either a regular `CALayer` or a `CATiledLayer` depending on the size of the view containing the text. I picked 1024 as the threshold which is about 1 screen and a half, and is still smaller than the height needed for the bug to occur when using a regular `CALayer` on a iOS simulator.

Also found this which addresses the problem in a similar manner and took some inspiration from the code linked there https://github.com/GitHawkApp/StyledTextKit/issues/14#issuecomment-395234885

Fixes https://github.com/facebook/react-native/issues/19453

## Changelog

[iOS] [Fixed] - Use CALayers to draw text, fixes rendering for long text
Pull Request resolved: https://github.com/facebook/react-native/pull/24387

Test Plan:
- Added the example I was using to verify the fix to RNTester.
- Made sure all other examples are still rendering properly.
- Tested text selection

Reviewed By: shergin

Differential Revision: D15918277

Pulled By: sammy-SC

fbshipit-source-id: c45409a8413e6e3ad272be39ba527a4e8d349e28
2019-06-24 02:59:31 -07:00
cpojer e7ebb17452 Fix RNTester on iOS (#24736)
Summary:
See e94b116d76 which broke RNTester in open source. Environment variables are always strings, so "0" is a truthy value. This fixes it.

[iOS] [fixed] - Fixed broken RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/24736

Reviewed By: fkgozali

Differential Revision: D15272951

Pulled By: hramos

fbshipit-source-id: aa78f229e05cb553f75cdf6fb4f926829e20a557
2019-05-08 19:36:07 -07:00
Jeffrey Beauchamp bccac53a45 Revert D15240810: [react-native][PR] Fix RNTester on iOS
Differential Revision:
D15240810

Original commit changeset: 76f498222b6a

fbshipit-source-id: c6bb1bb0738609b36faccbee93a32e76d17cde87
2019-05-08 16:44:07 -07:00
cpojer 58328558c6 Fix RNTester on iOS (#24736)
Summary:
See e94b116d76 which broke RNTester in open source. Environment variables are always strings, so "0" is a truthy value. This fixes it.

[iOS] [fixed] - Fixed broken RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/24736

Differential Revision: D15240810

Pulled By: hramos

fbshipit-source-id: 76f498222b6ac05131b3820d8356bfee696f46b8
2019-05-08 15:41:10 -07:00
Héctor Ramos e94b116d76 Support optional bundle prefix in RNTester integration tests
Summary:
Add support for a `CI_USE_BUNDLE_PREFIX` envvar in the RNTester Xcode scheme, as part of ongoing work to enable integration tests in Facebook's internal CI system.

[iOS] [Added] - Add new envvar to support internal iOS tests at Facebook

Reviewed By: cpojer

Differential Revision: D15163397

fbshipit-source-id: 1b75b1868b5f9721a69f6cba4d4052be47e5e5e2
2019-05-06 16:00:53 -07:00
Spencer Ahrens 3155ddf2e8 Support callbacks in synchronous native functions
Summary:
We need to move animated native module calls to synchronous so we can properly thread them in with mounting instructions in Fabric. Some of them take callbacks so we need to add support for that when switching to synchronous.

A side benefit is that we can unify codepaths a little more with async callbacks.

Reviewed By: shergin

Differential Revision: D14790898

fbshipit-source-id: dc222b9e74375e046e8a9b1b19d72f652dc6722c
2019-04-08 09:15:13 -07:00
Christoph Nakazawa 6345fcf12b Remove WebView from public RN interface
Summary:
This diff removes the `WebView` export from React Native. Internally, we are requiring `WebView` directly now and externally people will have to use the community maintained module. This diff does not yet move the WebView files from the repo, this will happen in a follow-up.

Note that I had to remove a test for Cookies that displayed data in a WebView. I don't think there is an easy way to retain this (debugging) information that likely very few people ever take a look at so I think it is fine.

Reviewed By: TheSavior

Differential Revision: D14613077

fbshipit-source-id: b1d412f970d09d7d70ecac2c23e62cfdd09d7c8e
2019-03-28 17:37:05 -07:00
zhongwuzw 456c03a37e Remove obliterated snapshots (#24162)
Summary:
Part of #23889 . To remove obliterated snapshots.
cc. cpojer .

[iOS] [Changed] - Remove obliterated snapshots
Pull Request resolved: https://github.com/facebook/react-native/pull/24162

Differential Revision: D14642318

Pulled By: cpojer

fbshipit-source-id: 5638d2104b529522363de3885e282851a51c497e
2019-03-27 08:29:57 -07:00
zhongwuzw 17ca80a9c5 Fixed test_ios Switch test failed (#24009)
Summary:
In #23977 , it changed switch example, it leads snapshots test failed.

cc hramos .

[iOS] [Fixed] - Fixed test_ios Switch test failed
Pull Request resolved: https://github.com/facebook/react-native/pull/24009

Differential Revision: D14504806

Pulled By: cpojer

fbshipit-source-id: 0c47226a3da0cba2371c627f42f62835b3aac810
2019-03-18 10:24:25 -07:00
zhongwuzw a205f64971 Remove snapshots below iOS12 (#23889)
Summary:
We already change iOS in CI to 12.1, so we can remove those unused snapshots.
https://github.com/facebook/react-native/blob/master/scripts/.tests.env#L19

CC. hramos

[iOS] [Fixed] - Remove snapshots below iOS12
Pull Request resolved: https://github.com/facebook/react-native/pull/23889

Differential Revision: D14477608

Pulled By: cpojer

fbshipit-source-id: 1933de4fcfeecd12f03f3c7863e541b39be93b61
2019-03-15 03:47:08 -07:00
ericlewis bbf715685e Fix semi-transparent backgrounds on Text components (#23872)
Summary:
Fix #23849. When setting a semi-transparent background on text, it becomes obvious that we are drawing the background color twice. Since background color is handled by the view, we should not need to draw the glyph background color too.

| Before        | After   |
| ------------- |-------------|
|<img src="https://i.imgur.com/8JGpKTC.png" width="300">     | <img src="https://imgur.com/qjKU9Ze.png" width="300">

[iOS] [Fixed] - Semi-transparent backgrounds on text
Pull Request resolved: https://github.com/facebook/react-native/pull/23872

Differential Revision: D14430501

Pulled By: shergin

fbshipit-source-id: 19743415b2d20a3b941b1c80bd7b47144e929458
2019-03-14 10:23:19 -07:00
ericlewis 58c3a4c078 Fix crash when calling substring() on a string containing emoji. (#23609)
Summary:
Fixes #23459. It is not legal to write the character array of a std::string, and can result in undefined behavior.

[General] [Fixed] - Crash when substring intersects with emoji
Pull Request resolved: https://github.com/facebook/react-native/pull/23609

Differential Revision: D14198159

Pulled By: mdvacca

fbshipit-source-id: 71060b1b99ddab89793c98c09f99ec9974479e62
2019-03-01 00:57:00 -08:00
zhongwuzw 7a7eb11965 Fix textAttributes not applied when typing text (#23585)
Summary:
Currently, if we has `defaultValue`, textAttributes like `letterSpacing` can works, but if textinput has not default text, when we typing the text, some attributes not applied.

[iOS] [Fixed] - Fix textAttributes not applied when typing text
Pull Request resolved: https://github.com/facebook/react-native/pull/23585

Differential Revision: D14206568

Pulled By: cpojer

fbshipit-source-id: 7db276d811684bf6e01f8d30287cca80095db87c
2019-02-24 23:37:41 -08:00
Eric Lewis 38e91e6a9d fix getPhotos params on RNTester XHR example. (#23548)
Summary:
Fixes redscreen on RNTester's XHR page. CameraRoll getPhotos was missing params.

ss: https://i.imgur.com/JLThyrF.png

[iOS] [Fixed] - RNTester XHR Example crash
Pull Request resolved: https://github.com/facebook/react-native/pull/23548

Differential Revision: D14151304

Pulled By: hramos

fbshipit-source-id: 7ff02c7fe32f09aecd50bc7df9f37b7cd2851b1c
2019-02-20 09:57:26 -08:00
Héctor Ramos eb414b7f8d Update iOS Snapshots (#23538)
Summary:
The iOS snapshots needed to be updated after cf5f25472d updated `ViewExample.js`.

[iOS] [Fixed] - Updated snapshots on iOS.
Pull Request resolved: https://github.com/facebook/react-native/pull/23538

Differential Revision: D14146723

Pulled By: cpojer

fbshipit-source-id: f949d4c7925ab53ef42f42689bc2ed7b254dea48
2019-02-19 22:07:32 -08:00
Eric Lewis d419f0787c Fix testScrollViewExample flakiness (#23541)
Summary:
Sometimes images are slow to load, and they are quite heavy. This converts the ScrollViewExample to a list of simple text items, similar to the append example inside of it.

What it looks like: https://i.imgur.com/jt083Iv.png

[iOS] [Fixed] - Fix testScrollViewExample flakiness
Pull Request resolved: https://github.com/facebook/react-native/pull/23541

Differential Revision: D14142947

Pulled By: hramos

fbshipit-source-id: c897a4caa5374ef67e3d67306e3124c29b969565
2019-02-19 16:24:08 -08:00
Brent Erickson 08a6b573f7 Add scrollEnabled example to RNTester (#23409)
Summary:
RNTester is missing a test for the scrollEnabled prop

[General] [Added] - Added RNTester ScrollView scrollEnabled prop test
Pull Request resolved: https://github.com/facebook/react-native/pull/23409

Differential Revision: D14059824

Pulled By: hramos

fbshipit-source-id: 0287277b64aeac69c4aeba83dbb3f73be646ede7
2019-02-12 17:31:30 -08:00
Héctor Ramos 47a5bcbca2 Remove TabBarExample from Screenshot Tests (#23206)
Summary:
Fixes https://github.com/facebook/react-native/issues/23108. The TabBarIOS component is scheduled to be removed from core any day now, so it's OK to remove it from our test suite.

Changelog:
----------

[iOS] [Removed] - Remove TabBarExample SST
Pull Request resolved: https://github.com/facebook/react-native/pull/23206

Differential Revision: D13864064

Pulled By: hramos

fbshipit-source-id: f65da75e2789d384dcd713a27ca5528f0faa7526
2019-01-29 14:38:31 -08:00
Woraphot Chokratanasombat 27617be9bb RNTesterSnapshotTests update ios snapshot images due to layout changes (#23152)
Summary:
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change:

Changelog:
----------
Currently ci in master fail for `test_ios`. Due to tests in `RNTesterSnapshotTests`. (Related to https://github.com/facebook/react-native/issues/23108)
Root cause is layout in RNTest was changed and snapshot is not updated to reflect changes. https://user-images.githubusercontent.com/4032276/51730680-06609480-20ab-11e9-88cb-d4113e2819f2.png

Reference: https://circleci.com/gh/facebook/react-native/68285?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

[iOS] [Fixed] - Fix test ios in ci
Pull Request resolved: https://github.com/facebook/react-native/pull/23152

Differential Revision: D13817049

Pulled By: cpojer

fbshipit-source-id: 7df8b6744ae91cf9be0ef9eee476c8f1565ae1f6
2019-01-25 05:25:39 -08:00
Héctor Ramos 86d0611c5a test_ios → : Update iOS Snapshots, remove tvOS tests, disable failing tests (#22720)
Summary:
The following tests are disabled in this PR:

- testTimersTest is failing due to undefined this.setTimeout, probably introduced back in 61346d3. Tracking a fix in https://github.com/facebook/react-native/issues/22695
- testTheTester_ExpectError is failing as RCTTestRunner is not properly passing through the error. Tracking a fix in https://github.com/facebook/react-native/issues/22697

I've added a comment regarding testWebSocketTest and how to ensure it passes locally.

This PR also fixes all remaining snapshot tests, which were failing due to the use of iPhone XS as a iOS Simulator on Circle CI. We are using iPhone 6s for SST internally, and this allows us to be consistent.
Pull Request resolved: https://github.com/facebook/react-native/pull/22720

Differential Revision: D13532788

Pulled By: hramos

fbshipit-source-id: 75681236032839bf88180611ee68826b53cc96eb
2018-12-20 15:08:47 -08:00
Radek Czemerys d7025d2220 Remove ActivityIndicator from ScrollView snapshot tests (#22729)
Summary:
`ActivityIndicator` was not consistent when running snapshot tests so I removed it.

From diff:
![image](https://user-images.githubusercontent.com/7029942/50274094-9c662700-043c-11e9-9cac-ccc1b69695c1.png)

Changelog:
----------

[iOS] [FIXED] - Fixed ScrollViewExample snapshot tests
Pull Request resolved: https://github.com/facebook/react-native/pull/22729

Differential Revision: D13528756

Pulled By: hramos

fbshipit-source-id: 747d91ad6a8fb8f0aa8022496bd8855a90710142
2018-12-20 10:02:34 -08:00
Héctor Ramos 0407d8c8fd Update RNTester snapshots
Summary:
The iOS snapshots have been out of date for months, but the failure was not caught in open source's  `test_objc` job because `xcpretty` was swallowing the non-zero error code.

To fix this, I enabled recording mode in RNTesterSnapshotTests.m temporarily, and re-ran the tests in order to update the snapshots. I've also switched the test device used by Circle CI to iPhone 6s to be consistent with the snapshot tests that run internally at Facebook.

Integration tests are not fully fixed yet, but I can confirm the following tests are fixed by this diff:

```
-[RNTesterIntegrationTests testImageSnapshotTest]
-[RNTesterIntegrationTests testSimpleSnapshotTest]
-[RNTesterSnapshotTests testARTExample]
-[RNTesterSnapshotTests testLayoutExample]
-[RNTesterSnapshotTests testSliderExample]
-[RNTesterSnapshotTests testSwitchExample]
-[RNTesterSnapshotTests testTabBarExample]
-[RNTesterSnapshotTests testTextExample]
-[RNTesterSnapshotTests testViewExample]
```

I've also fixed a few shellcheck warnings in related scripts.

Reviewed By: fkgozali

Differential Revision: D13506865

fbshipit-source-id: dab985130c2ff3cb9dea19d1f87c8ee65d8c141e
2018-12-18 16:20:10 -08:00
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
Nicolas Charpentier 0cce0a62c1 Add backface-visibility support on Android (#15970)
Summary:
`backfaceVisibility` was only available on iOS and 3D transformations were lacking on Android.

Backface Visibility is computed from ~the decomposed matrix of transform prop~ the view with their rotation degree values.

~`MatrixDecompositionContext` properties have been made public so we can access to decomposed matrix values from outside (`ReactViewGroup`).~

I'm not sure if this is the best implementation, so if it's not let's discuss it.

cc janicduplessis foghina

Tested in https://github.com/charpeni/react-native-backface-visibility.

| Before | Now |
| - | - |
| <img src="https://user-images.githubusercontent.com/7189823/30123717-e5361598-9300-11e7-8e2e-a87a7a8d896a.gif" width="260" /> | <img src="https://user-images.githubusercontent.com/7189823/30514997-4d203572-9aee-11e7-8542-bfde41678eb6.gif" width="244" /> |

| iOS | Android |
| - | - |
| <img src="https://user-images.githubusercontent.com/7189823/36995899-609513b4-2083-11e8-9834-ee44c1a292e1.gif" width="300" /> | <img src="https://user-images.githubusercontent.com/7189823/36995978-9ed3b158-2083-11e8-841e-b9e3357d2509.gif" width="240" /> |

[ANDROID] [FEATURE] [ReactViewGroup] - Add backface-visibility support on Android
Pull Request resolved: https://github.com/facebook/react-native/pull/15970

Differential Revision: D9411130

Pulled By: hramos

fbshipit-source-id: 62f646a4de37d83922286cb98893a95b55fa889e
2018-09-07 10:26:20 -07:00
Tim Yung cd48a6130b RN: Disable testImageCachePolicyTest
Reviewed By: fkgozali

Differential Revision: D7878430

fbshipit-source-id: 60f0ca3f2b59987d618982c91a7e91a2f4b6a18b
2018-05-04 10:58:46 -07:00
Valentin Shergin a534672e13 Fixed problem in Text measurent on iOS
Summary: See the comment it code.

Reviewed By: mmmulani

Differential Revision: D7074168

fbshipit-source-id: e6eda9a47552142ccb0ba8e7bd9a103b0cb4f9f9
2018-02-25 09:37:38 -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
Valentin Shergin 114c258045 Enabling round-to-pixel Yoga feature for RN (iOS)
Summary:
This change enables built-in Yoga mechanism which rounds producing layout metrics to closest "pixel" values.
See previous diff for more context.

Reviewed By: fkgozali

Differential Revision: D6889762

fbshipit-source-id: bc2eea44704db4b377e2e14fab9f67be8c935719
2018-02-05 22:17:22 -08:00
Douglas Lowder a63fd378a4 Link both iOS and tvOS libraries with react-native link (fix #13783)
Summary:
Fix issues with the react-native CLI when linking iOS and tvOS libraries to a project created with `react-native init`. (#13783)

Verified the changes against test project at https://github.com/dlowder-salesforce/react-native-link-test.  Both `react-native link react-native-svg` and `react-native unlink react-native-svg` work correctly on this project.  Added new unit test for the new file added to `local-cli/link/ios`.

[CLI] [BUGFIX] `react-native link` has been fixed to correctly link iOS and tvOS targets.
[IOS] [BUGFIX] `react-native link` has been fixed to correctly link iOS and tvOS targets.
Closes https://github.com/facebook/react-native/pull/17231

Differential Revision: D6837567

Pulled By: hramos

fbshipit-source-id: 234d3d3966ae1b89cd16a37c95d303553f7ba5f5
2018-01-30 16:28:59 -08:00
Hogyun Yu  (aka Philographer) b9d058a05c Remove references to Travis
Summary:
react-native project is migrated travis to circleCI.
but the document has some leavings.

Only Docs Edited

https://github.com/facebook/react-native/pull/16354
https://github.com/facebook/react-native/pull/16364

[ DOCS] Remove references to Travis
changed Releases.md
changed RNTester/RNTesterIntegrationTests/RNTesterSnapshotTests.m
changed scripts/android-e2e-test.js
Closes https://github.com/facebook/react-native/pull/17733

Differential Revision: D6806336

Pulled By: shergin

fbshipit-source-id: 22d21995d718a89bb831f75ed2ff6074dd22c6fe
2018-01-24 22:18:34 -08:00
Valentin Shergin 8c8944c10f Removing `inherited background color` optimization from RCTText
Summary:
This is a long story. Awhile ago awesome Nick Lockwood (Hey Nick!) introduced a special optimization for ReactNative rendering layer called "inherited background color".
He described this idea in D2811031:
>>>
Blending semitransparent pixels against their background is fairly a fairly expensive operation on mobile GPUs. To reduce blending, React Native has a system called "background color propagation", where the background color of parent views is automatically inherited by child views unless explicitly overridden. This means that translucent pixels can be blended directly against a known background color, avoiding the need to do this dynamically on the GPU.
In practice, this is only useful for views that do their own drawing, which is basically just <Image/> and <Text/> components, and for image components it only really matters when the image has an alpha component.
The automatic background propagation is a bit of a hack, and often does the wrong thing - for example if a view overflows its bounds, or if it overlaps a sibling, the background color will often be incorrect and need to be manually disabled. Because the only place that it provides a significant performance benefit is for text, this diff disables the behavior for everything except <Text/> nodes. It might still be useful for <Image/> nodes too, but looking through the examples in UIExplorer, the number of places where it does the wrong thing for images outnumbers the cases where it provides significant reduction in blending.

However. I think it is time to remove it. Why? There are several reasons:

* It drastically complicates rendering layer. DRASTICALLY. In many many unrelated places (try search for "backgroundColor"!);
* This mechanism is totally non-conceptual to RN and it prevents us to implement some new possible render optimization that we plan to do;
* This adopted only by two components now: Text and ART;
* This is not a significant performance drain anymore; from iOS 6 even UILabel has clear background color by default.
* I doubt that it even works now because `drawRect:` in Text component does not call super method.

So, this diff just turns this feature off for Text. If all performance metrics are neutral, I will delete this mechanism.
Peace.

Reviewed By: sahrens

Differential Revision: D6564199

fbshipit-source-id: 70524fdd955ca32bbf86d2d1ff5e73316b791219
2017-12-15 12:31:58 -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
Valentin Shergin a32e1cfffb Revert D5189017: [RN] Native implementation of <Image> intrinsic content size on iOS
Differential Revision: D5189017

fbshipit-source-id: 35901e0b5c289cb7ae5b4fe8b13f3da3e43e819f
2017-10-25 08:20:48 -07:00
Valentin Shergin e118d7a656 Revert D5196055: [RN] Intrinsic content size for network image sources of <Image>
Differential Revision: D5196055

fbshipit-source-id: 2122029518dc6f7d1612d31b0ecfa3dd2f0dea7d
2017-10-25 08:20:48 -07:00
Valentin Shergin f3a32895ca Intrinsic content size for network image sources of <Image>
Summary:
It makes possible to just specify remote url for the <Image> and it will work.
`<Image source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}} />`

Reviewed By: javache

Differential Revision: D5196055

fbshipit-source-id: aaf139c4518cc35d1f4cf810bbf0305aad73a55b
2017-10-23 20:00:12 -07:00
Valentin Shergin 7bd0855650 Native implementation of <Image> intrinsic content size on iOS
Summary:
Now intrinsic content size of <Image> is implemented natively on iOS and now it is actually
`intrinsicContentSize`, not just overrided `height` and `width` styles (which was incorrect and hacky).
This change also removes support of nested content inside <Image>.
This is a first commit in the row where we improve <Image> implementation.

Reviewed By: mmmulani

Differential Revision: D5189017

fbshipit-source-id: eab3defa3d86a5d4219b4f4925ab7460b58d760f
2017-10-23 20:00:12 -07:00
Mehdi Mulani 6ce69dc925 Fix RNTester tests
Reviewed By: fkgozali

Differential Revision: D5881825

fbshipit-source-id: 38debe598830c4cc969b5251cfdfd8941ac36e9d
2017-09-21 12:31:42 -07:00