Socket
Socket
Sign inDemoInstall

@react-native/codegen

Package Overview
Dependencies
8
Maintainers
0
Versions
322
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native/codegen


Version published
Maintainers
0
Created

Package description

What is @react-native/codegen?

The @react-native/codegen package is a tool used in the React Native ecosystem to generate native code (Java for Android, Objective-C for iOS) from JavaScript. It is primarily used to bridge custom native modules and components in a React Native application, facilitating the communication between JavaScript and native code. This tool automates the process of creating the necessary boilerplate code for native modules, making the development process more efficient and less error-prone.

What are @react-native/codegen's main functionalities?

Generating Native Modules

This feature allows developers to generate the boilerplate code for native modules by specifying the platform (iOS or Android), the path to a schema file (schema.json) that describes the module, and the output directory. The schema file is a JSON file that outlines the structure and types of the native module's methods and properties.

"npx react-native codegen --platform ios/android --schemaPath ./schema.json --outputDir ./output"

Generating Native Components

Similar to native modules, this feature enables the generation of boilerplate code for native components. The process involves specifying a schema file (componentSchema.json) that describes the component's properties and events, allowing for seamless integration of custom native UI components into React Native applications.

"npx react-native codegen --platform ios/android --schemaPath ./componentSchema.json --outputDir ./output"

Other packages similar to @react-native/codegen

Changelog

Source

v0.75.0-rc.3

Breaking

  • Removed the template from react-native into react-native-community/template (07abfceae1 by @blakef)
  • Update Share.share()'s argument types to be more explicit. (8b53d41a88)
  • Make getContentOriginOffset to know info about if call-site want transform or not (ce588db63f by @realsoelynn)
  • Use hasteModuleName for C++ Turbo Module enums (b7fc5867f2 by @christophpurrer)
  • Use hasteModuleName for C++ Turbo Module structs (07261d0408 by @christophpurrer)
  • Don't support 'float' enums in Turbo Modules (536edf3726 by @christophpurrer)
  • Remove executeAsynchronously and executeSynchronously_CAN_DEADLOCK (8b1a01610c by @philIip)
  • Delete JSIModule (73b4d67a78 by @arushikesarwani94)
  • [Typescript] Transform TouchableHighlight from JS class to ForwardRef component (401f2fbb14 by @retyui)
  • [Typescript] Transform TouchableOpacity from JS class to ForwardRef component (3d00549399 by @retyui)
  • JsErrorHandler: Rename JsErrorHandlingFunc to OnJsError (2e3f2268dc by @RSNara)
  • JsErrorHandler: Rename handleJsError to handleFatalError (c041b9f40f by @RSNara)
  • RN ESLint config no longer runs Prettier during ESLint (727f30bd0b by @gaearon)
  • Remove unused imports (folly/dynamic.h) from ReactPrimitives.h (4fd95b6e02 by @christophpurrer)
  • Make LongLivedObjectCollection::get accept a Runtime reference as parameter. (86a52cc2dc by @fabriziocucci)
  • Make LongLivedObject constructor accept a Runtime reference. (3706bf077e by @fabriziocucci)
  • Native modules using the codegen now throw an error when called with null for optional but not nullable arguments. (67b9628af5 by @rubennorte)
Android specific
  • Removing ReactJsExceptionHandler param from ReactHostImpl() constructor and providing a default private implementation (fe7e7a015f by @alanleedev)
  • Set and require android:supportsRtl="true" for RTL layout (82c6f8a580 by @NickGerleman)
  • Enable flex gap percentage value for RN. (41a14962fc by @realsoelynn)
  • DevSupportManagerFactory.create() changed to take an additional parameter of type PausedInDebuggerOverlayManager (nullable) (1d26907ca4 by @motiz88)
  • Deprecate ReactViewBackgroundDrawable in favor of CSSBackgroundDrawable (d7766fa927 by @NickGerleman)
  • Make the app responsible for returning core turbomodule jsi hostobjects (7facb32f30 by @RSNara)
  • Make ReactApplicationContext and ReactContext abstract. Please instantiate BridgeReactContext instead (bridge mode). Or BridgelessReactContext instead (bridgeless mode). (e69f6755c8 by @RSNara)
iOS specific
  • Remove getSurfacePresenter and getModuleRegistry from RCTHost (f19371f28d by @cipolleschi)
  • Remove unused RCTImageLoadingPerfInstrumentationEnabled (f6b9a42985 by @realsoelynn)
  • Remove RCTRedBox access through RCTBridge (b5db214d2a by @realsoelynn)
  • Remove EventPriority class and always use the default EventPriority::AsynchronousBatched. This is potentially a breaking change if something in OSS sets a different priority. If a build fails because of this, simply remove the use of EventPriority. (55ed1c26ab by @sammy-SC)
  • Rename BUILD_FROM_SOURCE to RCT_BUILD_HERMES_FROM_SOURCE (6a1509f318 by @cipolleschi)
  • Rename React-Codegen to ReactCodegen (6549216b76 by @dmytrorykun)
  • Deleting deprecated didReceiveLocalNotification & didReceiveRemoteNotification callbacks on RCTPushNotificationManager (7fffe692e7)
  • Deleting deprecated alertAction and repeatInterval in PushNotificationIOS (410e3b5ebd)
  • (916dde4c60 by @philIip)

Added

Android specific
iOS specific

Changed

Android specific
iOS specific

Deprecated

Android specific
iOS specific

Removed

  • react-native/dev-middleware: Remove nonstandard faviconUrl field from CDP /json response (df19e597e3 by @huntie)
  • Remove viewconfigs for onTextInput callbacks (910cde6134 by @javache)
  • Remove deprecated onTextInput callback (34a50ae8ef by @javache)
  • Summary: Changelog: [General][Removed] launchId query param for /debugger-frontend is no longer generated automatically for each /open-debugger call. Caller of /open-debugger is now responsible for generating the launchId, which will be passed along to /debugger-frontend. (b7de916664 by @EdmondChuiHW)
  • [TS] Remove tvParallaxProperties prop from TouchableOpacity & add missing focusable, rejectResponderTermination props (0a0cd6517f by @retyui)
  • Removed deprecated methods from Pressability. (e4f3338069 by @javache)
  • Remove non-existent methods from <ImageBackground/> component (09c903c439 by @retyui)
  • RFC-0759 remove ram-bundle command. (58b45e86a6 by @blakef)
Android specific
  • Delete ReactContext.initializeWithInstance(). ReactContext now no longer contains legacy react instance methods. Please use BridgeReactInstance instead. (fb23470483 by @RSNara)
  • Removed NativeAnimationsDebugModule (already not Public API) (95f7a5c597 by @yungsters)
  • Delete UIManagerModule.measureLayoutRelativeToParent() (958f8e2bb5 by @arushikesarwani94)
  • UIManager.showPopupMenu() and UIManager.dismissPopupMenu() have been removed (c631e93341 by @alanleedev)
  • Remove getJavaScriptContextHolder() from BridgelessReactContext since now it can be accessed through BridgelessCatalystInstance in Bridgeless mode (4595351310 by @arushikesarwani94)
  • Remove getRuntimeExecutor() from ReactContext since now it can be accessed through BridgelessCatalystInstance in Bridgeless mode (f7b9aafd10 by @arushikesarwani94)
  • Delete ReactContext.initializeWithInstance(). ReactContext now no longer contains legacy react instance methods. Please use BridgeReactInstance instead. (05ef779c0b by @fabriziocucci)
  • Delete ReactContext.initializeWithInstance(). ReactContext now no longer contains legacy react instance methods. Please use BridgeReactInstance instead. (14fb1cc335 by @RSNara)
  • Delete ReactContext.initializeWithInstance(). ReactContext now no longer contains legacy react instance methods. Please use BridgeReactInstance instead. (f99dc486cd by @RSNara)
  • Move PopupMenu out of React Native core (8bced4b29d by @RSNara)
iOS specific

Fixed

Android specific
iOS specific

Security

Android specific
iOS specific

Unknown

Android Unknown
iOS Unknown
Failed to parse
  • Fling][Android] Add synchronous event support (dbc0334159)
  • Use our fork of the react-native-communti/cli-platform-ios use_native_modues.rb script (c884d19a50 by @blakef)
  • Enforce Activities using ReactDelegate implement DefaultHardwareBackBtnHandler. (a2d277f740 by @javache)

Readme

Source

@react-native/codegen

Version

Installation

yarn add --dev @react-native/codegen

Note: We're using yarn to install deps. Feel free to change commands to use npm 3+ and npx if you like

Testing

To run the tests in this package, run the following commands from the React Native root folder:

  1. yarn to install the dependencies. You just need to run this once
  2. yarn jest packages/react-native-codegen.

Keywords

FAQs

Last updated on 01 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc