Skip to content

Commit 2321ae1

Browse files
javachefacebook-github-bot
authored andcommitted
Cleanup react-native-codegen DEFS [reland] (#52506)
Summary: Pull Request resolved: #52506 * Re-enable tests * Simplify logic to avoid bypasses for arc focus Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D78000411 fbshipit-source-id: e2960a9848ce27385da00214018e7996d7c27561
1 parent bb0c370 commit 2321ae1

3 files changed

Lines changed: 246 additions & 245 deletions

File tree

packages/react-native-codegen/src/cli/combine/combine-schemas-cli.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ if (!schemaQuery.startsWith('@')) {
5151
const schemaQueryOutputFile = schemaQuery.replace(/^@/, '');
5252
const schemaQueryOutput = fs.readFileSync(schemaQueryOutputFile, 'utf8');
5353

54-
const schemaFiles = schemaQueryOutput.split(' ');
5554
const modules: {
5655
[hasteModuleName: string]: NativeModuleSchema | ComponentSchema,
5756
} = {};
5857
const specNameToFile: {[hasteModuleName: string]: string} = {};
5958

59+
const schemaFiles =
60+
schemaQueryOutput.length > 0 ? schemaQueryOutput.split(' ') : [];
6061
for (const file of schemaFiles) {
6162
const schema: SchemaType = JSON.parse(fs.readFileSync(file, 'utf8'));
6263

packages/react-native-codegen/src/generators/components/GenerateTests.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ const TestTemplate = ({
6565
propValue: string,
6666
}) => `
6767
TEST(${componentName}_${testName}, etc) {
68-
auto propParser = RawPropsParser();
68+
RawPropsParser propParser{};
6969
propParser.prepare<${componentName}>();
70-
auto const &sourceProps = ${componentName}();
71-
auto const &rawProps = RawProps(folly::dynamic::object("${propName}", ${propValue}));
70+
${componentName} sourceProps{};
71+
RawProps rawProps(folly::dynamic::object("${propName}", ${propValue}));
7272
7373
ContextContainer contextContainer{};
7474
PropsParserContext parserContext{-1, contextContainer};
7575
76-
rawProps.parse(propParser, parserContext);
76+
rawProps.parse(propParser);
7777
${componentName}(parserContext, sourceProps, rawProps);
7878
}
7979
`;

0 commit comments

Comments
 (0)