Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refreshing 0.68-stable with upstream #1331

Merged
merged 9 commits into from
Aug 5, 2022

Conversation

mganandraj
Copy link

⚠️ Make sure you are targeting microsoft/react-native-macos for your PR ⚠️

(then delete these lines)

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

Brining newer commits from upstream and making the fixes to patches

Changelog

Brining newer commits from upstream and making the fixes to patches

[CATEGORY] [TYPE] - Message

Test Plan

Made sure the code is building

cortinico and others added 7 commits July 27, 2022 16:18
Summary:
Currently `react-native-codegen` uses `prepublish` to pre-build before publishing. Moving to `prepare` as `prepublish` is deprecated and not invoked anymore:
https://docs.npmjs.com/cli/v8/using-npm/scripts#life-cycle-scripts

## Changelog

[Internal][Fixed] - [codegen] Update script from prepublish (deprecated) to prepack

Pull Request resolved: facebook#34198

Test Plan:
Tested locally with:

```
cd packages/react-native-codegen/ && rm -rf lib && npm publish --dry-run --foreground-scripts
```

output is:

```

> react-native-codegen@0.70.1 prepare
> yarn run build

yarn run v1.22.18
$ yarn clean && node scripts/build.js --verbose
$ rm -rf lib
react-native-codegen...........................................................  • src/__tests__/__snapshots__/SchemaValidator-test.js.snap (ignore)
  • src/__tests__/SchemaValidator-test.js (ignore)
  • src/cli/combine/combine-js-to-schema-cli.js ⇒ lib/cli/combine/combine-js-to-schema-cli.js
  • src/cli/combine/combine-js-to-schema.js ⇒ lib/cli/combine/combine-js-to-schema.js
  • src/cli/generators/generate-all.js ⇒ lib/cli/generators/generate-all.js
  • src/cli/parser/parser-cli.js ⇒ lib/cli/parser/parser-cli.js
  • src/cli/parser/parser.js ⇒ lib/cli/parser/parser.js
  • src/cli/parser/parser.sh ⇒ lib/cli/parser/parser.sh (copy)
  • src/CodegenSchema.js ⇒ lib/CodegenSchema.js
  • src/generators/__test_fixtures__/fixtures.js ⇒ lib/generators/__test_fixtures__/fixtures.js
  • src/generators/__tests__/RNCodegen-test.js (ignore)
  • src/generators/components/__test_fixtures__/fixtures.js ⇒ lib/generators/components/__test_fixtures__/fixtures.js
  • src/generators/components/__tests__/__snapshots__/GenerateComponentDescriptorH-test.js.snap (ignore)
  • src/generators/components/__tests__/__snapshots__/GenerateComponentHObjCpp-test.js.snap (ignore)
  • src/generators/components/__tests__/__snapshots__/GenerateEventEmitterCpp-test.js.snap (ignore)
  • src/generators/components/__tests__/__snapshots__/GenerateEventEmitterH-test.js.snap (ignore)
  • src/generators/components/__tests__/__snapshots__/GeneratePropsCpp-test.js.snap (ignore)
  • src/generators/components/__tests__/__snapshots__/GeneratePropsH-test.js.snap (ignore)
  • src/generators/components/__tests__/__snapshots__/GeneratePropsJavaDelegate-test.js.snap (ignore)
  • src/generators/components/__tests__/__snapshots__/GeneratePropsJavaInterface-test.js.snap (ignore)
  • src/generators/components/__tests__/__snapshots__/GeneratePropsJavaPojo-test.js.snap (ignore)
  • src/generators/components/__tests__/__snapshots__/GenerateShadowNodeCpp-test.js.snap (ignore)
  • src/generators/components/__tests__/__snapshots__/GenerateShadowNodeH-test.js.snap (ignore)
  • src/generators/components/__tests__/__snapshots__/GenerateTests-test.js.snap (ignore)
  • src/generators/components/__tests__/__snapshots__/GenerateThirdPartyFabricComponentsProviderH-test.js.snap (ignore)
  • src/generators/components/__tests__/__snapshots__/GenerateThirdPartyFabricComponentsProviderObjCpp-test.js.snap (ignore)
  • src/generators/components/__tests__/__snapshots__/GenerateViewConfigJs-test.js.snap (ignore)
  • src/generators/components/__tests__/GenerateComponentDescriptorH-test.js (ignore)
  • src/generators/components/__tests__/GenerateComponentHObjCpp-test.js (ignore)
  • src/generators/components/__tests__/GenerateEventEmitterCpp-test.js (ignore)
  • src/generators/components/__tests__/GenerateEventEmitterH-test.js (ignore)
  • src/generators/components/__tests__/GeneratePropsCpp-test.js (ignore)
  • src/generators/components/__tests__/GeneratePropsH-test.js (ignore)
  • src/generators/components/__tests__/GeneratePropsJavaDelegate-test.js (ignore)
  • src/generators/components/__tests__/GeneratePropsJavaInterface-test.js (ignore)
  • src/generators/components/__tests__/GeneratePropsJavaPojo-test.js (ignore)
  • src/generators/components/__tests__/GenerateShadowNodeCpp-test.js (ignore)
  • src/generators/components/__tests__/GenerateShadowNodeH-test.js (ignore)
  • src/generators/components/__tests__/GenerateTests-test.js (ignore)
  • src/generators/components/__tests__/GenerateThirdPartyFabricComponentsProviderH-test.js (ignore)
  • src/generators/components/__tests__/GenerateThirdPartyFabricComponentsProviderObjCpp-test.js (ignore)
  • src/generators/components/__tests__/GenerateViewConfigJs-test.js (ignore)
  • src/generators/components/CppHelpers.js ⇒ lib/generators/components/CppHelpers.js
  • src/generators/components/GenerateComponentDescriptorH.js ⇒ lib/generators/components/GenerateComponentDescriptorH.js
  • src/generators/components/GenerateComponentHObjCpp.js ⇒ lib/generators/components/GenerateComponentHObjCpp.js
  • src/generators/components/GenerateEventEmitterCpp.js ⇒ lib/generators/components/GenerateEventEmitterCpp.js
  • src/generators/components/GenerateEventEmitterH.js ⇒ lib/generators/components/GenerateEventEmitterH.js
  • src/generators/components/GeneratePropsCpp.js ⇒ lib/generators/components/GeneratePropsCpp.js
  • src/generators/components/GeneratePropsH.js ⇒ lib/generators/components/GeneratePropsH.js
  • src/generators/components/GeneratePropsJavaDelegate.js ⇒ lib/generators/components/GeneratePropsJavaDelegate.js
  • src/generators/components/GeneratePropsJavaInterface.js ⇒ lib/generators/components/GeneratePropsJavaInterface.js
  • src/generators/components/GeneratePropsJavaPojo/index.js ⇒ lib/generators/components/GeneratePropsJavaPojo/index.js
  • src/generators/components/GeneratePropsJavaPojo/PojoCollector.js ⇒ lib/generators/components/GeneratePropsJavaPojo/PojoCollector.js
  • src/generators/components/GeneratePropsJavaPojo/serializePojo.js ⇒ lib/generators/components/GeneratePropsJavaPojo/serializePojo.js
  • src/generators/components/GenerateShadowNodeCpp.js ⇒ lib/generators/components/GenerateShadowNodeCpp.js
  • src/generators/components/GenerateShadowNodeH.js ⇒ lib/generators/components/GenerateShadowNodeH.js
  • src/generators/components/GenerateTests.js ⇒ lib/generators/components/GenerateTests.js
  • src/generators/components/GenerateThirdPartyFabricComponentsProviderH.js ⇒ lib/generators/components/GenerateThirdPartyFabricComponentsProviderH.js
  • src/generators/components/GenerateThirdPartyFabricComponentsProviderObjCpp.js ⇒ lib/generators/components/GenerateThirdPartyFabricComponentsProviderObjCpp.js
  • src/generators/components/GenerateViewConfigJs.js ⇒ lib/generators/components/GenerateViewConfigJs.js
  • src/generators/components/JavaHelpers.js ⇒ lib/generators/components/JavaHelpers.js
  • src/generators/modules/__test_fixtures__/fixtures.js ⇒ lib/generators/modules/__test_fixtures__/fixtures.js
  • src/generators/modules/__tests__/__snapshots__/GenerateModuleCpp-test.js.snap (ignore)
  • src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap (ignore)
  • src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap (ignore)
  • src/generators/modules/__tests__/__snapshots__/GenerateModuleJavaSpec-test.js.snap (ignore)
  • src/generators/modules/__tests__/__snapshots__/GenerateModuleJniCpp-test.js.snap (ignore)
  • src/generators/modules/__tests__/__snapshots__/GenerateModuleJniH-test.js.snap (ignore)
  • src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap (ignore)
  • src/generators/modules/__tests__/GenerateModuleCpp-test.js (ignore)
  • src/generators/modules/__tests__/GenerateModuleH-test.js (ignore)
  • src/generators/modules/__tests__/GenerateModuleHObjCpp-test.js (ignore)
  • src/generators/modules/__tests__/GenerateModuleJavaSpec-test.js (ignore)
  • src/generators/modules/__tests__/GenerateModuleJniCpp-test.js (ignore)
  • src/generators/modules/__tests__/GenerateModuleJniH-test.js (ignore)
  • src/generators/modules/__tests__/GenerateModuleMm-test.js (ignore)
  • src/generators/modules/GenerateModuleCpp.js ⇒ lib/generators/modules/GenerateModuleCpp.js
  • src/generators/modules/GenerateModuleH.js ⇒ lib/generators/modules/GenerateModuleH.js
  • src/generators/modules/GenerateModuleJavaSpec.js ⇒ lib/generators/modules/GenerateModuleJavaSpec.js
  • src/generators/modules/GenerateModuleJniCpp.js ⇒ lib/generators/modules/GenerateModuleJniCpp.js
  • src/generators/modules/GenerateModuleJniH.js ⇒ lib/generators/modules/GenerateModuleJniH.js
  • src/generators/modules/GenerateModuleObjCpp/header/serializeConstantsStruct.js ⇒ lib/generators/modules/GenerateModuleObjCpp/header/serializeConstantsStruct.js
  • src/generators/modules/GenerateModuleObjCpp/header/serializeRegularStruct.js ⇒ lib/generators/modules/GenerateModuleObjCpp/header/serializeRegularStruct.js
  • src/generators/modules/GenerateModuleObjCpp/header/serializeStruct.js ⇒ lib/generators/modules/GenerateModuleObjCpp/header/serializeStruct.js
  • src/generators/modules/GenerateModuleObjCpp/index.js ⇒ lib/generators/modules/GenerateModuleObjCpp/index.js
  • src/generators/modules/GenerateModuleObjCpp/serializeMethod.js ⇒ lib/generators/modules/GenerateModuleObjCpp/serializeMethod.js
  • src/generators/modules/GenerateModuleObjCpp/source/serializeModule.js ⇒ lib/generators/modules/GenerateModuleObjCpp/source/serializeModule.js
  • src/generators/modules/GenerateModuleObjCpp/StructCollector.js ⇒ lib/generators/modules/GenerateModuleObjCpp/StructCollector.js
  • src/generators/modules/GenerateModuleObjCpp/Utils.js ⇒ lib/generators/modules/GenerateModuleObjCpp/Utils.js
  • src/generators/modules/Utils.js ⇒ lib/generators/modules/Utils.js
  • src/generators/RNCodegen.js ⇒ lib/generators/RNCodegen.js
  • src/generators/Utils.js ⇒ lib/generators/Utils.js
  • src/parsers/flow/components/__test_fixtures__/failures.js ⇒ lib/parsers/flow/components/__test_fixtures__/failures.js
  • src/parsers/flow/components/__test_fixtures__/fixtures.js ⇒ lib/parsers/flow/components/__test_fixtures__/fixtures.js
  • src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap (ignore)
  • src/parsers/flow/components/__tests__/component-parser-test.js (ignore)
  • src/parsers/flow/components/commands.js ⇒ lib/parsers/flow/components/commands.js
  • src/parsers/flow/components/events.js ⇒ lib/parsers/flow/components/events.js
  • src/parsers/flow/components/extends.js ⇒ lib/parsers/flow/components/extends.js
  • src/parsers/flow/components/index.js ⇒ lib/parsers/flow/components/index.js
  • src/parsers/flow/components/options.js ⇒ lib/parsers/flow/components/options.js
  • src/parsers/flow/components/props.js ⇒ lib/parsers/flow/components/props.js
  • src/parsers/flow/components/schema.js ⇒ lib/parsers/flow/components/schema.js
  • src/parsers/flow/errors.js ⇒ lib/parsers/flow/errors.js
  • src/parsers/flow/index.js ⇒ lib/parsers/flow/index.js
  • src/parsers/flow/modules/__test_fixtures__/failures.js ⇒ lib/parsers/flow/modules/__test_fixtures__/failures.js
  • src/parsers/flow/modules/__test_fixtures__/fixtures.js ⇒ lib/parsers/flow/modules/__test_fixtures__/fixtures.js
  • src/parsers/flow/modules/__tests__/__snapshots__/module-parser-snapshot-test.js.snap (ignore)
  • src/parsers/flow/modules/__tests__/module-parser-e2e-test.js (ignore)
  • src/parsers/flow/modules/__tests__/module-parser-snapshot-test.js (ignore)
  • src/parsers/flow/modules/errors.js ⇒ lib/parsers/flow/modules/errors.js
  • src/parsers/flow/modules/index.js ⇒ lib/parsers/flow/modules/index.js
  • src/parsers/flow/modules/schema.js ⇒ lib/parsers/flow/modules/schema.js
  • src/parsers/flow/modules/utils.js ⇒ lib/parsers/flow/modules/utils.js
  • src/parsers/flow/utils.js ⇒ lib/parsers/flow/utils.js
  • src/parsers/schema/index.js ⇒ lib/parsers/schema/index.js
  • src/parsers/typescript/components/__test_fixtures__/failures.js ⇒ lib/parsers/typescript/components/__test_fixtures__/failures.js
  • src/parsers/typescript/components/__test_fixtures__/fixtures.js ⇒ lib/parsers/typescript/components/__test_fixtures__/fixtures.js
  • src/parsers/typescript/components/__tests__/__snapshots__/typescript-component-parser-test.js.snap (ignore)
  • src/parsers/typescript/components/__tests__/typescript-component-parser-test.js (ignore)
  • src/parsers/typescript/components/commands.js ⇒ lib/parsers/typescript/components/commands.js
  • src/parsers/typescript/components/events.js ⇒ lib/parsers/typescript/components/events.js
  • src/parsers/typescript/components/extends.js ⇒ lib/parsers/typescript/components/extends.js
  • src/parsers/typescript/components/index.js ⇒ lib/parsers/typescript/components/index.js
  • src/parsers/typescript/components/options.js ⇒ lib/parsers/typescript/components/options.js
  • src/parsers/typescript/components/props.js ⇒ lib/parsers/typescript/components/props.js
  • src/parsers/typescript/components/schema.js ⇒ lib/parsers/typescript/components/schema.js
  • src/parsers/typescript/errors.js ⇒ lib/parsers/typescript/errors.js
  • src/parsers/typescript/index.js ⇒ lib/parsers/typescript/index.js
  • src/parsers/typescript/modules/__test_fixtures__/failures.js ⇒ lib/parsers/typescript/modules/__test_fixtures__/failures.js
  • src/parsers/typescript/modules/__test_fixtures__/fixtures.js ⇒ lib/parsers/typescript/modules/__test_fixtures__/fixtures.js
  • src/parsers/typescript/modules/__tests__/__snapshots__/typescript-module-parser-snapshot-test.js.snap (ignore)
  • src/parsers/typescript/modules/__tests__/typescript-module-parser-e2e-test.js (ignore)
  • src/parsers/typescript/modules/__tests__/typescript-module-parser-snapshot-test.js (ignore)
  • src/parsers/typescript/modules/errors.js ⇒ lib/parsers/typescript/modules/errors.js
  • src/parsers/typescript/modules/index.js ⇒ lib/parsers/typescript/modules/index.js
  • src/parsers/typescript/modules/schema.js ⇒ lib/parsers/typescript/modules/schema.js
  • src/parsers/typescript/modules/utils.js ⇒ lib/parsers/typescript/modules/utils.js
  • src/parsers/typescript/utils.js ⇒ lib/parsers/typescript/utils.js
  • src/SchemaValidator.js ⇒ lib/SchemaValidator.js
[  OK  ]
✨  Done in 2.27s.
npm notice
npm notice 📦  react-native-codegen@0.70.1
npm notice === Tarball Contents ===
npm notice 383B   README.md
npm notice 3.2kB  lib/cli/combine/combine-js-to-schema-cli.js
npm notice 1.8kB  lib/cli/combine/combine-js-to-schema-cli.js.flow
npm notice 2.5kB  lib/cli/combine/combine-js-to-schema.js
npm notice 1.3kB  lib/cli/combine/combine-js-to-schema.js.flow
npm notice 1.5kB  lib/cli/generators/generate-all.js
npm notice 1.4kB  lib/cli/generators/generate-all.js.flow
npm notice 1.7kB  lib/cli/parser/parser-cli.js
npm notice 386B   lib/cli/parser/parser-cli.js.flow
npm notice 777B   lib/cli/parser/parser.js
npm notice 811B   lib/cli/parser/parser.js.flow
npm notice 483B   lib/cli/parser/parser.sh
npm notice 222B   lib/CodegenSchema.js
npm notice 8.8kB  lib/CodegenSchema.js.flow
npm notice 1.8kB  lib/generators/__test_fixtures__/fixtures.js
npm notice 1.9kB  lib/generators/__test_fixtures__/fixtures.js.flow
npm notice 43.6kB lib/generators/components/__test_fixtures__/fixtures.js
npm notice 44.0kB lib/generators/components/__test_fixtures__/fixtures.js.flow
npm notice 5.7kB  lib/generators/components/CppHelpers.js
npm notice 6.4kB  lib/generators/components/CppHelpers.js.flow
npm notice 2.0kB  lib/generators/components/GenerateComponentDescriptorH.js
npm notice 2.3kB  lib/generators/components/GenerateComponentDescriptorH.js.flow
npm notice 9.3kB  lib/generators/components/GenerateComponentHObjCpp.js
npm notice 10.3kB lib/generators/components/GenerateComponentHObjCpp.js.flow
npm notice 6.3kB  lib/generators/components/GenerateEventEmitterCpp.js
npm notice 7.2kB  lib/generators/components/GenerateEventEmitterCpp.js.flow
npm notice 6.5kB  lib/generators/components/GenerateEventEmitterH.js
npm notice 7.4kB  lib/generators/components/GenerateEventEmitterH.js.flow
npm notice 4.0kB  lib/generators/components/GeneratePropsCpp.js
npm notice 4.3kB  lib/generators/components/GeneratePropsCpp.js.flow
npm notice 23.4kB lib/generators/components/GeneratePropsH.js
npm notice 26.1kB lib/generators/components/GeneratePropsH.js.flow
npm notice 9.4kB  lib/generators/components/GeneratePropsJavaDelegate.js
npm notice 10.0kB lib/generators/components/GeneratePropsJavaDelegate.js.flow
npm notice 7.1kB  lib/generators/components/GeneratePropsJavaInterface.js
npm notice 7.8kB  lib/generators/components/GeneratePropsJavaInterface.js.flow
npm notice 2.0kB  lib/generators/components/GeneratePropsJavaPojo/index.js
npm notice 2.1kB  lib/generators/components/GeneratePropsJavaPojo/index.js.flow
npm notice 4.0kB  lib/generators/components/GeneratePropsJavaPojo/PojoCollector.js
npm notice 4.7kB  lib/generators/components/GeneratePropsJavaPojo/PojoCollector.js.flow
npm notice 7.2kB  lib/generators/components/GeneratePropsJavaPojo/serializePojo.js
npm notice 7.5kB  lib/generators/components/GeneratePropsJavaPojo/serializePojo.js.flow
npm notice 2.0kB  lib/generators/components/GenerateShadowNodeCpp.js
npm notice 2.2kB  lib/generators/components/GenerateShadowNodeCpp.js.flow
npm notice 2.8kB  lib/generators/components/GenerateShadowNodeH.js
npm notice 3.1kB  lib/generators/components/GenerateShadowNodeH.js.flow
npm notice 5.3kB  lib/generators/components/GenerateTests.js
npm notice 5.9kB  lib/generators/components/GenerateTests.js.flow
npm notice 2.5kB  lib/generators/components/GenerateThirdPartyFabricComponentsProviderH.js
npm notice 2.7kB  lib/generators/components/GenerateThirdPartyFabricComponentsProviderH.js.flow
npm notice 2.6kB  lib/generators/components/GenerateThirdPartyFabricComponentsProviderObjCpp.js
npm notice 2.8kB  lib/generators/components/GenerateThirdPartyFabricComponentsProviderObjCpp.js.flow
npm notice 13.4kB lib/generators/components/GenerateViewConfigJs.js
npm notice 14.0kB lib/generators/components/GenerateViewConfigJs.js.flow
npm notice 2.7kB  lib/generators/components/JavaHelpers.js
npm notice 3.2kB  lib/generators/components/JavaHelpers.js.flow
npm notice 47.0kB lib/generators/modules/__test_fixtures__/fixtures.js
npm notice 47.2kB lib/generators/modules/__test_fixtures__/fixtures.js.flow
npm notice 8.4kB  lib/generators/modules/GenerateModuleCpp.js
npm notice 7.3kB  lib/generators/modules/GenerateModuleCpp.js.flow
npm notice 8.5kB  lib/generators/modules/GenerateModuleH.js
npm notice 7.0kB  lib/generators/modules/GenerateModuleH.js.flow
npm notice 16.8kB lib/generators/modules/GenerateModuleJavaSpec.js
npm notice 15.6kB lib/generators/modules/GenerateModuleJavaSpec.js.flow
npm notice 14.9kB lib/generators/modules/GenerateModuleJniCpp.js
npm notice 13.9kB lib/generators/modules/GenerateModuleJniCpp.js.flow
npm notice 4.7kB  lib/generators/modules/GenerateModuleJniH.js
npm notice 4.9kB  lib/generators/modules/GenerateModuleJniH.js.flow
npm notice 9.5kB  lib/generators/modules/GenerateModuleObjCpp/header/serializeConstantsStruct.js
npm notice 7.9kB  lib/generators/modules/GenerateModuleObjCpp/header/serializeConstantsStruct.js.flow
npm notice 9.1kB  lib/generators/modules/GenerateModuleObjCpp/header/serializeRegularStruct.js
npm notice 7.6kB  lib/generators/modules/GenerateModuleObjCpp/header/serializeRegularStruct.js.flow
npm notice 720B   lib/generators/modules/GenerateModuleObjCpp/header/serializeStruct.js
npm notice 836B   lib/generators/modules/GenerateModuleObjCpp/header/serializeStruct.js.flow
npm notice 6.4kB  lib/generators/modules/GenerateModuleObjCpp/index.js
npm notice 6.6kB  lib/generators/modules/GenerateModuleObjCpp/index.js.flow
npm notice 14.6kB lib/generators/modules/GenerateModuleObjCpp/serializeMethod.js
npm notice 13.1kB lib/generators/modules/GenerateModuleObjCpp/serializeMethod.js.flow
npm notice 2.9kB  lib/generators/modules/GenerateModuleObjCpp/source/serializeModule.js
npm notice 3.6kB  lib/generators/modules/GenerateModuleObjCpp/source/serializeModule.js.flow
npm notice 6.8kB  lib/generators/modules/GenerateModuleObjCpp/StructCollector.js
npm notice 5.4kB  lib/generators/modules/GenerateModuleObjCpp/StructCollector.js.flow
npm notice 549B   lib/generators/modules/GenerateModuleObjCpp/Utils.js
npm notice 673B   lib/generators/modules/GenerateModuleObjCpp/Utils.js.flow
npm notice 848B   lib/generators/modules/Utils.js
npm notice 1.3kB  lib/generators/modules/Utils.js.flow
npm notice 7.1kB  lib/generators/RNCodegen.js
npm notice 8.4kB  lib/generators/RNCodegen.js.flow
npm notice 647B   lib/generators/Utils.js
npm notice 700B   lib/generators/Utils.js.flow
npm notice 14.1kB lib/parsers/flow/components/__test_fixtures__/failures.js
npm notice 14.1kB lib/parsers/flow/components/__test_fixtures__/failures.js.flow
npm notice 27.8kB lib/parsers/flow/components/__test_fixtures__/fixtures.js
npm notice 27.9kB lib/parsers/flow/components/__test_fixtures__/fixtures.js.flow
npm notice 2.6kB  lib/parsers/flow/components/commands.js
npm notice 2.9kB  lib/parsers/flow/components/commands.js.flow
npm notice 6.2kB  lib/parsers/flow/components/events.js
npm notice 6.6kB  lib/parsers/flow/components/events.js.flow
npm notice 1.2kB  lib/parsers/flow/components/extends.js
npm notice 1.6kB  lib/parsers/flow/components/extends.js.flow
npm notice 8.1kB  lib/parsers/flow/components/index.js
npm notice 6.5kB  lib/parsers/flow/components/index.js.flow
npm notice 1.8kB  lib/parsers/flow/components/options.js
npm notice 2.1kB  lib/parsers/flow/components/options.js.flow
npm notice 13.1kB lib/parsers/flow/components/props.js
npm notice 13.8kB lib/parsers/flow/components/props.js.flow
npm notice 2.1kB  lib/parsers/flow/components/schema.js
npm notice 1.3kB  lib/parsers/flow/components/schema.js.flow
npm notice 738B   lib/parsers/flow/errors.js
npm notice 849B   lib/parsers/flow/errors.js.flow
npm notice 5.7kB  lib/parsers/flow/index.js
npm notice 3.7kB  lib/parsers/flow/index.js.flow
npm notice 5.3kB  lib/parsers/flow/modules/__test_fixtures__/failures.js
npm notice 5.4kB  lib/parsers/flow/modules/__test_fixtures__/failures.js.flow
npm notice 15.4kB lib/parsers/flow/modules/__test_fixtures__/fixtures.js
npm notice 15.4kB lib/parsers/flow/modules/__test_fixtures__/fixtures.js.flow
npm notice 8.6kB  lib/parsers/flow/modules/errors.js
npm notice 9.5kB  lib/parsers/flow/modules/errors.js.flow
npm notice 25.7kB lib/parsers/flow/modules/index.js
npm notice 21.8kB lib/parsers/flow/modules/index.js.flow
npm notice 416B   lib/parsers/flow/modules/schema.js
npm notice 557B   lib/parsers/flow/modules/schema.js.flow
npm notice 595B   lib/parsers/flow/modules/utils.js
npm notice 830B   lib/parsers/flow/modules/utils.js.flow
npm notice 4.4kB  lib/parsers/flow/utils.js
npm notice 5.1kB  lib/parsers/flow/utils.js.flow
npm notice 428B   lib/parsers/schema/index.js
npm notice 526B   lib/parsers/schema/index.js.flow
npm notice 12.9kB lib/parsers/typescript/components/__test_fixtures__/failures.js
npm notice 13.0kB lib/parsers/typescript/components/__test_fixtures__/failures.js.flow
npm notice 28.1kB lib/parsers/typescript/components/__test_fixtures__/fixtures.js
npm notice 28.1kB lib/parsers/typescript/components/__test_fixtures__/fixtures.js.flow
npm notice 3.1kB  lib/parsers/typescript/components/commands.js
npm notice 3.0kB  lib/parsers/typescript/components/commands.js.flow
npm notice 7.0kB  lib/parsers/typescript/components/events.js
npm notice 7.4kB  lib/parsers/typescript/components/events.js.flow
npm notice 1.3kB  lib/parsers/typescript/components/extends.js
npm notice 1.6kB  lib/parsers/typescript/components/extends.js.flow
npm notice 8.2kB  lib/parsers/typescript/components/index.js
npm notice 6.6kB  lib/parsers/typescript/components/index.js.flow
npm notice 1.8kB  lib/parsers/typescript/components/options.js
npm notice 2.1kB  lib/parsers/typescript/components/options.js.flow
npm notice 19.4kB lib/parsers/typescript/components/props.js
npm notice 18.0kB lib/parsers/typescript/components/props.js.flow
npm notice 2.1kB  lib/parsers/typescript/components/schema.js
npm notice 1.3kB  lib/parsers/typescript/components/schema.js.flow
npm notice 738B   lib/parsers/typescript/errors.js
npm notice 849B   lib/parsers/typescript/errors.js.flow
npm notice 5.8kB  lib/parsers/typescript/index.js
npm notice 3.9kB  lib/parsers/typescript/index.js.flow
npm notice 4.7kB  lib/parsers/typescript/modules/__test_fixtures__/failures.js
npm notice 4.7kB  lib/parsers/typescript/modules/__test_fixtures__/failures.js.flow
npm notice 18.8kB lib/parsers/typescript/modules/__test_fixtures__/fixtures.js
npm notice 18.8kB lib/parsers/typescript/modules/__test_fixtures__/fixtures.js.flow
npm notice 8.6kB  lib/parsers/typescript/modules/errors.js
npm notice 9.5kB  lib/parsers/typescript/modules/errors.js.flow
npm notice 26.8kB lib/parsers/typescript/modules/index.js
npm notice 22.9kB lib/parsers/typescript/modules/index.js.flow
npm notice 416B   lib/parsers/typescript/modules/schema.js
npm notice 557B   lib/parsers/typescript/modules/schema.js.flow
npm notice 595B   lib/parsers/typescript/modules/utils.js
npm notice 830B   lib/parsers/typescript/modules/utils.js.flow
npm notice 4.6kB  lib/parsers/typescript/utils.js
npm notice 5.3kB  lib/parsers/typescript/utils.js.flow
npm notice 1.4kB  lib/SchemaValidator.js
npm notice 1.6kB  lib/SchemaValidator.js.flow
npm notice 1.4kB  package.json
npm notice === Tarball Details ===
npm notice name:          react-native-codegen
npm notice version:       0.70.1
npm notice filename:      react-native-codegen-0.70.1.tgz
npm notice package size:  168.4 kB
npm notice unpacked size: 1.3 MB
npm notice shasum:        10bf591db802342bd5ac38352821ad6452ba4b52
npm notice integrity:     sha512-KXRXARscSO4mt[...]WCnuO5sLFEYQg==
npm notice total files:   167
npm notice
+ react-native-codegen@0.70.1
```

Reviewed By: dmitryrykun

Differential Revision: D37851965

Pulled By: cortinico

fbshipit-source-id: 4d8c80831691e5f671c234bc3a1678ccb7435ff4
…ad of crashing the app in hybrid apps. (facebook#33133)

Summary:
As per commit: facebook@4f3b174 which states that "React Native requires that the RootView id be managed entirely by React Native, and will crash in addRootView/startSurface if the native View id isn't set to NO_ID."

This behaviour can not be guaranteed in **hybrid** apps that have a native android layer over which ReactRootViews are added and the native views need to have ids on them in order to work. **The control of views can jump back and forth between native android and react-native (fabric). As the ReactRootView is added to ViewGroups (or layouts) in Android Fragments and Activities, they contain ids on their views which might get passed down to the reactRootView by features like DataBinding**

Hence this can cause unnecessary crashes at runtime for hybrid apps even when they are not changing the id of the reactRootView object they are adding to their ViewGroups.

Our app is a hybrid app that uses both native android and react-native on different screens and on one such screen that has a Fragment adding a ReactRootView to its FrameLayout to render native android views to render in ReactNative, this crash occurs on pressing the back button as well as on unlocking the screen while staying on the same screen.

The app was running fine on more than a 100 million devices on React Native 0.63.4 but after updating to 0.67.2, that features this commit, it crashes on the very first device it was tested on.

Refer to the issue: facebook#33121 for more information on the crash

The fragment in which this issues arises is like this:

 ```binding.frameLayout.addView(getReactRootView())```

where getReactRootView() is like this:

```
    private var mReactRootView: ReactRootView? = null
    private var mReactInstanceManager: ReactInstanceManager? = null

    mReactRootView = ReactRootView(context)

        if (activity != null) {
            val application = activity?.application
            if (application is MainApplication) {
                mReactInstanceManager = application.reactInstanceManager
            }
        }

      fun getReactRootView():View?{
         return  mReactRootView
      }
```

So converting this to a soft exception such that pure react-native devs can still see the error while hybrid apps continue to run without crashes.

### Snippet of the change:

```
if (getId() != View.NO_ID) {
        ReactSoftExceptionLogger.logSoftException(
            TAG,
            new IllegalViewOperationException(
              "Trying to attach a ReactRootView with an explicit id already set to ["
                  + getId()
                  + "]. React Native uses the id field to track react tags and will overwrite this"
                  + " field. If that is fine, explicitly overwrite the id field to View.NO_ID."));
    }
```

## Changelog

[GENERAL] [ADDED] - A ReactSoftException log instead of a direct exception being thrown:

```
if (getId() != View.NO_ID) {
        ReactSoftExceptionLogger.logSoftException(
            TAG,
            new IllegalViewOperationException(
              "Trying to attach a ReactRootView with an explicit id already set to ["
                  + getId()
                  + "]. React Native uses the id field to track react tags and will overwrite this"
                  + " field. If that is fine, explicitly overwrite the id field to View.NO_ID."));
    }
```

[GENERAL] [REMOVED]- Directly throwing an exception even when the code is not responsible for this issue:

```
if (getId() != View.NO_ID) {
      throw new IllegalViewOperationException(
          "Trying to attach a ReactRootView with an explicit id already set to ["
              + getId()
              + "]. React Native uses the id field to track react tags and will overwrite this"
              + " field. If that is fine, explicitly overwrite the id field to View.NO_ID.");
    }

```

Pull Request resolved: facebook#33133

Test Plan:
This crash is hard to reproduce but when it occurs, this is the only way to fix it.
If any app used to crash with this exact error, it will no longer crash but show an error log in Logcat for developers to be informed about the issue.

Reviewed By: ShikaSD

Differential Revision: D34304212

Pulled By: cortinico

fbshipit-source-id: f0eaeef2e905a6e0587df088b43cc49cabda397a
Summary:
In facebook#32695, the `Performance.now()` implementation changed to use unix epoch timestamps instead of a monotonic clock.

This is problematic, because it means that performance measurements get skewed if the device clock changes between two measurements.

With this change, the clock is now monotonic (and the implementation stays consistent between platforms).

More details and repro steps can be found in [this issue](facebook#33977)
Closes facebook#33977

## Changelog

[General] [Fixed] - Use monotonic clock for performance.now()

Pull Request resolved: facebook#33983

Test Plan:
Run on iOS and Android:
```
const now = global.performance.now()
console.log(`${Platform.OS}: ${now}`)
```

Reviewed By: JoshuaGross, cipolleschi

Differential Revision: D37066999

Pulled By: dmitryrykun

fbshipit-source-id: 298547bf39faea1b025c17ff2d2e1a03f929865b
…hermes to correctly decide which DSO to load at app startup. (facebook#33952)

Summary:
The current implementation of **getDefaultJSExecutorFactory** relies solely on try catch to load the correct .so file for jsc or hermes based on the project configuration.
Relying solely on try catch block and loading jsc even when project is using hermes can lead to launch time crashes especially in monorepo architectures and hybrid apps using both native android and react native.
So we can make use of an additional **ReactInstanceManager :: setJsEngineAsHermes** method that accepts a Boolean argument from the host app while building ReactInstanceManager which can tell which library to load at startup in **ReactInstanceManagerBuilder** which will now have an enhanced getDefaultJSExecutorFactory method that will combine the old logic with the new one to load the dso files.

The code snippet in **ReactInstanceManager** for adding a new setter method:

```
  /**
   * Sets the jsEngine as JSC or HERMES as per the setJsEngineAsHermes call
   * Uses the enum {link JSInterpreter}
   * param jsEngine
   */
  private void setJSEngine(JSInterpreter jsEngine){
    this.jsEngine = jsEngine;
  }

  /**
   * Utility setter to set the required JSEngine as HERMES or JSC
   * Defaults to OLD_LOGIC if not called by the host app
   * param hermesEnabled
   * hermesEnabled = true sets the JS Engine as HERMES and JSC otherwise
   */
  public ReactInstanceManagerBuilder setJsEngineAsHermes(boolean hermesEnabled){
    if(hermesEnabled){
      setJSEngine(JSInterpreter.HERMES);
    }
    else{
      setJSEngine(JSInterpreter.JSC);
    }
    return this;
  }
```

The code snippet for the new logic in **ReactInstanceManagerBuilder**:

1) Setting up the new logic:
Adding a new enum class :
```
  public enum JSInterpreter {
    OLD_LOGIC,
    JSC,
    HERMES
  }
```

A setter getting boolean value telling whether to use hermes or not and calling a private setter to update the enum variable.
```
 /**
   * Sets the jsEngine as JSC or HERMES as per the setJsEngineAsHermes call
   * Uses the enum {link JSInterpreter}
   * param jsEngine
   */
  private void setJSEngine(JSInterpreter jsEngine){
    this.jsEngine = jsEngine;
  }

  /**
   * Utility setter to set the required JSEngine as HERMES or JSC
   * Defaults to OLD_LOGIC if not called by the host app
   * param hermesEnabled
   * hermesEnabled = true sets the JS Engine as HERMES and JSC otherwise
   */
  public ReactInstanceManagerBuilder setJsEngineAsHermes(boolean hermesEnabled){
    if(hermesEnabled){
      setJSEngine(JSInterpreter.HERMES);
    }
    else{
      setJSEngine(JSInterpreter.JSC);
    }
    return this;
  }
```

2) Modifying the getDefaultJSExecutorFactory method to incorporate the new logic with the old one:

```
   private JavaScriptExecutorFactory getDefaultJSExecutorFactory(
    String appName, String deviceName, Context applicationContext) {

    // Relying solely on try catch block and loading jsc even when
    // project is using hermes can lead to launch-time crashes especially in
    // monorepo architectures and hybrid apps using both native android
    // and react native.
    // So we can use the value of enableHermes received by the constructor
    // to decide which library to load at launch

    // if nothing is specified, use old loading method
    // else load the required engine
    if (jsEngine == JSInterpreter.OLD_LOGIC) {
      try {
        // If JSC is included, use it as normal
        initializeSoLoaderIfNecessary(applicationContext);
        JSCExecutor.loadLibrary();
        return new JSCExecutorFactory(appName, deviceName);
      } catch (UnsatisfiedLinkError jscE) {
        if (jscE.getMessage().contains("__cxa_bad_typeid")) {
          throw jscE;
        }
        HermesExecutor.loadLibrary();
        return new HermesExecutorFactory();
      }
    } else if (jsEngine == JSInterpreter.HERMES) {
      HermesExecutor.loadLibrary();
      return new HermesExecutorFactory();
    } else {
      JSCExecutor.loadLibrary();
      return new JSCExecutorFactory(appName, deviceName);
    }
  }
```

### **Suggested changes in any Android App's MainApplication that extends ReactApplication to take advantage of this fix**
```
builder = ReactInstanceManager.builder()
                .setApplication(this)
                .setJsEngineAsHermes(BuildConfig.HERMES_ENABLED)
                .setBundleAssetName("index.android.bundle")
                .setJSMainModulePath("index")
```

where HERMES_ENABLED is a buildConfigField based on the enableHermes flag in build.gradle:

`def enableHermes = project.ext.react.get("enableHermes", true)
`
and then

```
defaultConfig{
if(enableHermes) {
            buildConfigField("boolean", "HERMES_ENABLED", "true")
        }
        else{
            buildConfigField("boolean", "HERMES_ENABLED", "false")
        }
}
```

Our app was facing a similar issue as listed in this list:  **https://github.com/facebook/react-native/issues?q=is%3Aissue+is%3Aopen+DSO**. Which was react-native trying to load jsc even when our project used hermes when a debug build was deployed on a device using android studio play button.

This change can possibly solve many of the issues listed in the list as it solved ours.

## Changelog

[GENERAL] [ADDED] - An enum JSInterpreter  in com.facebook.react package:
```
/**
 * An enum that specifies the JS Engine to be used in the app
 * Old Logic uses the legacy code
 * JSC/HERMES loads the respective engine using the revamped logic
 */
public enum JSInterpreter {
  OLD_LOGIC,
  JSC,
  HERMES
}
```

[GENERAL] [ADDED] - An enum variable storing the default value of Js Engine loading mechanism in ReactInstanceManagerBuilder:

```
   private JSInterpreter  jsEngine = JSInterpreter.OLD_LOGIC;
```

[GENERAL] [ADDED] - A new setter method and a helper method to set the js engine in ReactInstanceManagerBuilder:
```
  /**
   * Sets the jsEngine as JSC or HERMES as per the setJsEngineAsHermes call
   * Uses the enum {link JSInterpreter}
   * param jsEngine
   */
  private void setJSEngine(JSInterpreter jsEngine){
    this.jsEngine = jsEngine;
  }

  /**
   * Utility setter to set the required JSEngine as HERMES or JSC
   * Defaults to OLD_LOGIC if not called by the host app
   * param hermesEnabled
   * hermesEnabled = true sets the JS Engine as HERMES and JSC otherwise
   */
  public ReactInstanceManagerBuilder setJsEngineAsHermes(boolean hermesEnabled){
    if(hermesEnabled){
      setJSEngine(JSInterpreter.HERMES);
    }
    else{
      setJSEngine(JSInterpreter.JSC);
    }
    return this;
  }

```

[GENERAL] [ADDED] - Modified **getDefaultJSExecutorFactory** method

```
private JavaScriptExecutorFactory getDefaultJSExecutorFactory(
    String appName, String deviceName, Context applicationContext) {

    // Relying solely on try catch block and loading jsc even when
    // project is using hermes can lead to launch-time crashes especially in
    // monorepo architectures and hybrid apps using both native android
    // and react native.
    // So we can use the value of enableHermes received by the constructor
    // to decide which library to load at launch

    // if nothing is specified, use old loading method
    // else load the required engine
    if (jsEngine == JSInterpreter.OLD_LOGIC) {
      try {
        // If JSC is included, use it as normal
        initializeSoLoaderIfNecessary(applicationContext);
        JSCExecutor.loadLibrary();
        return new JSCExecutorFactory(appName, deviceName);
      } catch (UnsatisfiedLinkError jscE) {
        if (jscE.getMessage().contains("__cxa_bad_typeid")) {
          throw jscE;
        }
        HermesExecutor.loadLibrary();
        return new HermesExecutorFactory();
      }
    } else if (jsEngine == JSInterpreter.HERMES) {
      HermesExecutor.loadLibrary();
      return new HermesExecutorFactory();
    } else {
      JSCExecutor.loadLibrary();
      return new JSCExecutorFactory(appName, deviceName);
    }
  }
```

Pull Request resolved: facebook#33952

Test Plan:
The testing for this change might be tricky but can be done by following the reproduction steps in the issues related to DSO loading here: https://github.com/facebook/react-native/issues?q=is%3Aissue+is%3Aopen+DSO

Generally, the app will not crash anymore on deploying debug using android studio if we are removing libjsc and its related libraries in **packagingOptions** in build.gradle and using hermes in the project.
It can be like:
```
packagingOptions {
        if (enableHermes) {
            exclude "**/libjsc*.so"
        }
    }
```

Reviewed By: lunaleaps

Differential Revision: D37191981

Pulled By: cortinico

fbshipit-source-id: c528ead126939f1d788af7523f3798ed2a14f36e
@mganandraj mganandraj requested review from a team as code owners August 5, 2022 07:38
@Saadnajmi
Copy link
Collaborator

Saadnajmi commented Aug 5, 2022

Nit: Our PR template has the following in it. Could we please do that so that there aren't giant warning signs?

# :warning: Make sure you are targeting microsoft/react-native-macos for your PR :warning:
(then delete these lines)

@pull-bot
Copy link

pull-bot commented Aug 5, 2022

Fails
🚫

node failed.

Messages
📖

📋 Verify Changelog Format - A changelog entry has the following format: [CATEGORY] [TYPE] - Message.

CATEGORY may be:
  • General
  • macOS
  • iOS
  • Android
  • JavaScript
  • Internal (for changes that do not need to be called out in the release notes)

TYPE may be:

  • Added, for new features.
  • Changed, for changes in existing functionality.
  • Deprecated, for soon-to-be removed features.
  • Removed, for now removed features.
  • Fixed, for any bug fixes.
  • Security, in case of vulnerabilities.

MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.

Log

Error:  RequestError [HttpError]: Must have admin rights to Repository.
    at /root/react-native/bots/node_modules/@octokit/request/dist-node/index.js:86:21
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  status: 403,
  response: {
    url: 'https://api.github.com/repos/microsoft/react-native-macos/issues/1331/labels',
    status: 403,
    headers: {
      'access-control-allow-origin': '*',
      'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
      connection: 'close',
      'content-encoding': 'gzip',
      'content-security-policy': "default-src 'none'",
      'content-type': 'application/json; charset=utf-8',
      date: 'Fri, 05 Aug 2022 11:37:04 GMT',
      'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
      server: 'github.com',
      'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
      'transfer-encoding': 'chunked',
      vary: 'Accept-Encoding, Accept, X-Requested-With',
      'x-accepted-oauth-scopes': '',
      'x-content-type-options': 'nosniff',
      'x-frame-options': 'deny',
      'x-github-media-type': 'github.v3; format=json',
      'x-github-request-id': 'A3AA:7241:1F40B53:391A64F:62ED00E0',
      'x-oauth-scopes': 'public_repo',
      'x-ratelimit-limit': '5000',
      'x-ratelimit-remaining': '4992',
      'x-ratelimit-reset': '1659703022',
      'x-ratelimit-resource': 'core',
      'x-ratelimit-used': '8',
      'x-xss-protection': '0'
    },
    data: {
      message: 'Must have admin rights to Repository.',
      documentation_url: 'https://docs.github.com/rest/reference/issues#add-labels-to-an-issue'
    }
  },
  request: {
    method: 'POST',
    url: 'https://api.github.com/repos/microsoft/react-native-macos/issues/1331/labels',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-rest.js/18.12.0 octokit-core.js/3.5.1 Node.js/14.18.1 (linux; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"labels":["Pick Request"]}',
    request: { hook: [Function: bound bound register] }
  }
}
danger-results://tmp/danger-results.json

Generated by 🚫 dangerJS against 7417cbc

@mganandraj mganandraj enabled auto-merge (squash) August 5, 2022 12:27
@mganandraj mganandraj merged commit 2018af1 into microsoft:0.68-stable Aug 5, 2022
@mganandraj mganandraj deleted the 0.68-stable-refresh branch August 5, 2022 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants