nitrogen 0.37.0-beta.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -36,7 +36,7 @@ export function createViewComponentShadowNodeFiles(spec) {
|
|
|
36
36
|
const { propsClassName, stateClassName, nameVariable, shadowNodeClassName, descriptorClassName, component, } = getViewComponentNames(spec);
|
|
37
37
|
const namespace = spec.config.getCxxNamespace('c++', 'views');
|
|
38
38
|
const props = [...spec.properties, getHybridRefProperty(spec)];
|
|
39
|
-
const properties = props.map((p) => `nitro::
|
|
39
|
+
const properties = props.map((p) => `nitro::ReactProp<${p.type.getCode('c++')}> ${escapeCppName(p.name)};`);
|
|
40
40
|
const filterCases = props.map((prop) => `case hashString("${prop.name}"): return true;`);
|
|
41
41
|
const comparisons = props.map((prop) => {
|
|
42
42
|
const name = escapeCppName(prop.name);
|
|
@@ -56,7 +56,7 @@ ${createFileMetadataString(`${component}.hpp`)}
|
|
|
56
56
|
|
|
57
57
|
#pragma once
|
|
58
58
|
|
|
59
|
-
#include <NitroModules/
|
|
59
|
+
#include <NitroModules/ReactProp.hpp>
|
|
60
60
|
#include <NitroModules/ViewComponentDescriptor.hpp>
|
|
61
61
|
#include <NitroModules/ViewPropsHolderState.hpp>
|
|
62
62
|
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
@@ -131,7 +131,7 @@ namespace ${namespace} {
|
|
|
131
131
|
...props.map((prop) => {
|
|
132
132
|
const name = escapeCppName(prop.name);
|
|
133
133
|
const type = prop.type.getCode('c++');
|
|
134
|
-
return `${name}(nitro::
|
|
134
|
+
return `${name}(nitro::ReactProp<${type}>::fromRawValue("${spec.name}", "${prop.name}", rawProps, sourceProps.${name}))`;
|
|
135
135
|
}),
|
|
136
136
|
];
|
|
137
137
|
const ctorIndent = createIndentation(propsClassName.length * 2);
|
|
@@ -141,7 +141,7 @@ ${createFileMetadataString(`${component}.cpp`)}
|
|
|
141
141
|
#include "${component}.hpp"
|
|
142
142
|
|
|
143
143
|
#include <NitroModules/NitroHash.hpp>
|
|
144
|
-
#include <NitroModules/
|
|
144
|
+
#include <NitroModules/ReactProp.hpp>
|
|
145
145
|
|
|
146
146
|
namespace ${namespace} {
|
|
147
147
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitrogen",
|
|
3
|
-
"version": "0.37.0
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "Code generator for React Native Nitro Modules that turns TypeScript specs into C++, Swift, and Kotlin bindings.",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"chalk": "^5.3.0",
|
|
38
|
-
"react-native-nitro-modules": "^0.37.0
|
|
38
|
+
"react-native-nitro-modules": "^0.37.0",
|
|
39
39
|
"ts-morph": "^28.0.0",
|
|
40
40
|
"yargs": "^18.0.0",
|
|
41
41
|
"zod": "^4.4.3"
|
|
@@ -73,7 +73,7 @@ export function createViewComponentShadowNodeFiles(
|
|
|
73
73
|
const props = [...spec.properties, getHybridRefProperty(spec)]
|
|
74
74
|
const properties = props.map(
|
|
75
75
|
(p) =>
|
|
76
|
-
`nitro::
|
|
76
|
+
`nitro::ReactProp<${p.type.getCode('c++')}> ${escapeCppName(p.name)};`
|
|
77
77
|
)
|
|
78
78
|
const filterCases = props.map(
|
|
79
79
|
(prop) => `case hashString("${prop.name}"): return true;`
|
|
@@ -99,7 +99,7 @@ ${createFileMetadataString(`${component}.hpp`)}
|
|
|
99
99
|
|
|
100
100
|
#pragma once
|
|
101
101
|
|
|
102
|
-
#include <NitroModules/
|
|
102
|
+
#include <NitroModules/ReactProp.hpp>
|
|
103
103
|
#include <NitroModules/ViewComponentDescriptor.hpp>
|
|
104
104
|
#include <NitroModules/ViewPropsHolderState.hpp>
|
|
105
105
|
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
@@ -175,7 +175,7 @@ namespace ${namespace} {
|
|
|
175
175
|
...props.map((prop) => {
|
|
176
176
|
const name = escapeCppName(prop.name)
|
|
177
177
|
const type = prop.type.getCode('c++')
|
|
178
|
-
return `${name}(nitro::
|
|
178
|
+
return `${name}(nitro::ReactProp<${type}>::fromRawValue("${spec.name}", "${prop.name}", rawProps, sourceProps.${name}))`
|
|
179
179
|
}),
|
|
180
180
|
]
|
|
181
181
|
const ctorIndent = createIndentation(propsClassName.length * 2)
|
|
@@ -185,7 +185,7 @@ ${createFileMetadataString(`${component}.cpp`)}
|
|
|
185
185
|
#include "${component}.hpp"
|
|
186
186
|
|
|
187
187
|
#include <NitroModules/NitroHash.hpp>
|
|
188
|
-
#include <NitroModules/
|
|
188
|
+
#include <NitroModules/ReactProp.hpp>
|
|
189
189
|
|
|
190
190
|
namespace ${namespace} {
|
|
191
191
|
|