
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
react-native-codegen
Advanced tools
The react-native-codegen package is a tool used in the React Native ecosystem to generate native code for JavaScript components and modules. It helps in creating type-safe interfaces between JavaScript and native code, ensuring that the data passed between them is correctly typed and validated.
Generating Native Modules
This feature allows you to define a native module in a JSON format, which react-native-codegen will then use to generate the corresponding native code. This ensures type safety and consistency between JavaScript and native code.
```json
{
"name": "MyModule",
"type": "module",
"methods": {
"myMethod": {
"type": "function",
"params": [
{ "name": "param1", "type": "string" },
{ "name": "param2", "type": "number" }
],
"returnType": "void"
}
}
}
```
Generating Native Components
This feature allows you to define a native component in a JSON format, which react-native-codegen will then use to generate the corresponding native code. This ensures that the component's props are correctly typed and validated.
```json
{
"name": "MyComponent",
"type": "component",
"props": {
"title": { "type": "string" },
"count": { "type": "number" }
}
}
```
Generating Event Emitters
This feature allows you to define an event emitter in a JSON format, which react-native-codegen will then use to generate the corresponding native code. This ensures that the events and their data are correctly typed and validated.
```json
{
"name": "MyEventEmitter",
"type": "eventEmitter",
"events": {
"onEvent": {
"type": "function",
"params": [
{ "name": "eventData", "type": "object" }
]
}
}
}
```
The react-native-create-library package is used to create a new native module library for React Native. It provides a boilerplate for creating native modules but does not offer the same level of type safety and code generation as react-native-codegen.
The react-native-builder-bob package is a CLI tool for creating and building React Native libraries. It focuses on setting up the project structure and build configuration but does not provide code generation capabilities like react-native-codegen.
FAQs
⚛️ Code generation tools for React Native
We found that react-native-codegen demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.