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

29 Коммитов

Автор SHA1 Сообщение Дата
Ken Tominaga c73e021a4b Remove iOS 11 deprecation warnings around SafeArea (#32851)
Summary:
We don't have to check or emulate the safe area for iOS 11 above. I deleted the unnecessary check for the safe area.

This is a continuation pull request of these iOS 11 availability check.
* [Remove iOS 11 version check by ken0nek · Pull Request https://github.com/facebook/react-native/issues/32151 · facebook/react-native](https://github.com/facebook/react-native/pull/32151)
* [Remove iOS 11 availability check by ken0nek · Pull Request https://github.com/facebook/react-native/issues/32488 · facebook/react-native](https://github.com/facebook/react-native/pull/32488)

-----

- Stop using layout guide (`topLayoutGuide`, `bottomLayoutGuide`)
- Refactor `RCTSafeAreaView`
- Delete `emulateUnlessSupported` property

Docs PR: https://github.com/facebook/react-native-website/pull/2919

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Removed] - Remove `emulateUnlessSupported`

Pull Request resolved: https://github.com/facebook/react-native/pull/32851

Reviewed By: philIip, sammy-SC

Differential Revision: D33586023

Pulled By: cortinico

fbshipit-source-id: 75fc1037141f71d9340c7b875a6bf86f9cfd6a02
2022-05-16 09:27:43 -07:00
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Tim Yung 77ecc7ede1 JS: Format with Prettier v2.4.1 [3/n]
Summary:
Changelog:
[General][Internal]

Reviewed By: zertosh

Differential Revision: D31883447

fbshipit-source-id: cbbf85e4bf935096d242336f41bf0cc5d6f92359
2021-11-02 22:14:16 -07:00
Jorge Rossi d9a86aa651 Convert SafeAreaView to ES Module (#31344)
Summary:
Convert SafeAreaView to ES Module (https://github.com/facebook/react-native/issues/31330).

## Changelog

[General] [Changed] - Converted `SafeAreaView` to ES Module.

Pull Request resolved: https://github.com/facebook/react-native/pull/31344

Test Plan: Tested that `npm test` passes.

Reviewed By: kacieb

Differential Revision: D27767463

Pulled By: lunaleaps

fbshipit-source-id: fd3aee58ae6d621a292ff3360d8833f5e5007d52
2021-04-14 11:48:42 -07:00
Micha Reiser 93377ff508 Remove "use strict" directive from ES Modules
Summary:
ES Modules implicitly enable strict mode. Adding the "use strict" directive is, therefore, not required.

This diff removes all "use strict" directives from ES modules.

Changelog:

[Internal]

Reviewed By: motiz88

Differential Revision: D26172715

fbshipit-source-id: 57957bcbb672c4c3e62b1db633cf425c1c9d6430
2021-02-02 11:12:56 -08:00
Jesse Katsumata a69bd9dadf chore: use es6 import for SafeAreaView component (#29143)
Summary:
This PR is to help proceed this discussion. https://github.com/react-native-community/discussions-and-proposals/issues/201#issuecomment-588454552

Converted `require` to `import` for SafeAreaView.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Changed] - switched to es6 import for SafeAreaView
Pull Request resolved: https://github.com/facebook/react-native/pull/29143

Test Plan: Tested that App runs on RNTester

Reviewed By: shergin

Differential Revision: D22109435

Pulled By: TheSavior

fbshipit-source-id: 57dc4ab88bf497b43422b20416afbe4c4a1e001d
2020-06-18 14:41:43 -07:00
Eli White e362470305 Convert easy files to flow strict-local
Summary:
This diff was generated by this script used by WWW
https://our.intern.facebook.com/intern/diffusion/WWW/browse/master/scripts/flow/upgrade_to_flow_strict_local.sh?lines=0

Changelog:
[Internal] Upgrade flow to flow strict-local

Reviewed By: zackargyle, rickhanlonii

Differential Revision: D18833630

fbshipit-source-id: e64d4e9a49a0db5e6bf70a0c489567862b578d7f
2019-12-05 16:06:46 -08:00
Eli White 20a3bb52ce Convert component snapshot tests to a reusable helper
Summary:
These tests need to be consistent with every test so a helper makes more sense.

Changelog: [Internal]

Reviewed By: rickhanlonii

Differential Revision: D18500439

fbshipit-source-id: de535156d370102bad88e556ad3d2a0d5443e4e2
2019-11-20 18:09:30 -08:00
Eli White 84915a2d68 Make SafeAreView flow strict-local
Summary:
The forwardRef calls were able to be cleaned up and consolidated a bit.

Changelog:
[Changed][SafeAreaView] Improved SafeAreaView's typing, removing extra underscore from display name

Reviewed By: cpojer

Differential Revision: D17881901

fbshipit-source-id: 00f876d34600f4cfd44075eb7ad7192c9a885907
2019-10-18 14:50:59 -07:00
Samuel Susla 07fd3125c8 Migrate MVP SafeAreaView to Fabric
Reviewed By: shergin

Differential Revision: D17736209

fbshipit-source-id: e70c309f2599cdcb8f234d96915546032b71d223
2019-10-04 07:07:36 -07:00
Eli White 1b4eaeb184 Migrate NativeComponentType from codegenNativeComponent to HostComponent #1
Summary:
We need to migrate to HostComponent, this is the first batch.

Changelog:
[Internal] Migrate NativeComponentType from codegenNativeComponent to HostComponent

Reviewed By: rickhanlonii

Differential Revision: D17562879

fbshipit-source-id: ce1993b64a79cede3598c89ddff0dadf07fde92f
2019-09-25 11:44:38 -07:00
Rubén Norte d2213c75ff Define type signature for react-native-implementation
Summary: Explicitly define the types of the getters in `react-native-implementation` so we can enable Flow's types-first mode for that file.

Reviewed By: cpojer

Differential Revision: D16937607

fbshipit-source-id: 2e4cf483043a53c5407254ffa2b3211d40211019
2019-08-21 19:03:07 -07:00
Logan Daniels 91f139b941 xplat/js/react-native-github
Reviewed By: panagosg7

Differential Revision: D16657770

fbshipit-source-id: 4e260842c838a35317515044c54ccf55a083da33
2019-08-09 10:11:15 -07:00
Logan Daniels 9127fb51fc Manual fixes for xplat/js/react-native-github
Summary:
Need to add explicit type annotations in these areas to unblock types-first architecture for Flow. These are locations the codemod could not automatically handle.

I'll call out areas I need a close eye on in the comments.

Reviewed By: panagosg7

Differential Revision: D16659053

fbshipit-source-id: 167dd2abe093019b128676426374c1c62cf71e7f
2019-08-09 10:11:15 -07:00
Rubén Norte 5689302a6a Add RTCSafeAreaView
Summary: Adds codegen component for RTCSafeAreaView(NativeComponent).

Reviewed By: rickhanlonii

Differential Revision: D15804215

fbshipit-source-id: 103312aecb35029d05412b70829dbe4668ba7768
2019-06-14 03:16:54 -07:00
James Ide 0ee5f68929 Migrate "Libraries" from Haste to standard path-based requires (sans vendor & renderers) (#24749)
Summary:
This is the next step in moving RN towards standard path-based requires. All the requires in `Libraries` have been rewritten to use relative requires with a few exceptions, namely, `vendor` and `Renderer/oss` since those need to be changed upstream. This commit uses relative requires instead of `react-native/...` so that if Facebook were to stop syncing out certain folders and therefore remove code from the react-native package, internal code at Facebook would not need to change.

See the umbrella issue at https://github.com/facebook/react-native/issues/24316 for more detail.

[General] [Changed] - Migrate "Libraries" from Haste to standard path-based requires
Pull Request resolved: https://github.com/facebook/react-native/pull/24749

Differential Revision: D15258017

Pulled By: cpojer

fbshipit-source-id: a1f480ea36c05c659b6f37c8f02f6f9216d5a323
2019-05-08 08:48:59 -07:00
zhongwuzw cc2b3d0ebf Add setNativeProps support for SafeAreaView (#24589)
Summary:
Fixes #24576 .
cc. cpojer .

[iOS] [Fixed] - Add setNativeProps support for SafeAreaView
Pull Request resolved: https://github.com/facebook/react-native/pull/24589

Differential Revision: D15099303

Pulled By: cpojer

fbshipit-source-id: f694f19fd932236c001056f38cc976db38db68a6
2019-04-26 08:47:09 -07:00
Maxime Nory 28230939c9 RCTSafeAreaView (#23006)
Summary:
Part of #22990

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

[iOS] [Changed] - Create individual `RCTSafeAreaViewNativeComponent` JS file from `SafeAreaView` with flow typing.
Pull Request resolved: https://github.com/facebook/react-native/pull/23006

Reviewed By: TheSavior

Differential Revision: D13690683

Pulled By: rickhanlonii

fbshipit-source-id: 7928fabf0264a6269a41148432f604e82d9b3920
2019-01-16 13:10:52 -08:00
Valentin Shergin 454aa02210 SafeAreaView: A new prop `emulateUnlessSupported` that turns off the custom implementation of `safeAreaInsets` insets
Summary: In some cases, the custom implementation of this prop is undesirable, so this allows to turn it off.

Reviewed By: yungsters

Differential Revision: D9759228

fbshipit-source-id: 4f61cd900c2da9046977c11a61606a4f5f961177
2018-09-11 21:19:18 -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 b620ccab49 Deprecate View prop-type definitions
Summary: This diff moves the prop-type definitions for View out into it's own file. We will be able to do this with a bunch of the prop-type definitions and then move them out into a deprecated npm package.

Reviewed By: yungsters

Differential Revision: D9444394

fbshipit-source-id: 4fd0a78533211b598ba2da4eb5015ffcc20bb675
2018-08-22 18:31:36 -07:00
Jordan Brown b64b9dbece Replace '@flow strict(-local)' with '@flow' in .android.js files
Summary:
Flow doesn't check .android.js files yet anyway.

I'm going to be adding suppressions in a followup diff. It would be nice to not have >1k suppressions saying that we can't do certain things in `flow strict` when we don't even typecheck with regular `flow` just yet

I ran these commands to produce this diff:
`find . -name '*.android.js' -exec sed -i 's/flow strict-local/flow/g' {} +`
`find . -name '*.android.js' -exec sed -i 's/flow strict/flow/g' {} +`

Followed https://unix.stackexchange.com/questions/112023/how-can-i-replace-a-string-in-a-files to do it.

The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9143783

fbshipit-source-id: e9af4fe695ebdba4db4083de1697cc248d48eb0d
2018-08-08 10:48:19 -07:00
Wayne Cheng 86f8e9e760 Adding flow strict to as many xplat files as possible
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/'
  cat ~/temp | xargs ag -L 'flow strict$' | xargs sed -i '' 's/flow strict-local$/flow strict/'
  until flow; 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: yungsters

Differential Revision: D9003523

fbshipit-source-id: d0c9fbfe3c32e65d57819fa040d06cd6ebbd59cc
2018-07-27 12:31:42 -07:00
Tim Yung 8dc3ba0444 RN: Remove Native Prop Validation
Summary:
As we migrate over to static typing solutions for props, we cannot rely on always having `propTypes` available at runtime.

This gets us started on that journey by removing the native prop validation that happens when we require native components.

bypass-lint

Reviewed By: TheSavior

Differential Revision: D7976854

fbshipit-source-id: f3ab579a7f0f8cfb716b0eb7fd4625f8168f3d96
2018-06-01 12:54:14 -07:00
Eli White d01ab66b47 Prettier React Native Libraries
Reviewed By: sahrens

Differential Revision: D7961488

fbshipit-source-id: 05f9b8b0b91ae77f9040a5321ccc18f7c3c1ce9a
2018-05-10 19:10:38 -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
Wei Yeh 58edf024a1 Fix typo in SafeArea documentation
Reviewed By: shergin

Differential Revision: D6316656

fbshipit-source-id: 12d37f9d8ad2481b7f6685c8d675ce84234bd814
2017-11-14 10:32:15 -08:00
Valentin Shergin 983b05441d Introducing <SafeAreaView>
Summary:
<SafeAreaView> renders nested content and automatically applies paddings reflect the portion of the view
that is not covered by navigation bars, tab bars, toolbars, and other ancestor views.
Moreover, and most importantly, Safe Area's paddings feflect physical limitation of the screen,
such as rounded corners or camera notches (aka sensor housing area on iPhone X).

Reviewed By: mmmulani

Differential Revision: D5886411

fbshipit-source-id: 7ecc7aa34de8f5527c4e59b0fb4efba3aaea28c8
2017-09-24 23:01:25 -07:00