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

21138 Коммитов

Автор SHA1 Сообщение Дата
Dustin Shahidehpour 1511bfa028 Do another passthrough of labeling.
Summary:
At this point, I think we are ready to enable validation

Changelog: [INTERNAL]

Differential Revision: D24062829

fbshipit-source-id: c82dcd2c376e5cdeb164451e16b6fb3a666106f4
2020-10-02 08:49:06 -07:00
Dmytro Voronkevych 923b77aef9 Renaming UserFlow methods
Summary: Renaming methods in UserFlow to match other APIs

Reviewed By: swillard13

Differential Revision: D24078270

fbshipit-source-id: c3a65d440e389d7b3c76de7706372265584353c8
2020-10-02 08:09:05 -07:00
Dmytro Voronkevych 2c6d010a50 Adding UserFlow.compleWithFail to RN
Summary: Adding method UserFlow.completeWithFail.

Reviewed By: swillard13

Differential Revision: D24052851

fbshipit-source-id: 1baa30a2d7dfb9ef4e457a74b66fd24e4ffbf21f
2020-10-02 08:09:05 -07:00
Dmytro Voronkevych c4629f7cce UserFlow API for ReactNative
Summary: Creating UserFlow API to track reliability of user interactions

Reviewed By: swillard13

Differential Revision: D23937121

fbshipit-source-id: 83701b8216c9b18c9c3d8c332efa84942ac26ba6
2020-10-02 08:09:05 -07:00
Samuel Susla 54fd41c9f6 Animate Switch value changes
Summary:
Changelog: [internal]

Changing value of Switch should animate except for first rendering of the switch.

Reviewed By: JoshuaGross

Differential Revision: D24046268

fbshipit-source-id: d0b2a1a4837fc8daebce2f0e6d3d82212b490ba4
2020-10-02 05:37:06 -07:00
Lorenzo Sciandra ebf2fb7868 Chore: Upgrade RN CLI to 4.13 (#30085)
Summary:
Small PR to bump the CLI version to latest available pre-cut of branch 0.64, as per usual cc thymikee

*(ignore name of the branch, i typoed the version �‍{emoji:2642})*

## 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
-->

[Internal] [Changed] - Bump CLI in the repo to 4.13, latest available

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

Test Plan: Nothing in particular to test, it's just a chore.

Reviewed By: JoshuaGross, kacieb

Differential Revision: D24068562

Pulled By: cpojer

fbshipit-source-id: 0df662775248aa0e95c77fdd246fadabce10f670
2020-10-01 21:35:04 -07:00
Joshua Gross a78a7166b8 Throw soft-error and continue when removing view from parent with incorrect index
Summary:
iOS Fabric actually ignores the `index` property and just uses parent and child tags to remove the child from a parent. This brings Android slightly closer to iOS: we try to use the index, but if the index is incorrect, we either (1) throw if the child isn't contained in the parent, or (2) find the correct index, and continue.

In debug, this will still crash, so we'll get more signal about why this happens.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D24056375

fbshipit-source-id: 07507cc32ad02505d3271fc95ecb45d080109078
2020-10-01 20:13:58 -07:00
Ramanpreet Nara 3b6b039e85 Make JavaPoet JavaSpec Generator handle NullableTypeAnnotation
Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24030728

fbshipit-source-id: b79f7dfa7304bfddc6333c641eadcaa55c0cb7a0
2020-10-01 19:30:08 -07:00
Ramanpreet Nara 5122e33f4e Make ObjCPP Generator handle NullableTypeAnnotation
Summary:
See title.
Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D24027243

fbshipit-source-id: 4e03a14fd23c1f5f3d282fc14a760d7549cdd6b9
2020-10-01 19:30:08 -07:00
Ramanpreet Nara 6d7e763e85 Make JniCpp Generator handle NullableTypeAnnotation
Summary: Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D24027245

fbshipit-source-id: 73f9e7ec7ccb7627d2df63798a4269c860388dde
2020-10-01 19:30:08 -07:00
Ramanpreet Nara 0a2228ae3f Make JavaSpec Generator handle NullableTypeAnnotation
Summary: Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D24027248

fbshipit-source-id: 7ca0e04e8e2f19cffc9aea3d6db51f86703c06f7
2020-10-01 19:30:08 -07:00
Ramanpreet Nara d9dc9d5d0a Make H Generator handle NullableTypeAnnotation
Summary: Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D24027247

fbshipit-source-id: cc326f5db919de1f6c6b56603f420c87272da918
2020-10-01 19:30:08 -07:00
Ramanpreet Nara 1a90e1b471 Make Cpp Generator handle NullableTypeAnnotation
Summary:
See title.
Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D24027244

fbshipit-source-id: 4f967a7a72afd6aa7a886c16eeb683c52da2dc9c
2020-10-01 19:30:07 -07:00
Ramanpreet Nara 6fe06ca160 Update generator fixtures to use NullableTypeAnnotation
Summary:
This will make sure that the snapshot tests for the generators work with NullableTypeAnnotation.
Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D24027246

fbshipit-source-id: cee93e40be7585ec527087d114f8326c2ecb9ddd
2020-10-01 19:30:07 -07:00
Ramanpreet Nara 8d807dfbc3 Introduce NullableTypeAnnotation for Flow Module Parser
Summary:
Previously, all our type annotations contained a `nullable` property. This diff removes that property from all our NativeModule type annotations, and instead introduces a `NullableTypeAnnotation`.

**Some Benefits:**
- In all our serialization functions, we use Flow exhaustive checking to ensure that all type-annotations can be serialized. Since nullability is now recorded as a type annotation, Flow will ensure we always explicitly handle nullability. Previously, with nullability as a property, we could ignore it without any feedback from flow.
- This aligns the NativeModule schema with the ESTree spec.
- After this diff, we're one step closer to sharing type annotations with Codegen's schema. Many NativeModule type annotations now have the same shape as their Codegen counterparts. They will be merged in a subsequent diff.

**Downsides:**
- If you want to check whether a type annotation is of type `T`, you have to remember to unwrap the type annotation *yourself*. Flow won't warn you if you forget to unwrap the type, which can lead to incomplete handling to nullable types in our generators.
- When you're creating type annotations in code, previously, you *had* to specify nullability, since it was a property on all type annotation objects. Now, it's very possible for you to forget to wrap the type annotation, which will just lead to nullability bugs.

**Notes:**
- In the scheam, exported type annotations are *always* required. They can be made nullable using the new `Nullable` genric type.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24026887

fbshipit-source-id: 9e71e2c6102dc506824403dbb712488ca8507d08
2020-10-01 19:30:07 -07:00
Ramanpreet Nara 0a2e0f777b Make Flow Parser snapshots more readable
Summary:
The Flow Parser's snapshots, which are serializations of the CodegenSchema object, are extremely difficult to read. In this diff, I explicitly serialized the schema objects using Node's `util.inspect`.

**Benefits:**
- The snapshots are more readable now.
- You can copy-paste the objects from the snapshot files directly into the Chrome console, or into other JavaScript files. This is a very useful feature, when we're testing the generators, or other infra that depends on the codegen.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D24063112

fbshipit-source-id: 2c6ec3424aac8bab2688dc6ae286b73f90e4bef1
2020-10-01 19:30:07 -07:00
Emily Janzer 5a1ca38305 Add ReactMarker::logTaggedMarkerWithInstanceKey
Summary:
Adding another method to ReactMarker to log a marker with both a tag and an instanceKey. The instanceKey is used to attach the event to the correct marker instance - this is used already in Java, but not in C++ yet.

The way that ReactMarker is currently set up makes this change a little more complex/confusing. For some reason I'm not totally clear on, we're using C-style exports with some platforms-specific ifdefs in ReactMarker.h (even though the impl is .cpp?). And we swap out the implementation for `logTaggedMarker` at runtime in platform-specific code (JReactMarker and RCTCxxBridge).

In this diff, I just add a new function alongside `logTaggedMarker`, `logTaggedMarkerWithInstanceKey`. I did it this way because I figured modifying `logTaggedMarker` to add an argument would be a breaking change.

Reviewed By: PeteTheHeat

Differential Revision: D23831533

fbshipit-source-id: f5b3eba1f43a80f7723fdb64cfc0a792548db2ba
2020-10-01 14:16:32 -07:00
Valentin Shergin e853722981 A couple of checks for corner cases in RCTGetDimensions and RCTExportedDimensions
Summary: We need this checks to make the results of those function more reliable.

Reviewed By: sammy-SC

Differential Revision: D24038911

fbshipit-source-id: 3b54fe3056c9508cde84ea157beebea57e7e49b6
2020-10-01 13:19:52 -07:00
Samuel Susla 9a2a4ba579 Remove handling of view commands for Fabric
Summary:
Changelog: [internal]

This code was put in when we didn't have view commands implementation in Fabric. Now we do so let's get rid of it.

Reviewed By: JoshuaGross

Differential Revision: D24046269

fbshipit-source-id: d0f203bc09bf22f5307cb1844d14b295fe3550dd
2020-10-01 12:25:59 -07:00
Samuel Susla b2c022ec54 Prevent Fabric from changing props if they are managed by Animated
Summary:
Changelog: [internal]

# Problem

Fabric doesn't know when NativeAnimatedModule control a prop and overrides its change whenever any prop changes. For example component A is animating its opacity from 1 to 0. NativeAnimatedModule starts calling `[RCTViewComponentView updateProps:oldProps:]` method interpolating opacity from 1 to 0.

After it is finished, if any prop is updated on the component. Its opacity will be set to default.

# Fix

This is a temporary problem until Unified Animation System is put in place. To work around the issue for now, we keep a set of prop keys controlled by animated and only update the prop if it isn't in this list. List is cleared when the component is reused.

Reviewed By: JoshuaGross

Differential Revision: D24046848

fbshipit-source-id: 63cca6854f97b2de764cb3ed505d328323c64525
2020-10-01 12:18:31 -07:00
Valentin Shergin 61cfa97067 Breaking a retain cycle between `RCTSurfaceTouchHandler` and `RCTFabricSurface` (another approach)
Summary:
This is a different approach to break the retain cycle: instead of detaching a view manually, we store a pointer to a view weakly.

I am working on some change that will make possible (and make use of it) to call `start` and `stop` on Surface objects mutiple times, so to make it happens we need to remove detaching from `stop` method.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D24041524

fbshipit-source-id: 700b13d715d2eb84d52bf3e51e0fd2896a55baf8
2020-10-01 09:38:28 -07:00
Valentin Shergin 16afda2282 Fabric: Making `RCTFabricSurface` to hold a `RCTSurfacePresenter` weakly
Summary:
With this change a RCTFabricSurface instance will not longer to hold a `RCTSurfacePresenter`. This change will enforce the guarantee that retaining a `RCTFabricSurface` is not enough for the service to run (something also should retain a `RCTSurfacePresenter`).

For now it's a very small fix that should not anything, but this is a crusial part of some changes I am working on (one aspect of which implied calling unregistration in a `RCTFabricSurface`'s destructor). I need to decouple this part to test this change earlier and decouple this part of the complexity from the future diffs.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D24039581

fbshipit-source-id: c289ae057f0cd5b438f0aa9a1eb8577e1e00b39c
2020-10-01 09:38:28 -07:00
Lulu Wu edbe154a30 Passing JS callback as a parameter in registerSegment
Summary: Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D24000338

fbshipit-source-id: 65d901f6d2bf51a150bce6871517d0a30ab9f821
2020-10-01 06:58:51 -07:00
Mike Vitousek 8f5f3d159b Add Flow annotations to escaped generics in xplat
Summary:
Flow will soon stop allowing generic types to "escape" out of the scope in which they were defined. The fix will be to add annotations to currently-unannotated variables, parameters, and function returns, so that generics don't become inputs to type inference for those positions. This diff adds new type annotations to xplat where possible to minimize the impact of this change.

This diff was generated by running
```
buck run //flow/src/facebook/komodo/binaries:annotate_escaped_generics -- --write ../../xplat/js
```
from within the flow directory, and then reverting changes that led to new errors. Most changes were reverted by running:
```
facebook/flowd check --json --json-version=2 ../../xplat/js &> post-json
jq -f j.jq < post-json | xargs hg revert
```
where `j.jq` is
```
def locs: [.primaryLoc.source, (select(.rootLoc.source != null) | .rootLoc.source), .referenceLocs[].source ] | unique;
[.errors[] | locs[]] | unique | .[]
```

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D24006427

fbshipit-source-id: 0cd6ec8a9611d8b1e9b14c54f9fffd2d7de2fd9e
2020-10-01 06:19:39 -07:00
Joshua Gross 030d2c1931 Fix TextInput crash in non-Fabric
Summary:
This is a check to execute code only in Fabric, and... it's just wrong. This object is *always* present, for Fabric and non-Fabric. We instead need to check if there's actually a state object, as other parts of the code check for.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D24042677

fbshipit-source-id: 5cf6ebc8f07987d917fdf11042d1715876fa8229
2020-10-01 04:51:06 -07:00
Sam Goldman dd35bf534c Deploy Flow v0.135.0
Summary: Changelog: [Internal]

Reviewed By: mroch

Differential Revision: D24040584

fbshipit-source-id: 106caa00cadd6930685c0030ad74685c64572ba9
2020-09-30 23:33:59 -07:00
Joshua Gross 8b7fd37b42 Log View hierarchy if removeViewAt crashes
Summary:
If removeViewAt crashes, log the children of the parent view, and all of the parent's ancestors.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D24019515

fbshipit-source-id: c5b1ca0948ebc47f2648e161770affa8542ca5dd
2020-09-30 22:40:26 -07:00
Frieder Bluemle 553fb8b28d Update Android Gradle plugin to 4.0.1 (#29013)
Summary:
This is a major version update that needs to be tested thoroughly.

Android Studio 4.0.1 is now available in the stable channel

https://androidstudio.googleblog.com/2020/05/android-studio-40-available-in-stable.html
https://developer.android.com/studio/releases/gradle-plugin#4.0.1

## Changelog

[Android] [Changed] - Update Android Gradle plugin to 4.0.1

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

Test Plan:
Build project

Closes https://github.com/facebook/react-native/issues/29044

Reviewed By: shergin

Differential Revision: D24041233

Pulled By: fkgozali

fbshipit-source-id: 68ef0f313aa773866e65796e323ed0f19f41f834
2020-09-30 22:16:54 -07:00
Valentin Shergin c42183817d Fixed incorrect assert in RCTScrollViewComponentView
Summary:
This diff removes an incorrect assert and replaces it with a debug-only verification phase that compares "what we want" with "what we get".

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: PeteTheHeat

Differential Revision: D23983123

fbshipit-source-id: 03a628b4f8baa1f5fe4b55354b7c943e38b5e537
2020-09-30 19:24:18 -07:00
Kevin Gozali 18f7abae07 Android: removed Robolectric 4.3.1 Buck configuration
Summary:
It was recently upgraded to 4.4, so we don't need the 4.3.1 anymore.

Changelog: [Android][Removed] Removed Robolectric 4.3.1 setup

Reviewed By: jselbo

Differential Revision: D24030822

fbshipit-source-id: 09b3c577d32028723e7bbc02f13459a7ae69b749
2020-09-30 17:08:10 -07:00
simek 8a31dfe567 chore: update RNTester example link in PanResponder comment (#30051)
Summary:
This PR fixes a small leftover after the RNTester migration to the monorepo package - an invalid link in the `PanResponder` comment.

Refs:
* https://github.com/facebook/react-native/issues/29567
* facebook/react-native-website#2177 (the similar correction was a part of merged PR in the RN docs)

## 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
-->

[Internal][Fixed] PanResponder: correct example link in comment

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

Test Plan: N/A

Reviewed By: fkgozali

Differential Revision: D24025065

Pulled By: hramos

fbshipit-source-id: 190486e458fb8e83a35fa2d3c62f4483f3a4334d
2020-09-30 14:36:59 -07:00
Héctor Ramos 7054e58de4 iOS: fix ios-configure-glog.sh syntax issue
Summary:
A `cat` to file was removed accidentally, preventing the configuration script from executing successfully as part of a `pod install`.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24024824

fbshipit-source-id: 94af0c6e663320bfac04ee8f6fb37bd4bdc379a4
2020-09-30 13:27:02 -07:00
Riley Dulin 8c77f7060c Remove idx package from inspector msggen
Summary:
This was causing a crash in babel:
```
$ babel src --out-dir bin --source-maps
Error: Cannot find module 'babel-plugin-idx' from
'~/fbsource/xplat/js/react-native-github/ReactCommon/hermes/inspector/tools/msggen'
- If you want to resolve "idx", use "module:idx" {
  code: 'MODULE_NOT_FOUND'
}
```
It didn't appear that this module was used, so I deleted it.

Changelog: [Internal]

Reviewed By: neildhar

Differential Revision: D23993272

fbshipit-source-id: dd34f0fc652cb27c87c891ca37d0eba66a19a6cf
2020-09-30 12:08:49 -07:00
Samuel Susla 0544568d86 Drop old state updates
Summary:
Changelog: [internal]

Components can update state multiple times before the state update queue is flushed. This causes unnecessary layout/diff and mount passes. To solve this, drop stale state updates inside `stateUpdateQueue_ ` for specific `ShadowNodeFamily`.

Delivering stale status updates is redundant. Let's take SafeAreaView as an example. It schedules 5-6 state updates before `stateUpdateQueue_` is flushed. That's unnecessary work blocking JS thread. We only care about the latest state update. Same for TextInput and other components using state updates.

Reviewed By: JoshuaGross

Differential Revision: D23987707

fbshipit-source-id: 2e3f92cc93af61d78ac564aa40aef165af64b8c1
2020-09-30 08:36:06 -07:00
Joshua Selbo d373a8d88c Fix React Native Robolectric 4.4 deps (#30073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/30073

Changelog: [Android][Added] - Test infra: Robolectric 4.3.1 -> 4.4 upgrade

Reviewed By: fkgozali

Differential Revision: D24009953

fbshipit-source-id: 70549187f4af0abd2ea10f6725eecadbaef7281b
2020-09-29 22:51:46 -07:00
Héctor Ramos c92e767435 TurboModule iOS: Remove module filters
Summary:
These native modules are now filtered downstream in `combine-js-to-schema-cli.js`.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24003572

fbshipit-source-id: d858dbf4a4b6d522ed528f9c2262f37243317160
2020-09-29 21:48:08 -07:00
Joshua Selbo 5bb54c90bd Upgrade Robolectric from 4.3.1 -> 4.4
Summary: Changelog: [Internal]

Reviewed By: jiawei-lyu

Differential Revision: D23718455

fbshipit-source-id: 39c684722db1269e2179cf9680cb728be1171afb
2020-09-29 18:46:06 -07:00
Kevin Gozali 1d89ef87b6 TurboModule: exclude NativeSampleTurboModule in the schema
Summary:
The sample module is meant for demo only, but it lives alongside other core modules in react-native repo.

For now, exclude it in the Flow-type parsing, just like `NativeUIManager.js`

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D24005108

fbshipit-source-id: 9ef524bfe2778dd983c94d1701f9ce49da5e0a68
2020-09-29 18:41:14 -07:00
Kevin Gozali 94b198cfd5 TurboModule Android: install SampleTurboModule and the playground to RNTester
Summary:
This compiles SampleTurboModule into RNTester Android. It also adds the NativeModule playground to show case TurboModule system to RNTester examples, just like in iOS.

{F337854369}

Changelog: [Android][TurboModule] Added TurboModule example to RNTester when `USE_CODEGEN` is set

Reviewed By: hramos

Differential Revision: D24004711

fbshipit-source-id: b682dd51fa998ee2e60f8d6ffd8c39220d13a7fe
2020-09-29 18:41:14 -07:00
Kevin Gozali b9a1ea9e9e TurboModule Android: move SampleTurboModule impl and spec to OSS
Summary:
This is the Java/JNI impl of the NativeSampleTurboModule.js, just like on iOS. The files here are supposed to be generated by the react-native-codegen, but they are checked in to the repo for easier build integration with RNTester.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23985746

fbshipit-source-id: 46340d778f3d964efe5b538d15ebe0f2cab04862
2020-09-29 18:41:14 -07:00
Kevin Gozali b931bd33fe TurboModule Android: properly set up RNTester ndkBuild and cleanup dependencies
Summary:
Before RNTester compilation starts, it needs to wait for :ReactAndroid NDK build to finish, so that it knows where to find the exported .so files. This tells the `preBuild` task to depends on `:ReactAndroid:prepareReactNdkLibs` task. The .so files are now copied over to the local project build dir, instead of depending on :ReactAndroid's build dir.

For cleanup, the reverse ordering is needed: before `clean` removed our temp dir to store the copied .so files, make sure the ndkBuild cleanup tasks execute beforehand.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23982989

fbshipit-source-id: 955d7c9bccb5855b6b066fca89764df2ede89f63
2020-09-29 18:41:14 -07:00
Joshua Gross ca51dc6288 Fix mutation sorting function
Summary:
The sorting function currently forms a partial ordering, not a total ordering. This can cause problems with certain sequences of immediate or conflicting mutations, leading to UI corruption or crashes.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D24002668

fbshipit-source-id: edc9b4c1e3104897cb0c5fd6da563ec43d800494
2020-09-29 16:37:56 -07:00
Tommy Nguyen 521b16730d Align multi-line TextInput onSubmitEditing behavior (#29177)
Summary:
Aligns behavior to be consistent with Android and the [documentation](https://reactnative.dev/docs/textinput#bluronsubmit). `onSubmitEditing` should not be called when `blurOnSubmit=false`.

## Changelog

[iOS] [Fixed] - Align multi-line TextInput onSubmitEditing behavior

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

Test Plan: ![textinput-blur-align](https://user-images.githubusercontent.com/4123478/85121116-85b4b200-b224-11ea-86c5-065e9e6d22ba.gif)

Reviewed By: shergin

Differential Revision: D22488870

Pulled By: hramos

fbshipit-source-id: 2dec3a55da6384389a8358896ef1fbfd806d0304
2020-09-29 15:57:52 -07:00
Ramanpreet Nara 6e6443afd0 Remove header_namespace from module codegen target
Summary:
Making this change because I see this error when compiling Internationalization
```
➜  fbsource buck build //xplat/js/RKJSModules/Libraries/Internationalization:generated_objcpp_modules-InternationalizationApple
buck-out/gen/33fbdb84/xplat/js/RKJSModules/Libraries/Internationalization/generate_module_mm-Internationalization/FBReactNativeInternationalizationSpec-generated.mm:15:9: fatal error: 'FBReactNativeInternationalizationSpec.h' file not found
#import "FBReactNativeInternationalizationSpec.h"
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Command failed with exit code 1.

command: [/Applications/Xcode_11.6.0_fb.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++, @/Users/ramanpreet/fbsource/buck-out/bin/33fbdb84/xplat/js/RKJSModules/Libraries/Internationalization/generated_objcpp_modules-InternationalizationApple#compile-FBReactNativeInternationalizationSpec-generated.mm.o...
```

Since the header namespace is "FBReactNativeInternationalizationSpec", we can only import the header file via "FBReactNativeInternationalizationSpec/FBReactNativeInternationalizationSpec.h", according to this buck documentation: https://buck.build/rule/cxx_library.html#headers. Not entirely sure how this target compiled before.

The legacy codegen buck target also set the header namespace to "": https://fburl.com/diffusion/3p85qhf9.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23978436

fbshipit-source-id: c9cd7c710edf94df6df10778f8603870f92275a7
2020-09-29 14:39:42 -07:00
Ramanpreet Nara 6d6e04619f Fix ObjC++ structs and method mapping
Summary:
Adjust generated ObjC++ code to resolve a few build time and run time errors:

* Suppress CONSTANTS struct implementations
* Use type alias name as struct name when serializing arguments that involve a type alias
* Use actual number of arguments for a method when generating method map.

With these changes in place, RNTester can be built and run using the code that is generated by the new codegen.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23926500

fbshipit-source-id: 88fcbb795fd71dc8155eb26348db943975e13e84
2020-09-29 14:39:41 -07:00
Ramanpreet Nara 97d3e85c29 Fix ObjC++ module generator output
Summary:
* Removed extraneous closing brace.
* Fixed static method signature, replacing double colon with an underscore (`static facebook::jsi::Value __hostFunction_Native${moduleName}SpecJSI::${methodName}()` -> `static facebook::jsi::Value __hostFunction_Native${moduleName}SpecJSI_${methodName}()`).
* Wrap `getConstants` selector name with `selector()`.
* Pass through `getConstants` and `constantsToExport` to allow de-duping of `getConstants` method in generator output.

Note that the FBReactNativeSpec that is output by the generator still has some issues that need to be addressed before it can be used.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23910505

fbshipit-source-id: 37d884885b8878f38d40637377c2a74a728c3a13
2020-09-29 14:39:41 -07:00
Ramanpreet Nara 1b3dc1d9e3 Fix GenerateModuleJniCpp
Summary:
Just updated the generator to work with the new RN Codegen Flow Parser types.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23667253

fbshipit-source-id: ef94e75287d37dfd7b80f61455a1bfa34bddeb28
2020-09-29 14:39:41 -07:00
Ramanpreet Nara cedd628fc3 Fix GenerateModuleJniH
Summary:
Just updated the generator to work with the new RN Codegen Flow Parser types.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D23667250

fbshipit-source-id: f36b5418101c40331964d1f9ede7c6bd7924383d
2020-09-29 14:39:41 -07:00
Ramanpreet Nara 560ac1a9fa Fix GenerateModuleJavaSpec
Summary:
Just updated the generator to work with the new RN Codegen Flow Parser types.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23667255

fbshipit-source-id: 40b7747aad89f6d5bbb9f42d59a4df9633060c66
2020-09-29 14:39:41 -07:00
Ramanpreet Nara 4ab7cc236a Fix GenerateModuleH
Summary:
Just updated the generator to work with the new RN Codegen Flow Parser types.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D23667252

fbshipit-source-id: 34404a478ddd67446d82b5f98e1051300064e95c
2020-09-29 14:39:41 -07:00