mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: ## Motivation This rename will fix the following CircleCI build failures: - [test_ios_unit_frameworks](https://circleci.com/gh/facebook/react-native/150473?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link) - [test_ios_detox_frameworks](https://circleci.com/gh/facebook/react-native/150474?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link) ## Investigation We have 4 podspec targets that map to the same header namespace (i.e: `header_dir`) `ReactCommon`: - **New:** `React-perflogger`: Directory is `ReactCommon/preflogger`, and contains `NativeModulePerfLogger.{h,cpp}`. - `React-runtimeexecutor`: Directory is `ReactCommon/runtimeexecutor`, and contains only `RuntimeExecutor.h` - `React-callinvoker`: Directory is `ReactCommon/callinvoker`, and contains only `CallInvoker.h` - `ReactCommon/turbomodule/core`: Directory is `ReactCommon/turbomodule`, and contains C++ files, as well has header files. **The problem:** We couldn't import headers from `React-perflogger` in `ReactCommon/turbomodule/core` files. **The cause:** I'm not entirely sure why, but I was able to discern the following two rules by playing around with the podspecs: 1. If your podspec target has a cpp file, it'll generate a framework when `USE_FRAMEWORKS=1`. 2. Two different frameworks cannot map to the same `module_name` or `header_dir`. (Why? No clue. But something breaks silently when this is the case). So, this is what happened when I landed `React-perflogger` (D21443610): 1. The TurboModules code generates the `ReactCommon` framework that uses the `ReactCommon` header namespace. 2. `React-runtimeexecutor` and `React-callinvoker` also used the `ReactCommon` header namespace. However, neither generate a framework because of Rule 1. 3. When I comitted `React-perflogger`, I introduced a second framework that competed with the `ReactCommon` framework (i.e: TurboModules code) for the `ReactCommon` header namespace. Rule 2 violation. ## Thoughts on renaming - `<perflogger/NativeModulePerfLogger.h>` is too generic, and the `perflogger` namepsace is used internally within FB. - `<react/perflogger/NativeModulePerfLogger.h>` matches our fabric header format, but I'm pretty sure that slashes aren't allowed in `header_dir`: I tested this and it didn't work. IIRC, only alphanumeric and underscore are valid characters for `header_dir` or `module_name`. So, I opted to just use `reactperflogger`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D21598852 fbshipit-source-id: 60da5d0f7758eaf13907a080b7d8756688f40723
145 lines
4.8 KiB
C++
145 lines
4.8 KiB
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#include "NativeModulePerfLogger.h"
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
std::shared_ptr<NativeModulePerfLogger> NativeModulePerfLogger::s_perfLogger =
|
|
nullptr;
|
|
|
|
NativeModulePerfLogger &NativeModulePerfLogger::getInstance() {
|
|
static std::shared_ptr<NativeModulePerfLogger> defaultPerfLogger =
|
|
std::make_shared<NativeModulePerfLogger>();
|
|
return s_perfLogger ? *s_perfLogger : *defaultPerfLogger;
|
|
}
|
|
void NativeModulePerfLogger::setInstance(
|
|
std::shared_ptr<NativeModulePerfLogger> newPerfLogger) {
|
|
s_perfLogger = newPerfLogger;
|
|
}
|
|
|
|
NativeModulePerfLogger::~NativeModulePerfLogger() {}
|
|
|
|
void NativeModulePerfLogger::moduleDataCreateStart(
|
|
const char *moduleName,
|
|
int32_t id) {}
|
|
void NativeModulePerfLogger::moduleDataCreateEnd(
|
|
const char *moduleName,
|
|
int32_t id) {}
|
|
|
|
void NativeModulePerfLogger::moduleCreateStart(
|
|
const char *moduleName,
|
|
int32_t id) {}
|
|
void NativeModulePerfLogger::moduleCreateCacheHit(
|
|
const char *moduleName,
|
|
int32_t id) {}
|
|
void NativeModulePerfLogger::moduleCreateConstructStart(
|
|
const char *moduleName,
|
|
int32_t id) {}
|
|
void NativeModulePerfLogger::moduleCreateConstructEnd(
|
|
const char *moduleName,
|
|
int32_t id) {}
|
|
void NativeModulePerfLogger::moduleCreateSetUpStart(
|
|
const char *moduleName,
|
|
int32_t id) {}
|
|
void NativeModulePerfLogger::moduleCreateSetUpEnd(
|
|
const char *moduleName,
|
|
int32_t id) {}
|
|
void NativeModulePerfLogger::moduleCreateEnd(
|
|
const char *moduleName,
|
|
int32_t id) {}
|
|
void NativeModulePerfLogger::moduleCreateFail(
|
|
const char *moduleName,
|
|
int32_t id) {}
|
|
|
|
void NativeModulePerfLogger::moduleJSRequireBeginningStart(
|
|
const char *moduleName) {}
|
|
void NativeModulePerfLogger::moduleJSRequireBeginningCacheHit(
|
|
const char *moduleName) {}
|
|
void NativeModulePerfLogger::moduleJSRequireBeginningEnd(
|
|
const char *moduleName) {}
|
|
void NativeModulePerfLogger::moduleJSRequireBeginningFail(
|
|
const char *moduleName) {}
|
|
|
|
void NativeModulePerfLogger::moduleJSRequireEndingStart(
|
|
const char *moduleName) {}
|
|
void NativeModulePerfLogger::moduleJSRequireEndingEnd(const char *moduleName) {}
|
|
void NativeModulePerfLogger::moduleJSRequireEndingFail(const char *moduleName) {
|
|
}
|
|
|
|
void NativeModulePerfLogger::syncMethodCallStart(
|
|
const char *moduleName,
|
|
const char *methodName) {}
|
|
void NativeModulePerfLogger::syncMethodCallArgConversionStart(
|
|
const char *moduleName,
|
|
const char *methodName) {}
|
|
void NativeModulePerfLogger::syncMethodCallArgConversionEnd(
|
|
const char *moduleName,
|
|
const char *methodName) {}
|
|
void NativeModulePerfLogger::syncMethodCallExecutionStart(
|
|
const char *moduleName,
|
|
const char *methodName) {}
|
|
void NativeModulePerfLogger::syncMethodCallExecutionEnd(
|
|
const char *moduleName,
|
|
const char *methodName) {}
|
|
void NativeModulePerfLogger::syncMethodCallReturnConversionStart(
|
|
const char *moduleName,
|
|
const char *methodName) {}
|
|
void NativeModulePerfLogger::syncMethodCallReturnConversionEnd(
|
|
const char *moduleName,
|
|
const char *methodName) {}
|
|
void NativeModulePerfLogger::syncMethodCallEnd(
|
|
const char *moduleName,
|
|
const char *methodName) {}
|
|
void NativeModulePerfLogger::syncMethodCallFail(
|
|
const char *moduleName,
|
|
const char *methodName) {}
|
|
|
|
void NativeModulePerfLogger::asyncMethodCallStart(
|
|
const char *moduleName,
|
|
const char *methodName) {}
|
|
void NativeModulePerfLogger::asyncMethodCallArgConversionStart(
|
|
const char *moduleName,
|
|
const char *methodName) {}
|
|
void NativeModulePerfLogger::asyncMethodCallArgConversionEnd(
|
|
const char *moduleName,
|
|
const char *methodName) {}
|
|
void NativeModulePerfLogger::asyncMethodCallDispatch(
|
|
const char *moduleName,
|
|
const char *methodName) {}
|
|
void NativeModulePerfLogger::asyncMethodCallEnd(
|
|
const char *moduleName,
|
|
const char *methodName) {}
|
|
|
|
void NativeModulePerfLogger::asyncMethodCallBatchPreprocessStart() {}
|
|
void NativeModulePerfLogger::asyncMethodCallBatchPreprocessEnd(int batchSize) {}
|
|
|
|
void NativeModulePerfLogger::asyncMethodCallExecutionStart(
|
|
const char *moduleName,
|
|
const char *methodName,
|
|
int32_t id) {}
|
|
void NativeModulePerfLogger::asyncMethodCallExecutionArgConversionStart(
|
|
const char *moduleName,
|
|
const char *methodName,
|
|
int32_t id) {}
|
|
void NativeModulePerfLogger::asyncMethodCallExecutionArgConversionEnd(
|
|
const char *moduleName,
|
|
const char *methodName,
|
|
int32_t id) {}
|
|
void NativeModulePerfLogger::asyncMethodCallExecutionEnd(
|
|
const char *moduleName,
|
|
const char *methodName,
|
|
int32_t id) {}
|
|
void NativeModulePerfLogger::asyncMethodCallExecutionFail(
|
|
const char *moduleName,
|
|
const char *methodName,
|
|
int32_t id) {}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|