react-native-nitro-modules 0.32.2 → 0.33.1

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.
@@ -1,24 +1,17 @@
1
1
  package com.margelo.nitro.views
2
2
 
3
3
  import android.view.View
4
- import androidx.annotation.Keep
5
- import com.facebook.jni.HybridData
6
- import com.facebook.proguard.annotations.DoNotStrip
7
4
  import com.margelo.nitro.core.HybridObject
8
5
 
9
6
  /**
10
7
  * A base class for all Kotlin-based Hybrid Views.
11
8
  */
12
- @Keep
13
- @DoNotStrip
14
9
  abstract class HybridView : HybridObject() {
15
10
  /**
16
- * Get the `UIView` this HybridView is holding.
11
+ * Get the `View` this HybridView is holding.
17
12
  *
18
13
  * This value should not change during the lifetime of this `HybridView`.
19
14
  */
20
- @get:DoNotStrip
21
- @get:Keep
22
15
  abstract val view: View
23
16
 
24
17
  /**
@@ -0,0 +1,15 @@
1
+ package com.margelo.nitro.views
2
+
3
+ /**
4
+ * A `HybridView` that can also be recycled.
5
+ */
6
+ interface RecyclableView {
7
+ /**
8
+ * Called when the view is going to be recycled to
9
+ * be re-used later on with different props.
10
+ *
11
+ * This is a good place to reset any internal state
12
+ * to it's default value.
13
+ */
14
+ fun prepareForRecycle()
15
+ }
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <resources>
3
+ <item type="id" name="associated_hybrid_view_tag"/>
4
+ </resources>
@@ -9,7 +9,7 @@
9
9
  #define NitroDefines_h
10
10
 
11
11
  // Sets the version of the native Nitro core library
12
- #define NITRO_VERSION "0.32.2"
12
+ #define NITRO_VERSION "0.33.1"
13
13
 
14
14
  // Sets whether to use debug or optimized production build flags
15
15
  #ifdef DEBUG
@@ -12,12 +12,13 @@
12
12
 
13
13
  /// A base protocol for all Swift-based Hybrid Views.
14
14
  public protocol HybridView: HybridObject {
15
+ associatedtype ViewType: UIView
15
16
  /**
16
17
  * Get the ``UIView`` this HybridView is holding.
17
18
  *
18
19
  * This value should not change during the lifetime of this ``HybridView``.
19
20
  */
20
- var view: UIView { get }
21
+ var view: ViewType { get }
21
22
 
22
23
  /**
23
24
  * Called right before updating props.
@@ -0,0 +1,20 @@
1
+ //
2
+ // RecyclableView.swift
3
+ // NitroModules
4
+ //
5
+ // Created by Marc Rousavy on 13.01.25.
6
+ //
7
+
8
+ import Foundation
9
+
10
+ /// A `HybridView` that can also be recycled.
11
+ public protocol RecyclableView {
12
+ /**
13
+ * Called when the view is going to be recycled to
14
+ * be re-used later on with different props.
15
+ *
16
+ * This is a good place to reset any internal state
17
+ * to it's default value.
18
+ */
19
+ func prepareForRecycle()
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nitro-modules",
3
- "version": "0.32.2",
3
+ "version": "0.33.1",
4
4
  "description": "Insanely fast native C++, Swift or Kotlin modules with a statically compiled binding layer to JSI.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",