Skip to content

Commit

Permalink
fix: Make it extend HybridObjectSpec anyways to make it non-breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Jan 12, 2025
1 parent 0fa6d83 commit 383cd64
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/react-native-nitro-modules/ios/core/HybridObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@

import Foundation

@available(*, deprecated, message: "HybridObjectSpec (a protocol) has been replaced with HybridObject (a class).")
public protocol HybridObjectSpec: AnyObject {
var memorySize: Int { get }
}

/**
* The base class for all Swift-based HybridObjects.
*/
public class HybridObject {
public class HybridObject: HybridObjectSpec {
/**
* Get the memory size of any external heap allocations in bytes.
*
Expand All @@ -29,11 +34,6 @@ public class HybridObject {
public var memorySize: Int { return 0 }
}

@available(*, deprecated, message: "HybridObjectSpec (a protocol) has been replaced with HybridObject (a class).")
public protocol HybridObjectSpec: AnyObject {
var memorySize: Int { get }
}

public extension HybridObjectSpec {
@available(*, deprecated, message: "getSizeOf(...) will now be default-computed. Please remove getSizeOf() from your code.")
func getSizeOf<T: AnyObject>(_ instance: T) -> Int {
Expand Down

0 comments on commit 383cd64

Please sign in to comment.