nitrogen 0.33.2 → 0.33.3
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.
- package/lib/syntax/swift/SwiftFunction.js +0 -1
- package/lib/syntax/swift/SwiftHybridObject.js +0 -1
- package/lib/syntax/swift/SwiftHybridObjectBridge.js +1 -2
- package/lib/syntax/swift/SwiftStruct.js +0 -1
- package/lib/views/CppHybridViewComponent.js +1 -1
- package/lib/views/kotlin/KotlinHybridViewManager.js +3 -3
- package/package.json +2 -2
- package/src/syntax/swift/SwiftFunction.ts +0 -1
- package/src/syntax/swift/SwiftHybridObject.ts +0 -1
- package/src/syntax/swift/SwiftHybridObjectBridge.ts +1 -2
- package/src/syntax/swift/SwiftStruct.ts +0 -1
- package/src/views/CppHybridViewComponent.ts +1 -1
- package/src/views/kotlin/KotlinHybridViewManager.ts +3 -3
|
@@ -43,7 +43,7 @@ public final func afterUpdate() {
|
|
|
43
43
|
}
|
|
44
44
|
`.trim(), `
|
|
45
45
|
public final func maybePrepareForRecycle() {
|
|
46
|
-
guard let recyclable = __implementation as? RecyclableView else { return }
|
|
46
|
+
guard let recyclable = __implementation as? any RecyclableView else { return }
|
|
47
47
|
recyclable.prepareForRecycle()
|
|
48
48
|
}
|
|
49
49
|
`.trim());
|
|
@@ -82,7 +82,6 @@ public override func getCxxPart() -> bridge.${baseBridge.specializationName} {
|
|
|
82
82
|
const swiftCxxWrapperCode = `
|
|
83
83
|
${createFileMetadataString(`${name.HybridTSpecCxx}.swift`)}
|
|
84
84
|
|
|
85
|
-
import Foundation
|
|
86
85
|
${imports.join('\n')}
|
|
87
86
|
|
|
88
87
|
/**
|
|
@@ -225,7 +225,7 @@ namespace ${namespace} {
|
|
|
225
225
|
void ${descriptorClassName}::adopt(react::ShadowNode& shadowNode) const {
|
|
226
226
|
// This is called immediately after \`ShadowNode\` is created, cloned or in progress.
|
|
227
227
|
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
|
|
228
|
-
auto& concreteShadowNode =
|
|
228
|
+
auto& concreteShadowNode = static_cast<${shadowNodeClassName}&>(shadowNode);
|
|
229
229
|
const ${propsClassName}& props = concreteShadowNode.getConcreteProps();
|
|
230
230
|
${stateClassName} state;
|
|
231
231
|
state.setProps(props);
|
|
@@ -33,7 +33,7 @@ import ${javaNamespace}.*
|
|
|
33
33
|
/**
|
|
34
34
|
* Represents the React Native \`ViewManager\` for the "${spec.name}" Nitro HybridView.
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
public class ${manager}: SimpleViewManager<View>() {
|
|
37
37
|
init {
|
|
38
38
|
if (RecyclableView::class.java.isAssignableFrom(${viewImplementation}::class.java)) {
|
|
39
39
|
// Enable view recycling
|
|
@@ -126,7 +126,7 @@ namespace ${cxxNamespace} {
|
|
|
126
126
|
|
|
127
127
|
using namespace facebook;
|
|
128
128
|
|
|
129
|
-
class J${stateUpdaterName}: public jni::JavaClass<J${stateUpdaterName}> {
|
|
129
|
+
class J${stateUpdaterName} final: public jni::JavaClass<J${stateUpdaterName}> {
|
|
130
130
|
public:
|
|
131
131
|
static constexpr auto kJavaDescriptor = "L${updaterJniDescriptor};";
|
|
132
132
|
|
|
@@ -186,7 +186,7 @@ void J${stateUpdaterName}::updateViewProps(jni::alias_ref<jni::JClass> /* class
|
|
|
186
186
|
static_cast<react::StateWrapperImpl::javaobject>(rawStateWrapper)};
|
|
187
187
|
|
|
188
188
|
std::shared_ptr<const react::State> state = stateWrapper->cthis()->getState();
|
|
189
|
-
auto concreteState = std::
|
|
189
|
+
auto concreteState = std::static_pointer_cast<const ConcreteStateData>(state);
|
|
190
190
|
const ${stateClassName}& data = concreteState->getData();
|
|
191
191
|
const std::optional<${propsClassName}>& maybeProps = data.getProps();
|
|
192
192
|
if (!maybeProps.has_value()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitrogen",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.3",
|
|
4
4
|
"description": "The code-generator for react-native-nitro-modules.",
|
|
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.33.
|
|
38
|
+
"react-native-nitro-modules": "^0.33.3",
|
|
39
39
|
"ts-morph": "^27.0.0",
|
|
40
40
|
"yargs": "^18.0.0",
|
|
41
41
|
"zod": "^4.0.5"
|
|
@@ -66,7 +66,7 @@ public final func afterUpdate() {
|
|
|
66
66
|
`.trim(),
|
|
67
67
|
`
|
|
68
68
|
public final func maybePrepareForRecycle() {
|
|
69
|
-
guard let recyclable = __implementation as? RecyclableView else { return }
|
|
69
|
+
guard let recyclable = __implementation as? any RecyclableView else { return }
|
|
70
70
|
recyclable.prepareForRecycle()
|
|
71
71
|
}
|
|
72
72
|
`.trim()
|
|
@@ -130,7 +130,6 @@ public override func getCxxPart() -> bridge.${baseBridge.specializationName} {
|
|
|
130
130
|
const swiftCxxWrapperCode = `
|
|
131
131
|
${createFileMetadataString(`${name.HybridTSpecCxx}.swift`)}
|
|
132
132
|
|
|
133
|
-
import Foundation
|
|
134
133
|
${imports.join('\n')}
|
|
135
134
|
|
|
136
135
|
/**
|
|
@@ -272,7 +272,7 @@ namespace ${namespace} {
|
|
|
272
272
|
void ${descriptorClassName}::adopt(react::ShadowNode& shadowNode) const {
|
|
273
273
|
// This is called immediately after \`ShadowNode\` is created, cloned or in progress.
|
|
274
274
|
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
|
|
275
|
-
auto& concreteShadowNode =
|
|
275
|
+
auto& concreteShadowNode = static_cast<${shadowNodeClassName}&>(shadowNode);
|
|
276
276
|
const ${propsClassName}& props = concreteShadowNode.getConcreteProps();
|
|
277
277
|
${stateClassName} state;
|
|
278
278
|
state.setProps(props);
|
|
@@ -53,7 +53,7 @@ import ${javaNamespace}.*
|
|
|
53
53
|
/**
|
|
54
54
|
* Represents the React Native \`ViewManager\` for the "${spec.name}" Nitro HybridView.
|
|
55
55
|
*/
|
|
56
|
-
|
|
56
|
+
public class ${manager}: SimpleViewManager<View>() {
|
|
57
57
|
init {
|
|
58
58
|
if (RecyclableView::class.java.isAssignableFrom(${viewImplementation}::class.java)) {
|
|
59
59
|
// Enable view recycling
|
|
@@ -152,7 +152,7 @@ namespace ${cxxNamespace} {
|
|
|
152
152
|
|
|
153
153
|
using namespace facebook;
|
|
154
154
|
|
|
155
|
-
class J${stateUpdaterName}: public jni::JavaClass<J${stateUpdaterName}> {
|
|
155
|
+
class J${stateUpdaterName} final: public jni::JavaClass<J${stateUpdaterName}> {
|
|
156
156
|
public:
|
|
157
157
|
static constexpr auto kJavaDescriptor = "L${updaterJniDescriptor};";
|
|
158
158
|
|
|
@@ -213,7 +213,7 @@ void J${stateUpdaterName}::updateViewProps(jni::alias_ref<jni::JClass> /* class
|
|
|
213
213
|
static_cast<react::StateWrapperImpl::javaobject>(rawStateWrapper)};
|
|
214
214
|
|
|
215
215
|
std::shared_ptr<const react::State> state = stateWrapper->cthis()->getState();
|
|
216
|
-
auto concreteState = std::
|
|
216
|
+
auto concreteState = std::static_pointer_cast<const ConcreteStateData>(state);
|
|
217
217
|
const ${stateClassName}& data = concreteState->getData();
|
|
218
218
|
const std::optional<${propsClassName}>& maybeProps = data.getProps();
|
|
219
219
|
if (!maybeProps.has_value()) {
|