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

24 Коммитов

Автор SHA1 Сообщение Дата
Luna Wei aa8e69b696 ESM processColor
Summary: Changelog: [General][Changed] - ESM processColor

Reviewed By: yungsters

Differential Revision: D42200330

fbshipit-source-id: aac5650ce0b45400400ebee4e8e8b36148539955
2023-01-03 18:09:06 -08:00
George Zahariev 0337a2981d Add annotations to empty objects that look like indexers in Xplat
Summary:
We are working on making the empty object literal `{}` have the type `{}` - i.e. exact empty object - rather than being unsealed.
Making this change exposes a variety of errors. We can prevent these errors by annotating what we want the type of the empty object to be.

Reduces Xplat error diff to 2.3k

- Announcement: [post](https://fb.workplace.com/groups/flowlang/posts/903386663600331)
- Support group: [Flow Support](https://fb.workplace.com/groups/flow)

drop-conflicts

Format:
```
arc f
```
Sort imports
```
hg l -n | xargs js1 lint --fix --rule 'fb-tools/sort-requires'
```

Changelog: [Internal]

Reviewed By: samwgoldman

Differential Revision: D36086696

fbshipit-source-id: 90447279f2e6e38f44189b74ec0297719f7adf58
2022-05-03 19:59:28 -07:00
Ramanpreet Nara 28f5abc717 Fix NVC for RCTSlider
Summary:
## Android Failures
```
LOG  SVC RCTSlider Invalid
 LOG  {
  "missing": {
    "directEventTypes": {
      "topSlidingComplete": {
        "registrationName": "onSlidingComplete"
      }
    }
  },
  "unexpected": {
    "bubblingEventTypes": {
      "paperValueChange": {
        "phasedRegistrationNames": {
          "captured": "onValueChangeCapture",
          "bubbled": "onValueChange"
        }
      },
      "topValueChange": {
        "phasedRegistrationNames": {
          "captured": "onValueChangeCapture",
          "bubbled": "onValueChange"
        }
      }
    },
    "directEventTypes": {
      "paperSlidingComplete": {
        "registrationName": "onSlidingComplete"
      }
    },
    "validAttributes": {
      "disabled": true,
      "maximumTrackImage": {
        "process": "[Function resolveAssetSource]"
      },
      "minimumTrackImage": {
        "process": "[Function resolveAssetSource]"
      },
      "thumbImage": {
        "process": "[Function resolveAssetSource]"
      },
      "trackImage": {
        "process": "[Function resolveAssetSource]"
      }
    }
  },
  "unequal": {}
}
```

## iOS Failures
```
 LOG  SVC RCTSlider Invalid
 LOG  {
  "missing": {},
  "unexpected": {
    "bubblingEventTypes": {
      "paperValueChange": {
        "phasedRegistrationNames": {
          "captured": "onValueChangeCapture",
          "bubbled": "onValueChange"
        }
      }
    },
    "directEventTypes": {
      "paperSlidingComplete": {
        "registrationName": "onSlidingComplete"
      }
    },
    "validAttributes": {
      "enabled": true
    }
  },
  "unequal": []
}
```

Reviewed By: yungsters

Differential Revision: D33409401

fbshipit-source-id: 519b6e35246e6671dbea1f374435d92937d96c1d
2022-01-14 16:31:50 -08:00
Ramanpreet Nara 4ac209ca1d Fix NVC for RCTMap
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33354718

fbshipit-source-id: 76f837a552c043be75933eea018e0db8ee1ae238
2022-01-14 16:31:50 -08:00
Ramanpreet Nara d016766303 Attach "default events" to all ViewConfigs
Summary:
## Context
Default events are only attached to the first-loaded component.

## Problem
This complicates SVC == NVC reconciliation:
- The Static ViewConfigs of all components contain these default events.
- The native ViewConfig of *only the first component that loads* has these default events.

## FAQ
**Question:** If default events were only attached to the first loaded component, how come all components could emit these default events?

In short, if one component declares an event, React Native can dispatch that event to **all** components:
1. The ReactFabric-dev renderer invokes [ReactNativeViewConfigRegistry.get](https://fburl.com/code/468l3zp7) to get the ViewConfig of a component.
2. ReactNativeViewConfigRegistry.get inserts a component's the Bubbling/Direct events into [two **global** maps: ReactNativeViewConfigRegistry.customBubblingEventTypes, ReactNativeViewConfigRegistry.customDirectEventTypes](https://www.internalfb.com/code/fbsource/[00ccc3c7a1b76e55986a6d753b8748327397e5eb]/xplat/js/react-native-github/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js?lines=20-34%2C57-72%2C117).
3. When the ReactFabric-dev renderer needs to dispatch events, it just [does a lookup on these two **global** maps](https://www.internalfb.com/code/fbsource/[2de1e1d59f6e0316868a6c4d9bca5fe673210106]/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.js?lines=2426%2C2439-2440) to create/dispatch the SyntheticEvents.

**Question:** Should we gate these changes?
This change should be safe to land without gating. This diff just creates duplicate entries for bubbling/direct events across components, which should [just get ignored by ReactNativeViewConfigRegistry](https://www.internalfb.com/code/fbsource/[4c57b02a0edccfd8a5fcc3a63ed2dd622efea320]/xplat/js/react-native-github/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js?lines=42%2C57-72%2C117).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33303417

fbshipit-source-id: fa777ca92e57b82eafb94f7d05ef4064ed5060ed
2022-01-04 16:04:16 -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
Ramanpreet Nara 36612a8060 Default {bubbling,direct}EventTypes to {} in Native VCs
Summary:
## Rationale
**Consistency with Static View Configs:** Static view config will default bubblingEventTypes or directEventTypesto to an empty object, if the any of them are undefined.

https://www.internalfb.com/code/fbsource/[a73d46ab4052838e46e0f3aab8508025795aec1f]/xplat/js/react-native-github/Libraries/NativeComponent/ViewConfig.js?lines=20-23%2C26-33%2C41%2C43-50

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D32159393

fbshipit-source-id: fefb3509b9b7c7374d2c3d8962afa5402daf6f72
2021-11-09 00:29:13 -08:00
Ramanpreet Nara d03b4f9ee2 Omit null process/diff functions from native VC attributes
Summary:
## Rationale
- **Consistency with Static View Configs**: In Static View Configs, if there isn't a diff or process function, we do not generate a property for it.
- **Type-safety**: The [Flow type for attributes](https://fburl.com/code/tafncg5c), doesn't allow null diff/process functions.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D32152924

fbshipit-source-id: 4156158c5fe09868feec1a0c55aa411d2bd72a27
2021-11-03 15:58:30 -07:00
Tim Yung f6b8736b09 RN: Update ViewConfig for ScrollView
Summary:
Updates `ReactScrollViewManager` and the `ViewConfig` for `ScrollView` so that they are equivalent.

- `inverted` was missing.
- `contentOffset` was missing differ on Android. (However, there does not seem to be any perceivable behavior difference besides the native `ViewConfig` being different.)

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D25084470

fbshipit-source-id: 8bea3b7a692c1038819a4147b174583a4faa71e9
2020-11-19 02:52:00 -08:00
Valentin Shergin a977ad0071 Removing outdated warning from View Config infra
Summary:
In theory, view configs can be hierarchical (one can depend on another), at least it was semi-supported on iOS once. And AFAIK there is only one component that seems to use this feature - `RCTComponentHostingView`, all other components essentially inherit RCTView or nothing. At the same time, RCTComponentHostingView does not really need it because RCTComponentHostingView itself does not expose any props.

Changelog: [Internal] Removed outdated warning

Reviewed By: kacieb

Differential Revision: D24095348

fbshipit-source-id: 5629c7433f151b72aae8201c58dd42062990b77e
2020-10-04 11:22:40 -07:00
Tim Yung 982272932c RN: Remove `fbjs/warning` Dependency
Summary:
Replaces `fbjs/warning` call sites in React Native with `console.warn`. A few warnings will now log as warnings without the "Warning:" prefix.

Changelog:
[General][Changed] - Some warnings changed to use `console.warn` without the "Warning:" prefix.

Reviewed By: TheSavior, cpojer

Differential Revision: D22445946

fbshipit-source-id: 96b01e1bdee52b89ff3b808bc9d6cd494f6787f5
2020-08-25 14:15:35 -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
Rick Hanlon ebb8caa4df Add handling for ColorArray
Summary: This diff adds support for ColorArrayValue in the flow parser

Reviewed By: cpojer

Differential Revision: D15502923

fbshipit-source-id: 6a906b6d609168378fabeb49d0080de011a34d78
2019-06-03 07:21:20 -07:00
Kevin Gozali 723adad439 Reland "[react-native][PR] [TM] Add spec for UIManager"
Summary: Original commit changeset: dff59dc9c98b

Reviewed By: JoshuaGross

Differential Revision: D15579147

fbshipit-source-id: 77a58d2ab3324e243610c1a4d4ab794a7095b3ee
2019-05-31 12:58:56 -07:00
Petr Nikolaev b0254e8d3c Revert D15551356: [react-native][PR] [TM] Add spec for UIManager
Differential Revision:
D15551356

Original commit changeset: 076c4ce635aa

fbshipit-source-id: dff59dc9c98bc579851091855611ee5d973931d0
2019-05-31 06:36:09 -07:00
Eric Lewis a0879ce49f Add spec for UIManager (#24902)
Summary:
part of #24875. Because some of the methods are rewriteable, I dropped the `+` from the signature, this doesn't feel right to me, but I am not sure if the codegen requires that. If it does, it will probably be better to extend the spec and allow those specific methods to be overriden in a UIManager.js interface. Thoughts on that fkgozali or RSNara?

## Changelog

[General] [Added] - Add TM spec for UIManager
Pull Request resolved: https://github.com/facebook/react-native/pull/24902

Reviewed By: hramos

Differential Revision: D15551356

Pulled By: fkgozali

fbshipit-source-id: 076c4ce635aa7ea41e21cbd67c47ecd562fc320d
2019-05-30 21:05:11 -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
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
Andrew Chen (Eng) 5be0dff433 Avoid view manager class loads (take 2)
Summary:
Second attempt at landing D9930713. Notes about the previous issue is mentioned as an inline comment below.

===========

We are currently iterating through each view manager to get its class name to pass to JS. JS uses this list to define lazy property accesses for each view manager to grab the constants synchronously. This results in each view manager's class loading immediately -- causing a small perf hit.

Let's avoid this view managers list entirely. JS is able to access each view manager directly by calling getConstantsForViewManager(name)

Reviewed By: axe-fb

Differential Revision: D10118711

fbshipit-source-id: 78de8f34db364a64f5ce6af70e3d8691353b0d4d
2018-10-02 14:03:24 -07:00
Andrew Chen (Eng) e082a61324 Revert D9930713: Avoid view manager class loads
Differential Revision:
D9930713

Original commit changeset: 4aa013f8398d

fbshipit-source-id: 1fed02b41fa9d91f54d1a19f710bdb666701a4a0
2018-09-28 15:20:35 -07:00
Andrew Chen (Eng) 95174d4ea8 Avoid view manager class loads
Summary:
We are currently iterating through each view manager to get its class name to pass to JS. JS uses this list to define lazy property accesses for each view manager to grab the constants synchronously. This results in each view manager's class loading immediately -- causing a small perf hit.

Let's avoid this view managers list entirely. JS is able to access each view manager directly by calling getConstantsForViewManager(name)

Reviewed By: TheSavior

Differential Revision: D9930713

fbshipit-source-id: 4aa013f8398d4f51b7eef07937d2977ba1950726
2018-09-27 16:03:24 -07:00
Andrew Chen (Eng) aac7c4d5d2 Refactor UIManager view manager accesses
Summary: Replaced each view manager access with a getViewManager() function call. This will later be used to lazily load view manager classes by allowing java to avoid sending the entire list of view managers to JS.

Reviewed By: QueryConnectionException

Differential Revision: D9695788

fbshipit-source-id: 949858aa2f0b0b00b68e260461ba8f1d085cf07f
2018-09-27 16:03:22 -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 1329d18c6a Require that JS defined Component Attributes match Native ones in dev
Summary: As we move these configs to JS from native, until we have codegen that ensures everything stays up to date, this adds a dev mode check to ensure they are consistent.

Reviewed By: yungsters

Differential Revision: D9475011

fbshipit-source-id: 9d6f7b6c649229cae569d840eda3d5f7b7aa7cb2
2018-08-23 13:01:41 -07:00