From 1c3b3a09b60efc55456ecfe4b79b8cc73d30f739 Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Tue, 1 Aug 2023 07:49:23 -0700 Subject: [PATCH] Add @react-native/babel-plugin-codegen to @react-native/babel-preset (#38227) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38227 X-link: https://github.com/facebook/metro/pull/1023 This diff enables react-native/babel-plugin-codegen to react-native/babel-preset. This will enable static view configs generation for properly schematized native components. Changelog: [General][Changed] - react-native/babel-plugin-codegen to react-native/babel-preset Reviewed By: christophpurrer Differential Revision: D46688516 fbshipit-source-id: ebecc5fd610ca4b86c55355879ad3fd36d51cae9 --- packages/react-native-babel-preset/package.json | 3 ++- packages/react-native-babel-preset/src/configs/main.js | 7 +++++++ packages/react-native/template/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/react-native-babel-preset/package.json b/packages/react-native-babel-preset/package.json index 5eea10e6ab5ff2..57c2eedc65fe42 100644 --- a/packages/react-native-babel-preset/package.json +++ b/packages/react-native-babel-preset/package.json @@ -1,6 +1,6 @@ { "name": "@react-native/babel-preset", - "version": "0.73.15", + "version": "0.73.16", "description": "Babel preset for React Native applications", "main": "src/index.js", "repository": { @@ -51,6 +51,7 @@ "@babel/plugin-transform-typescript": "^7.5.0", "@babel/plugin-transform-unicode-regex": "^7.0.0", "@babel/template": "^7.0.0", + "@react-native/babel-plugin-codegen": "*", "babel-plugin-transform-flow-enums": "^0.0.2", "react-refresh": "^0.4.0" }, diff --git a/packages/react-native-babel-preset/src/configs/main.js b/packages/react-native-babel-preset/src/configs/main.js index 675d51de5f9fbb..5ba10e82590e43 100644 --- a/packages/react-native-babel-preset/src/configs/main.js +++ b/packages/react-native-babel-preset/src/configs/main.js @@ -54,6 +54,13 @@ const getPreset = (src, options) => { ]); } + if ( + !options.disableStaticViewConfigsCodegen && + /\bcodegenNativeComponent