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

28 Коммитов

Автор SHA1 Сообщение Дата
Vincent Riemer 291f26c5c0 Fill out w3c pointer event types
Summary: Changelog: [Internal] Fill out w3c PointerEvent flow types

Reviewed By: yungsters

Differential Revision: D36296044

fbshipit-source-id: f1c184fd6486fa72077e5b80d2335919af0fc145
2022-05-19 18:48:24 -07:00
Luna Wei c50e6b52fe Emit non-hover pointer events on Android (#33526)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33526

Changelog: [Internal] Experimental pointer event dispatching on Android: touch pointer support only, hover events to come later.

Reviewed By: vincentriemer

Differential Revision: D34132667

fbshipit-source-id: 6506d43b4ad16e11b10c3cd23e0231428209411f
2022-03-30 19:12:42 -07:00
Moti Zilberman 1814bffcc2 Minor changes to Flow types
Summary: Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D34171528

fbshipit-source-id: c3fdc4a8c77731f1f43f0e6d830d172906ed79a1
2022-02-15 08:50:55 -08: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
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
Rubén Norte 1e7536a070 Migrate CodegenTypes and dependencies to Flow strict
Summary:
Migrates `CodegenTypes` and its transitive dependencies to Flow strict to unblock this mode in Native Modules and Native Components.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D25540629

fbshipit-source-id: 7bed2ee58af7a789b50932734c7a86cf1719e2c5
2021-01-04 03:56:57 -08:00
simek ad2f98df8f mark 'force' as optional property of PressEvent object (#29006)
Summary:
Refs:
* https://github.com/facebook/react-native/blob/master/React/Fabric/RCTSurfaceTouchHandler.mm#L93
* https://github.com/facebook/react-native/blob/master/RNTester/js/examples/Pressable/PressableExample.js#L25

According to the current implementation `force` will be returned only on `iOS` platform, only on the devices which have a hardware 3D touch capabilities.

## 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] [Fixed] - mark `force` as an optional property of the PressEvent object
Pull Request resolved: https://github.com/facebook/react-native/pull/29006

Test Plan: Go CI!

Reviewed By: cpojer

Differential Revision: D21797241

Pulled By: TheSavior

fbshipit-source-id: e66be6958a2251bc8585e87e6bad54484a067949
2020-05-29 17:36:59 -07:00
Eli White 960a4767be Prepare event.target to be a HostComponent
Summary:
We are going to be switching event target and current target from being a reactTag to being a host instance.

This doesn't actually change what the actual type of this key is, but is split out like this to make diffs smaller and easier to review. Actual behavior changes will be coming and tested in a future diff.

These are the only callsites I found that use target outside of the React renderers.

The other approach this change could take would be to make all the downstream callsites take both a tag or a HostComponent. That felt too difficult to do at the same time so I'm instead introducing these `findNodeHandle` calls temporarily.

The main thing we need to do is be able to change the callsites in the renderer to start sending the instance. Once everything is passing the instance instead of the tag then we can clean all these up cleanly.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D18384435

fbshipit-source-id: b3a7e6a2778cb7dd9cdfe451cf869cd99641b167
2019-11-08 17:33:35 -08:00
Eli White 74f567ba3c Prepare `currentTarget` to accept number or host component
Summary:
We are going to be switching event target and current target from being a reactTag to being a host instance.

This doesn't actually change what the actual type of this key is, but is split out like this to make diffs smaller and easier to review. Actual behavior changes will be coming and tested in a future diff.

These are the only callsites I found that use `currentTarget` outside of the React renderers.

Changelog:
[Internal]

Reviewed By: zackargyle, yungsters

Differential Revision: D18382470

fbshipit-source-id: 23add5498b38dc109b154479826f701c8a1920b9
2019-11-08 17:33:35 -08:00
Tim Yung 95158ec692 RN: Export Focus / Blur / Mouse Events
Summary:
Exports these events in a canonical manner so that they can be used in future refactors.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D18257693

fbshipit-source-id: aac40277df8a88224c8df29caa04ffc9a6db0a22
2019-10-31 23:44:53 -07:00
Rick Hanlon 5b7be95a1d Use generated view config for iOS Switch
Summary:
Adds a generated view config for iOS Switch

Note: this required some refactoring because the SwitchNativeComponent file included both iOS and android componets, so I broke them out into:

- AndroidSwitchNativeComponent (not generated)
- SwitchNativeComponent (generated)

The schema that we're using is for the  iOS version so that's the config that's generated here

Reviewed By: cpojer

Differential Revision: D15495402

fbshipit-source-id: 07b3bc9c780cbf8f6cbf66e976e15981cefcadfa
2019-06-10 03:34:13 -07:00
Michał Pierzchała fe533a482d Flow strict ScrollView; get rid of InternalScrollViewType (#22301)
Summary:
Relates to #22100.

I left 2 `$FlowFixMe`s as I was not sure how to handle generic `React.Element<>` and which native props can I pass to ScrollView (would be cool to document it once we got proper types there).

I also got rid of `InternalScrollViewType` because we have better typings in original `ScrollView` now.
Pull Request resolved: https://github.com/facebook/react-native/pull/22301

Reviewed By: TheSavior

Differential Revision: D13103990

Pulled By: RSNara

fbshipit-source-id: 9664ee9d7f570b00992215e10901e5317f24fe5c
2019-03-08 11:39:41 -08:00
Ramanpreet Nara f40e744b64 Fix internal flow problems
Summary: D10013265 introduces flow types for `PanResponder`. This diff fixes the facebook-internal flow errors that surface as a result.

Reviewed By: TheSavior

Differential Revision: D10035046

fbshipit-source-id: fbba3d61e68851dda2da4f8e98238e0fdb35a27e
2018-09-27 14:18:31 -07:00
empyrical 3f79b2a4e9 Add flow types to PanResponder (#21291)
Summary:
This PR adds flow types to the `PanResponder` module. It is part of my effort to flowtype the `Swipable*` classes.

A new `touchHistory` field had to be added to `SyntheticEvent` as well.
Pull Request resolved: https://github.com/facebook/react-native/pull/21291

Reviewed By: TheSavior

Differential Revision: D10013265

Pulled By: RSNara

fbshipit-source-id: 3cd65a0eae41c756d1605e6771588d820f040e2a
2018-09-27 14:18:30 -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
Kody Greenbaum 159adfb826 Adding Missing Optional Fields to ScrollEvent Type
Summary: Adding Velocity and targetContentOffset Fields to Scroll Event Type

Reviewed By: yungsters

Differential Revision: D9731754

fbshipit-source-id: e4ad89d66d0bb4344c717cf2d94027c54d346375
2018-09-11 10:22:39 -07:00
Emily Janzer 1736be5811 Add onTextLayout to TextProps
Summary: Splitting this into a separate diff for OSS

Reviewed By: yungsters

Differential Revision: D9551085

fbshipit-source-id: 8ca08351c6b89cd0011aab3c47ef6cc28b763450
2018-08-30 09:33:05 -07:00
Tim Yung 965adee109 RN: Revamp Switch Component
Summary:
Revamps the Switch API with the goal of increasing the pit of success:

- Introduce `trackColor` which encourages callers configuring the color to set colors for both cases.
- Introduce `ios_backgroundColor` which allows customizing the iOS-only background fill color.
- Deprecate `tintColor` because it is not obvious that this is for the `false` case.
- Deprecate `onTintColor` because the prop is named unconventionally like a callback.
- Renamed `thumbTintColor` to `thumbColor`.

This revision also cleans up the `Switch` component in the following ways:

- More precise Flow types for native components.
- Inline iOS-specific style (so that the code gets stripped on Android).
- Minor documentaiton cleanup.

After this commit, all deprecated props will continue working.

Next, I plan to introduce warnings.

Eventually (e.g. in a couple releases), we can drop support for the deprecated props.

Reviewed By: TheSavior

Differential Revision: D9081343

fbshipit-source-id: c5eb949047dd7a0ffa72621839999d38e58cada8
2018-07-31 21:01:41 -07:00
Eli White eea4842972 Flow strictify possible files in RN core
Summary:
This was done by running the command on: https://our.intern.facebook.com/intern/wiki/Flow_Strict/

```
ag -L --ignore __snapshots__ 'flow strict$|noflow|generated|partially-generated' | 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 --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done
```

Reviewed By: sahrens

Differential Revision: D8530207

fbshipit-source-id: c28c7ac5ed3e9b80f3d126d5f30463be8a8a744d
2018-06-20 00:47:21 -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
Tim Yung 80c18395e2 RN: Flow Type for `PressEvent`
Reviewed By: sahrens

Differential Revision: D7082716

fbshipit-source-id: 13e1730b0b2380ae6be63e2b36bb40b9a44a99f4
2018-02-25 23:27:00 -08:00
Tim Yung a817c64043 RN: Use `$ReadOnly` in CoreEventTypes
Reviewed By: sahrens

Differential Revision: D7082715

fbshipit-source-id: d2f7e280d02bbd8e7dcba2d38b719fa4f82ecb8b
2018-02-25 23:27: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
Spencer Ahrens e485cde187 use scrollview for lightbox on ios
Reviewed By: wwalser

Differential Revision: D6858376

fbshipit-source-id: a9ff9c71cb4ad56a4f5af73a4e86de52ddf75700
2018-02-01 12:13:07 -08:00
Tim Yung 83ed9d170b RN: Create SyntheticEvent and ScrollEvent Types
Reviewed By: sahrens

Differential Revision: D6720478

fbshipit-source-id: b542bd50db7cd7085aecce8b986c6922bfb24a43
2018-01-14 10:46:20 -08:00
Spencer Ahrens 350377f57c Tweak FIGListItem layout
Reviewed By: yungsters

Differential Revision: D6586846

fbshipit-source-id: cf57c4e042868a053da2dfa959cd47c7b9241a24
2017-12-18 18:31:19 -08:00
Spencer Ahrens 6ae0b344e5 Fix FIGTabs SST race
Reviewed By: TheSavior

Differential Revision: D6576053

fbshipit-source-id: d727811f7bfdb5cb9a0da010ee0c225029b18b26
2017-12-16 11:15:47 -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