react-native-macos/packages
Ramanpreet Nara 9c4eb14213 Pass PerfLogger to ObjCTurboModule constructor
Summary:
Previously, I had logic inside `RCTTurboModuleManager` to attach the `id<RCTTurboModulePerformanceLogger>` to the `ObjCTurboModule` object

```
/**
 * By default, all TurboModules are long-lived.
 * Additionally, if a TurboModule with the name `name` isn't found, then we
 * trigger an assertion failure.
 */
auto turboModule = [strongSelf provideTurboModule:moduleName];

/**
 * TODO(T63718299): Move this setter into the ObjCTurboModule constructor
 */
if (performanceLogger) {
  if (auto objCTurboModule = std::dynamic_pointer_cast<facebook::react::ObjCTurboModule>(turboModule)) {
    objCTurboModule->setRCTTurboModulePerformanceLogger(performanceLogger);
  };
}
```

This diff removes that logic in `RCTTurboModuleManager`, and it also removes `ObjCTurboModule::setRCTTurboModulePerformanceLogger`. Henceforth, we'll instead pass the `id<RCTTurboModulePerformanceLogger>` into `ObjCTurboModule`'s constructor. I've made all the necessary changes to the codegen scripts in this diff as well.

This should also resolve T63903079 by simply eliminating the code that's crashing production FB apps.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D20480971

fbshipit-source-id: c3899981f880aa5d1354b5c3f4018c8fd57c3bae
2020-03-18 11:01:15 -07:00
..
babel-plugin-inline-view-configs Remove ReactNative.NativeComponent from React Native 2020-02-13 15:08:27 -08:00
eslint-config-react-native-community Add URLSearchParams and Headers to eslint globals (#27853) 2020-01-27 02:30:29 -08:00
eslint-plugin-react-native-community Move error-subclass-name lint rule to GitHub 2019-10-09 11:48:07 -07:00
react-native-codegen Pass PerfLogger to ObjCTurboModule constructor 2020-03-18 11:01:15 -07:00