Skip to content

Commit

Permalink
Make it work again on old arch
Browse files Browse the repository at this point in the history
  • Loading branch information
janicduplessis committed Jan 27, 2024
1 parent 76541fd commit 86c52f8
Show file tree
Hide file tree
Showing 19 changed files with 592 additions and 462 deletions.
102 changes: 17 additions & 85 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ PODS:
- CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6)
- FBLazyVector (0.73.2)
- FBReactNativeSpec (0.73.2):
- RCT-Folly (= 2022.05.16.00)
- RCTRequired (= 0.73.2)
- RCTTypeSafety (= 0.73.2)
- React-Core (= 0.73.2)
- React-jsi (= 0.73.2)
- ReactCommon/turbomodule/core (= 0.73.2)
- Flipper (0.201.0):
- Flipper-Folly (~> 2.6)
- Flipper-Boost-iOSX (1.76.0.1.11)
Expand Down Expand Up @@ -109,21 +116,17 @@ PODS:
- React-callinvoker (0.73.2)
- React-Codegen (0.73.2):
- DoubleConversion
- FBReactNativeSpec
- glog
- hermes-engine
- RCT-Folly
- RCTRequired
- RCTTypeSafety
- React-Core
- React-debug
- React-Fabric
- React-FabricImage
- React-graphics
- React-jsi
- React-jsiexecutor
- React-NativeModulesApple
- React-rendererdebug
- React-utils
- React-rncore
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- React-Core (0.73.2):
Expand Down Expand Up @@ -936,32 +939,15 @@ PODS:
- React-jsi (= 0.73.2)
- React-perflogger (= 0.73.2)
- React-jsinspector (0.73.2)
- React-jsitracing (0.73.2):
- React-jsi
- React-logger (0.73.2):
- glog
- React-Mapbuffer (0.73.2):
- glog
- React-debug
- react-native-blurhash (1.1.11):
- glog
- hermes-engine
- RCT-Folly (= 2022.05.16.00)
- RCTRequired
- RCTTypeSafety
- React-Codegen
- React-Core
- React-debug
- React-Fabric
- React-graphics
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- React-nativeconfig (0.73.2)
- React-NativeModulesApple (0.73.2):
- glog
Expand Down Expand Up @@ -990,21 +976,13 @@ PODS:
- RCTTypeSafety
- React-Core
- React-CoreModules
- React-debug
- React-Fabric
- React-graphics
- React-hermes
- React-nativeconfig
- React-NativeModulesApple
- React-RCTFabric
- React-RCTImage
- React-RCTNetwork
- React-rendererdebug
- React-RuntimeApple
- React-RuntimeCore
- React-RuntimeHermes
- React-runtimescheduler
- React-utils
- ReactCommon
- React-RCTBlob (0.73.2):
- hermes-engine
Expand Down Expand Up @@ -1082,42 +1060,8 @@ PODS:
- RCT-Folly (= 2022.05.16.00)
- React-debug
- React-rncore (0.73.2)
- React-RuntimeApple (0.73.2):
- hermes-engine
- RCT-Folly/Fabric (= 2022.05.16.00)
- React-callinvoker
- React-Core/Default
- React-CoreModules
- React-cxxreact
- React-jserrorhandler
- React-jsi
- React-jsiexecutor
- React-Mapbuffer
- React-NativeModulesApple
- React-RCTFabric
- React-RuntimeCore
- React-runtimeexecutor
- React-RuntimeHermes
- React-utils
- React-RuntimeCore (0.73.2):
- glog
- hermes-engine
- RCT-Folly/Fabric (= 2022.05.16.00)
- React-cxxreact
- React-jserrorhandler
- React-jsi
- React-jsiexecutor
- React-runtimeexecutor
- React-runtimescheduler
- React-runtimeexecutor (0.73.2):
- React-jsi (= 0.73.2)
- React-RuntimeHermes (0.73.2):
- hermes-engine
- RCT-Folly/Fabric (= 2022.05.16.00)
- React-jsi
- React-jsitracing
- React-nativeconfig
- React-utils
- React-runtimescheduler (0.73.2):
- glog
- hermes-engine
Expand Down Expand Up @@ -1178,6 +1122,7 @@ DEPENDENCIES:
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
- Flipper (= 0.201.0)
- Flipper-Boost-iOSX (= 1.76.0.1.11)
- Flipper-DoubleConversion (= 3.2.0.1)
Expand Down Expand Up @@ -1224,7 +1169,6 @@ DEPENDENCIES:
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector-modern`)
- React-jsitracing (from `../node_modules/react-native/ReactCommon/hermes/executor/`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- React-Mapbuffer (from `../node_modules/react-native/ReactCommon`)
- react-native-blurhash (from `../node_modules/react-native-blurhash`)
Expand All @@ -1244,10 +1188,7 @@ DEPENDENCIES:
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
- React-rendererdebug (from `../node_modules/react-native/ReactCommon/react/renderer/debug`)
- React-rncore (from `../node_modules/react-native/ReactCommon`)
- React-RuntimeApple (from `../node_modules/react-native/ReactCommon/react/runtime/platform/ios`)
- React-RuntimeCore (from `../node_modules/react-native/ReactCommon/react/runtime`)
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
- React-RuntimeHermes (from `../node_modules/react-native/ReactCommon/react/runtime`)
- React-runtimescheduler (from `../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`)
- React-utils (from `../node_modules/react-native/ReactCommon/react/utils`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
Expand Down Expand Up @@ -1276,6 +1217,8 @@ EXTERNAL SOURCES:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
FBLazyVector:
:path: "../node_modules/react-native/Libraries/FBLazyVector"
FBReactNativeSpec:
:path: "../node_modules/react-native/React/FBReactNativeSpec"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
hermes-engine:
Expand Down Expand Up @@ -1319,8 +1262,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsiexecutor"
React-jsinspector:
:path: "../node_modules/react-native/ReactCommon/jsinspector-modern"
React-jsitracing:
:path: "../node_modules/react-native/ReactCommon/hermes/executor/"
React-logger:
:path: "../node_modules/react-native/ReactCommon/logger"
React-Mapbuffer:
Expand Down Expand Up @@ -1359,14 +1300,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/react/renderer/debug"
React-rncore:
:path: "../node_modules/react-native/ReactCommon"
React-RuntimeApple:
:path: "../node_modules/react-native/ReactCommon/react/runtime/platform/ios"
React-RuntimeCore:
:path: "../node_modules/react-native/ReactCommon/react/runtime"
React-runtimeexecutor:
:path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
React-RuntimeHermes:
:path: "../node_modules/react-native/ReactCommon/react/runtime"
React-runtimescheduler:
:path: "../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler"
React-utils:
Expand All @@ -1381,6 +1316,7 @@ SPEC CHECKSUMS:
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953
FBLazyVector: fbc4957d9aa695250b55d879c1d86f79d7e69ab4
FBReactNativeSpec: 86de768f89901ef6ed3207cd686362189d64ac88
Flipper: c7a0093234c4bdd456e363f2f19b2e4b27652d44
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30
Expand All @@ -1399,7 +1335,7 @@ SPEC CHECKSUMS:
RCTTypeSafety: a759e3b086eccf3e2cbf2493d22f28e082f958e6
React: 805f5dd55bbdb92c36b4914c64aaae4c97d358dc
React-callinvoker: 6a697867607c990c2c2c085296ee32cfb5e47c01
React-Codegen: f3cb992539e5c21675f087e536d64b1f2a448655
React-Codegen: c4447ffa339f4e7a22e0c9c800eec9084f31899c
React-Core: 49f66fecc7695464e9b7bc7dc7cd9473d2c60584
React-CoreModules: 710e7c557a1a8180bd1645f5b4bf79f4bd3f5417
React-cxxreact: 345857b5e4be000c0527df78be3b41a0677a20ce
Expand All @@ -1413,16 +1349,15 @@ SPEC CHECKSUMS:
React-jsi: a182068133f80918cd0eec77875abaf943a0b6be
React-jsiexecutor: dacd00ce8a18fc00a0ae6c25e3015a6437e5d2e8
React-jsinspector: 03644c063fc3621c9a4e8bf263a8150909129618
React-jsitracing: 7c77101b38fcc8fa7f198de7e1d834350a85af90
React-logger: 66b168e2b2bee57bd8ce9e69f739d805732a5570
React-Mapbuffer: 9ee041e1d7be96da6d76a251f92e72b711c651d6
react-native-blurhash: 39527d2330f83336178eee39a7780035c5881d70
react-native-blurhash: bb99ded7a87d193bfe05faa28ccbc62b582d8c3d
React-nativeconfig: d753fbbc8cecc8ae413d615599ac378bbf6999bb
React-NativeModulesApple: 964f4eeab1b4325e8b6a799cf4444c3fd4eb0a9c
React-perflogger: 29efe63b7ef5fbaaa50ef6eaa92482f98a24b97e
React-RCTActionSheet: 69134c62aefd362027b20da01cd5d14ffd39db3f
React-RCTAnimation: 3b5a57087c7a5e727855b803d643ac1d445488f5
React-RCTAppDelegate: cb1a9a8447ddad006f934988016390f4df472e74
React-RCTAppDelegate: a3ce9b69c0620a1717d08e826d4dc7ad8a3a3cae
React-RCTBlob: 26ea660f2be1e6de62f2d2ad9a9c7b9bfabb786f
React-RCTFabric: bb6dbbff2f80b9489f8b2f1d2554aa040aa2e3cd
React-RCTImage: 27b27f4663df9e776d0549ed2f3536213e793f1b
Expand All @@ -1432,11 +1367,8 @@ SPEC CHECKSUMS:
React-RCTText: 73006e95ca359595c2510c1c0114027c85a6ddd3
React-RCTVibration: 599f427f9cbdd9c4bf38959ca020e8fef0717211
React-rendererdebug: f2946e0a1c3b906e71555a7c4a39aa6a6c0e639b
React-rncore: 6e3139cf51cea08068f008da426821d1deaa24b9
React-RuntimeApple: 08c29690996ed935e35054965bcfb70ebea67318
React-RuntimeCore: 5b73f40b46d78a825cf71714e1e5044d389702d6
React-rncore: 74030de0ffef7b1a3fb77941168624534cc9ae7f
React-runtimeexecutor: 2d1f64f58193f00a3ad71d3f89c2bfbfe11cf5a5
React-RuntimeHermes: 01dcb5a4e9073496f6f981a8648843771e3f6516
React-runtimescheduler: df8945a656356ff10f58f65a70820478bfcf33ad
React-utils: f5bc61e7ea3325c0732ae2d755f4441940163b85
ReactCommon: 45b5d4f784e869c44a6f5a8fad5b114ca8f78c53
Expand Down
8 changes: 4 additions & 4 deletions example/ios/example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -574,15 +574,15 @@
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"$(inherited)",
"-DRN_FABRIC_ENABLED",
" ",
);
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DRN_FABRIC_ENABLED",
" ",
);
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -650,15 +650,15 @@
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = (
"$(inherited)",
"-DRN_FABRIC_ENABLED",
" ",
);
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DRN_FABRIC_ENABLED",
" ",
);
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function App() {
const [blurhash, setBlurhash] = useState('LGFFaXYk^6#M@-5c,1J5@[or[Q6.');
const [decodeAsync, setDecodeAsync] = useState(true);
const [encodingImageUri, setEncodingImageUri] = useState(
'https://blurha.sh/assets/images/img4.jpg',
'https://github.com/woltapp/blurhash/blob/master/Website/assets/images/img1.jpg?raw=true',
);
const [isEncoding, setIsEncoding] = useState(false);
//#endregion
Expand Down
18 changes: 9 additions & 9 deletions ios/BinaryInteger+Encode83.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
import Foundation

extension BinaryInteger {
func encode83(length: Int) -> String {
var result = ""
for i in 1 ... length {
let digit = (Int(self) / pow(83, length - i)) % 83
result += encodeCharacters[Int(digit)]
}
return result
}
func encode83(length: Int) -> String {
var result = ""
for i in 1 ... length {
let digit = (Int(self) / pow(83, length - i)) % 83
result += encodeCharacters[Int(digit)]
}
return result
}
}

private func pow(_ base: Int, _ exponent: Int) -> Int {
return (0 ..< exponent).reduce(1) { value, _ in value * base }
return (0 ..< exponent).reduce(1) { value, _ in value * base }
}
26 changes: 13 additions & 13 deletions ios/BlurhashCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
import Foundation

final class BlurhashCache {
var blurhash: String?
var decodeWidth: Int
var decodeHeight: Int
var decodePunch: Float
var blurhash: String?
var decodeWidth: Int
var decodeHeight: Int
var decodePunch: Float

init(blurhash: String?, decodeWidth: Int, decodeHeight: Int, decodePunch: Float) {
self.blurhash = blurhash
self.decodeWidth = decodeWidth
self.decodeHeight = decodeHeight
self.decodePunch = decodePunch
}
init(blurhash: String?, decodeWidth: Int, decodeHeight: Int, decodePunch: Float) {
self.blurhash = blurhash
self.decodeWidth = decodeWidth
self.decodeHeight = decodeHeight
self.decodePunch = decodePunch
}

final func isDifferent(blurhash: String, decodeWidth: Int, decodeHeight: Int, decodePunch: Float) -> Bool {
return self.blurhash != blurhash || self.decodeWidth != decodeWidth || self.decodeHeight != decodeHeight || self.decodePunch != decodePunch
}
final func isDifferent(blurhash: String, decodeWidth: Int, decodeHeight: Int, decodePunch: Float) -> Bool {
return self.blurhash != blurhash || self.decodeWidth != decodeWidth || self.decodeHeight != decodeHeight || self.decodePunch != decodePunch
}
}
10 changes: 5 additions & 5 deletions ios/BlurhashError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import Foundation

enum BlurhashError: Error {
case invalidBlurhashString(isNil: Bool)
case invalidBlurhashDecodeWidth(actualValue: Int)
case invalidBlurhashDecodeHeight(actualValue: Int)
case invalidBlurhashDecodePunch(actualValue: Float)
case decodeError(message: String?)
case invalidBlurhashString(isNil: Bool)
case invalidBlurhashDecodeWidth(actualValue: Int)
case invalidBlurhashDecodeHeight(actualValue: Int)
case invalidBlurhashDecodePunch(actualValue: Float)
case decodeError(message: String?)
}
Loading

0 comments on commit 86c52f8

Please sign in to comment.