Commit Graph

97 Commits

Author SHA1 Message Date
Peter Argany e6eff1f54f Fix RNTester Snapshot and Integration tests missing polyfills
Summary: Emily removed some magic that required InitializeCore for everything back in Sept/Oct. These tests have been broken for a long time, so it wasn't obvious that they broke.

Reviewed By: ejanzer

Differential Revision: D13601264

fbshipit-source-id: ea6ab7c8891207dad06cd062968d019a236cf8fc
2019-01-09 10:23:50 -08:00
Christoph Nakazawa 4148976a83 Use `invariant` instead of `fbjs/lib/invariant`
Summary: This is one more step to remove `fbjs` from `react-native-github`. This changes both the internal and external code to use `invariant` from zertosh instead of the copy in fbjs.

Reviewed By: yungsters

Differential Revision: D13195941

fbshipit-source-id: 73564ca1715110e7da9c7ef56dc57374d61377e0
2018-12-03 00:07:02 -08:00
Ignacio Olaciregui 1d62e94b85 Fix inline styles in IntegrationTests (#22165)
Summary:
Fix `react-native/no-inline-styles` eslint warning for IntegrationTests module.
Pull Request resolved: https://github.com/facebook/react-native/pull/22165

Differential Revision: D12946915

Pulled By: TheSavior

fbshipit-source-id: 438bb74cc34dd5893f725e4865568715ce949c3a
2018-11-06 13:50:57 -08:00
Ignacio Olaciregui 6ebee18d13 Remove unused variables (#22097)
Summary:
Fix unused variable ESLint warnings.
Pull Request resolved: https://github.com/facebook/react-native/pull/22097

Differential Revision: D12919249

Pulled By: TheSavior

fbshipit-source-id: f680fa7277c58cf685e70dfb911753a30fe01c1d
2018-11-04 10:41:46 -08:00
Ronaldo Lima 61346d303a remove createReactClass and TImerMixin from TimerTest.js (#21748)
Summary:
Related to https://github.com/facebook/react-native/issues/21485#issuecomment-428742440
Remove createReactClass and TimerMixin from IntegrationTests/TimersTest.js
Pull Request resolved: https://github.com/facebook/react-native/pull/21748

Reviewed By: TheSavior

Differential Revision: D10366418

Pulled By: RSNara

fbshipit-source-id: f7e9a1b62a17cd23374997f99dbfe239172b614f
2018-10-18 11:45:45 -07:00
nd-02110114 bb6a69075b remove createrReactClass from SizeFlexibilityUpdateTest (#21715)
Summary:
Related to #21581 .
Removed createReactClass from the IntegrationTests/SizeFlexibilityUpdateTest.js

 - [x] npm run prettier
 - [x] npm run flow-check-ios
 - [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [IntegrationTests/SizeFlexibilityUpdateTest.js] - remove createReactClass dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21715

Reviewed By: TheSavior

Differential Revision: D10341543

Pulled By: RSNara

fbshipit-source-id: 748f9a0176b6cd865d956df774f6dec1ead21562
2018-10-16 16:21:25 -07:00
Ramanpreet Nara 89850583f4 Remove createReactClass from LayoutEventsTest
Summary:
Related to #21581

Remove createReactClass from LayoutEventsTest and refactor a little bit.

Reviewed By: TheSavior

Differential Revision: D10345794

fbshipit-source-id: 40e42f6e9afece5ddf527f91927e75cb1669b696
2018-10-16 16:18:56 -07:00
nd-02110114 96bdfe3a60 remove createReactClass from the IntegrationTests/ReactContentSizeUpdateTest.js (#21622)
Summary:
Related to #21581 .
Removed createReactClass from the IntegrationTests/ReactContentSizeUpdateTest.js

 - [x] npm run prettier
 - [x] npm run flow-check-ios
 - [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [IntegrationTests/ReactContentSizeUpdateTest.js] - remove createReactClass dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21622

Reviewed By: TheSavior

Differential Revision: D10302181

Pulled By: RSNara

fbshipit-source-id: 97b955070deb7a244f335ad609f26ffc07578c01
2018-10-10 14:47:01 -07:00
Thomas BARRAS 4b8c6573f2 Remove SubscribableMixin from SizeFlexibilityUpdateTest (#21580)
Summary:
Related to #21485

Remove SubscribableMixin from SizeFlexibilityUpdateTest

- All flow tests succeed.
- yarn run test-android-instrumentation && CI integration tests

[GENERAL] [ENHANCEMENT] [SizeFlexibilityUpdateTest.js] - rm SubscribableMixin
Pull Request resolved: https://github.com/facebook/react-native/pull/21580

Reviewed By: TheSavior

Differential Revision: D10276267

Pulled By: RSNara

fbshipit-source-id: fc89b43099c788cba560c9aaf0819cd5cfab38c3
2018-10-10 09:01:01 -07:00
Eli White a48fce8802 Remove SubscribableMixin from ReactContentSizeUpdateTest
Summary: Migrate ReactContentSizeUpdateTest off of SubscribableMixin

Reviewed By: RSNara

Differential Revision: D10244324

fbshipit-source-id: 97cf392cf1bd2522dfbfb1968d08b3737b0a7f15
2018-10-08 15:01:41 -07:00
Rafael Nunes G. da Silveira 4d6943168b Remove TimerMixin on ReactContentSizeUpdateTest (#21502)
Summary:
Related to #21485.
Removed `TimerMixin` from `ReactContentSizeUpdateTest`.
Pull Request resolved: https://github.com/facebook/react-native/pull/21502

Reviewed By: TheSavior

Differential Revision: D10218548

Pulled By: RSNara

fbshipit-source-id: 9a0642e14f8548d8dc9683f0f70353416ed04ae0
2018-10-05 14:03:01 -07:00
Ronaldo Lima 80066db654 Replace DeprecatedViewPropTypes.style for ViewStyleProp on IntegrationTestHarnessTest and InputAccessoryView (#21397)
Summary:
related #21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21397

Reviewed By: TheSavior

Differential Revision: D10119623

Pulled By: RSNara

fbshipit-source-id: 16bdb3d5bf90c24b597bbc12fc416a50a0aa2bb1
2018-10-01 14:08:29 -07:00
Janic Duplessis 458d56c0a1 Remove global babelHelpers and regenerator (#21283)
Summary:
Follow up to 8932a9caa8

Babel helpers and regenerator runtime will be imported automatically from `babel/runtime`. We still need to add the global regeneratorRuntime for jest tests since we disable babel-runtime currently.
Pull Request resolved: https://github.com/facebook/react-native/pull/21283

Reviewed By: mjesun

Differential Revision: D10010963

Pulled By: rafeca

fbshipit-source-id: da5e23dd901f8f8940d46816b4fc9290d0e28c76
2018-09-26 10:03:05 -07: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
Eli White 76948ad1bd Typing View style as ViewStyleProp
Summary: Locking down view style so that invalid styles can't be passed into View.

Reviewed By: yungsters

Differential Revision: D9309097

fbshipit-source-id: 69e7e3c5626609cfd47c167027a55470c42228c8
2018-08-14 16:32:11 -07:00
Wayne Cheng f536a0c268 Adding flow strict local to remaining possible files in xplat/JS
Summary:
ag -L --ignore __snapshots__ 'flow strict|noflow|generated|The controller you requested could not be found.' | ag '\.js$' | xargs ag -l 'flow' | sort > ~/temp
  cat ~/temp | xargs ag -L 'flow strict' | xargs sed -i '' 's/flow$/flow strict-local/'
  until flow check; do flow check --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done

allow_many_files
The controller you requested could not be found.
The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9004573

fbshipit-source-id: 936bd5741706b781be06bf08b6ad805a69407dfd
2018-08-09 08:54:44 -07:00
Maël Nison e183844df5 Uniformizes how THIS_DIR is computed in xplat/js
Summary: This form of THIS_DIR resolves symlinks, which is better.

Reviewed By: davidaurelio

Differential Revision: D8661886

fbshipit-source-id: 90bf329e765d9623d103b03c5dd3b71fae9d9854
2018-07-19 05:16:22 -07:00
Eli White 398f1d8ddd vars -> let/const react-native IntegrationTests
Reviewed By: yungsters

Differential Revision: D7986752

fbshipit-source-id: 1f9b129ce19e052584a2cd1240686b6099c64416
2018-05-14 00:24:45 -07:00
Eli White 0e5c2633ee Prettier files with shebang
Reviewed By: yungsters

Differential Revision: D7974564

fbshipit-source-id: 00db563ce24868c0fde117e981936b83cec30e48
2018-05-11 13:52:30 -07:00
Eli White dca21c8f23 Prettier IntegrationTests
Reviewed By: sahrens

Differential Revision: D7958195

fbshipit-source-id: 253c0eec593228e7b6bc66606584877161c6bfc2
2018-05-10 16:16:35 -07:00
Mehdi Mulani 634e7e11e3 iOS only: Breaking Change: Restrict WebView to only http(s) URLs
Summary:
To prevent people from linking file:// or other URLs inside RN WebViews, default <WebView> to not allowing those types of URLs.
This adds the originWhitelist to specify other schemes or domains to be allowed.

If the url is not allowed, it will be opened in Safari/by the OS instead.

Reviewed By: yungsters

Differential Revision: D7833203

fbshipit-source-id: 6881acd3b434d17910240e4edd585c0a10b5df8c
2018-05-04 13:48:34 -07:00
Rubén Norte d5e9e55fa3 Remove @providesModule from all modules
Summary:
This PR removes the need for having the `providesModule` tags in all the modules in the repository.

It configures Flow, Jest and Metro to get the module names from the filenames (`Libraries/Animated/src/nodes/AnimatedInterpolation.js` => `AnimatedInterpolation`)

* Checked the Flow configuration by running flow on the project root (no errors):

```
yarn flow
```

* Checked the Jest configuration by running the tests with a clean cache:

```
yarn jest --clearCache && yarn test
```

* Checked the Metro configuration by starting the server with a clean cache and requesting some bundles:

```
yarn run start --reset-cache
curl 'localhost:8081/IntegrationTests/AccessibilityManagerTest.bundle?platform=android'
curl 'localhost:8081/Libraries/Alert/Alert.bundle?platform=ios'
```

[INTERNAL] [FEATURE] [All] - Removed providesModule from all modules and configured tools.
Closes https://github.com/facebook/react-native/pull/18995

Reviewed By: mjesun

Differential Revision: D7729509

Pulled By: rubennorte

fbshipit-source-id: 892f760a05ce1fddb088ff0cd2e97e521fb8e825
2018-04-25 07:37:10 -07: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
Brian Vaughn 6f007e8957 Ran rename-unsafe-lifecycles codemod on xplat/js
Reviewed By: trueadm

Differential Revision: D6889214

fbshipit-source-id: e815cda4b09f3650ae3b0b9a44ae6f5fcb48fe25
2018-02-08 10:58:31 -08:00
Spencer Ahrens 2d4bedba0f add CoreEventTypes with LayoutEvent
Reviewed By: mhollweck

Differential Revision: D6554426

fbshipit-source-id: 856fcb8017682bc203fd69f5f4c93704816046ac
2017-12-13 12:02:32 -08:00
Gustavo Gard 8547b7e111 Correct logo URL
Summary:
Added static files to remove dependency with `react` website, related PR https://github.com/facebook/react-native/pull/16204

After is merged to master, check if all the URLs are working correctly.

TheSavior
Closes https://github.com/facebook/react-native/pull/16207

Differential Revision: D6509133

Pulled By: hramos

fbshipit-source-id: a31dcc07742211dc17046e7e98d805c2282f2a82
2017-12-07 08:31:38 -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 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
Janic Duplessis 0cd69e8a02 Run eslint --fix
Summary:
CI is currently failing because of a lint issue, this fixes it and a bunch of other warnings that are auto-fixable.

**Test plan**
Quick manual test, cosmetic changes only.
Closes https://github.com/facebook/react-native/pull/16229

Differential Revision: D6009748

Pulled By: TheSavior

fbshipit-source-id: cabd44fed99dd90bd0b35626492719c139c89f34
2017-10-09 17:46:44 -07:00
Marshall Roch 91b6b4efb9 @allow-large-files Flow v0.54.0
Reviewed By: leebyron

Differential Revision: D5773490

fbshipit-source-id: 2c54bb6326f23edbe9a969f3010f79da8189923e
2017-09-06 03:33:43 -07:00
Caleb Meredith 63f990121a Fix React Native open source
Reviewed By: hramos, TheSavior

Differential Revision: D5728356

fbshipit-source-id: fb751d67c16ba9273de93d9b6d5acd65b1555dca
2017-08-29 15:01:05 -07:00
Caleb Meredith 90eaeb019b Upgrade fbsource/xplat/js to Flow v0.53.0
Reviewed By: avikchaudhuri

Differential Revision:
D5648819
Ninja: T20988071

fbshipit-source-id: 66e5b6747c79ae66b6eb69d40ede5e982c26174f
2017-08-17 18:45:01 -07:00
David Aurelio 2512a34bea Add `@providesModule` to `IntegrationTests/WebViewTest.js`
Reviewed By: cpojer

Differential Revision: D5611573

fbshipit-source-id: 78a56524c1941a1d42fb1add5c5410c1bf8597c5
2017-08-11 09:34:44 -07:00
Tom Clarkson 42f7b9e717 Improved window.postMessage implementation
Summary:
Adds a queue to postMessage so that messages sent close together are not lost.

Setting location="a";location="b" results in only "b" reaching shouldStartLoadWithRequest. Making the second update asynchronous with setTimeout does not fix the issue unless a delay is added.

With this update, postMessage queues "b" until it gets a "message:received" event that confirms "a" has already been processed.

The included test sends two messages from a webview and checks that both are received. It fails against the preexisting code with the first message being dropped.
Closes https://github.com/facebook/react-native/pull/11304

Differential Revision: D5481385

Pulled By: hramos

fbshipit-source-id: 9b6af195eeff8f20c820e2fcdac997c90763e840
2017-07-28 11:35:25 -07:00
Seth Fitzsimmons 9afb71fde8 Replace React.createClass with create-react-class
Summary:
This replaces all uses of `React.createClass` with `createReactClass` from the `create-react-class` package, attempting to match use of `var` and `const` according to local style.

Fixes #14620
Refs #14712
Closes https://github.com/facebook/react-native/pull/14729

Differential Revision: D5321810

Pulled By: hramos

fbshipit-source-id: ae7b40640b2773fd89c3fb727ec87f688bebf585
2017-07-07 14:36:01 -07:00
Mehdi Mulani 112e3767ce Fix crash in AccessibilityManager
Summary:
Fix this crash by making sure the RCTDeviceInfo is doing things on the main thread.
This fixes #14043.

Reviewed By: ashwinb

Differential Revision: D5286746

fbshipit-source-id: cce3426a6e7e7221cff82f8bca663d9a060dd358
2017-06-20 18:45:58 -07:00
Gabe Levi 3ddc7d47d5 Fix react-native function call arity errors
Reviewed By: zertosh

Differential Revision: D5081816

fbshipit-source-id: 5978770c30a69fb287d03aa7511999ce30f856a1
2017-05-18 16:55:55 -07:00
Eric Vicenti 4a80dceac7 Re-license and rename UIExplorer integration test app as RNTester
Reviewed By: yungsters

Differential Revision: D4950085

fbshipit-source-id: 44574b5d0ef0d2ad5dfc714309b18dc69cbad9ff
2017-05-08 11:31:19 -07:00
Alex Dvornikov 971b083c6a Added tests for synchronous methods in native modules on iOS
Reviewed By: javache

Differential Revision: D4947631

fbshipit-source-id: d7e497c44602eb6e38896a00edb61639ab2b8cd4
2017-04-27 12:03:30 -07:00
Brian Vaughn 6564edce5e Ran PropTypes -> prop-types codemod against Libraries/FBReactKit/js/react-native-github
Reviewed By: acdlite

Differential Revision: D4876709

fbshipit-source-id: 3a5e92bfc74287b7a9054546c438580bed0147af
2017-04-12 16:15:15 -07:00
Pieter De Baets e0bd35f76f Fix order of timers called in the same frame
Reviewed By: mmmulani

Differential Revision: D4802858

fbshipit-source-id: 8d8400c20b7e487aea5a0943f91ac7adc2d23108
2017-04-03 18:48:48 -07:00
Eric Vicenti 8ff813e6e0 Fix license header on websocket_integration_test_server
Reviewed By: hramos

Differential Revision: D4770121

fbshipit-source-id: c05b45e8775cf3d05c8c9a6e87ab35a3bd032087
2017-03-24 14:47:25 -07:00
Bhuwan Khattar a23a3c319c Add @providesModule annotations
Summary: Adding providesModule annotations to files that don't have a `providesModule` annotation but are in directories that packager crawls.

Reviewed By: cpojer

Differential Revision: D4612455

fbshipit-source-id: b23f0d6bbe2d26f480e93b56b67c6c8b1075e9f7
2017-02-27 14:04:56 -08:00
Bhuwan Khattar 57daad98f0 Rename files to match @providesModule annotations
Reviewed By: davidaurelio

Differential Revision: D4507911

fbshipit-source-id: b8c9b77d7d9a2d8b2ae80d85d116f456766acba0
2017-02-03 15:58:58 -08:00
Peter Salanki 52d8851fc8 Cache policy control for image source
Summary:
In the context of an app an image exists in three resolutions on the server: `thumb` (30px) `feed` (300px) `full` (900px). When looking at an individual item a user can come either from the feed, via a permalink or from other parts of the app. This allows a situation where the `feed` image might or might not already be loaded somewhere in the app. In the detail view I want to render `thumb` with a blur (to quickly display something), then the `feed` image if it exists to have something decent to display until `full` loads. However it is quite a waste to load the `feed` image if it isn't already in cache, and will slow down the time until `full` is loaded. It is possible to track the navigation from feed->detail and that the `feed` image has actually completed loading by the feed component however as component hierarchies grow this turns into quite a lot of prop passing and bad separation of concerns.

NSURLRequests accepts a [Cache Policy](https://developer.apple.com/reference/fo
Closes https://github.com/facebook/react-native/pull/10844

Differential Revision: D4425959

Pulled By: lacker

fbshipit-source-id: 679835439c761a2fc894f56eb6d744c036cf0b49
2017-01-17 17:13:31 -08:00
Douglas Lowder a531efe26e Add an integration test for WebSocket
Summary:
**Motivation**

See if we can safely run a WebSocket test in Travis CI
Closes https://github.com/facebook/react-native/pull/11433

Differential Revision: D4342024

Pulled By: ericvicenti

fbshipit-source-id: 137fb0c39ed7ea3726e2778d5c0bdac4cef6ab89
2017-01-16 13:28:43 -08:00
Alex Kotliarskyi cab88104a3 Cleanup before image! codemod
Reviewed By: fkgozali

Differential Revision: D4196297

fbshipit-source-id: 5c32646dfe858f34c185a917e7d081a60777f242
2016-11-22 21:13:52 -08:00
David Aurelio 3683beb88a RN: Update React (2/2)
Reviewed By: kentaromiura

Differential Revision: D4026114

fbshipit-source-id: 67808af91454d95941fea01eef58a4d9086f46e1
2016-11-04 05:43:44 -07:00
Douglas Lowder bdff1c3f02 Fix timing issues in RCTLoggingTests.m
Summary:
**Motivation**

If there are any console log messages that come in on initialization (as will happen right now in tvOS), the RCTLoggingTests can fail intermittently.  This change delays the start of the logging test to allow time for initial console messages to come in.
Closes https://github.com/facebook/react-native/pull/10568

Differential Revision: D4087974

Pulled By: bestander

fbshipit-source-id: 2b0f4a88a74bc6121133317dd909d5bd1f10789b
2016-10-27 01:43:34 -07:00
Douglas Lowder 0698b2beca Integration test stability: add delay before starting TimersTest
Summary:
* Motivation

Locally I'm seeing consistent failures in IntegrationTests/TimersTest.js.  Adding a little delay before starting the first test seems to make these issues go away.
Closes https://github.com/facebook/react-native/pull/10548

Differential Revision: D4080920

Pulled By: bestander

fbshipit-source-id: 2dec86073786658f24b809284123815e77fbbd99
2016-10-26 03:14:00 -07:00