From 34a80d8e2c24ffbf4cb33852d9e7f72c25074a5a Mon Sep 17 00:00:00 2001 From: Mugi Khan Date: Tue, 15 Oct 2024 10:49:59 +0200 Subject: [PATCH] Wrap require call in try catch for metro --- .../ios/Podfile.lock | 175 +++--------------- .../project.pbxproj | 70 +++---- .../package.json | 3 +- .../ReactNativeQuickSQLiteOpenFactory.ts | 8 +- packages/react-native/src/index.ts | 2 +- pnpm-lock.yaml | 19 +- 6 files changed, 69 insertions(+), 208 deletions(-) diff --git a/demos/react-native-supabase-todolist/ios/Podfile.lock b/demos/react-native-supabase-todolist/ios/Podfile.lock index f1730452..7a88a350 100644 --- a/demos/react-native-supabase-todolist/ios/Podfile.lock +++ b/demos/react-native-supabase-todolist/ios/Podfile.lock @@ -3,7 +3,7 @@ PODS: - DoubleConversion (1.1.6) - EXConstants (16.0.2): - ExpoModulesCore - - Expo (51.0.34): + - Expo (51.0.37): - ExpoModulesCore - ExpoAsset (10.0.10): - ExpoModulesCore @@ -21,7 +21,7 @@ PODS: - ExpoModulesCore - ExpoKeepAwake (13.0.2): - ExpoModulesCore - - ExpoModulesCore (1.12.24): + - ExpoModulesCore (1.12.25): - DoubleConversion - glog - hermes-engine @@ -74,7 +74,7 @@ PODS: - hermes-engine (0.74.5): - hermes-engine/Pre-built (= 0.74.5) - hermes-engine/Pre-built (0.74.5) - - powersync-sqlite-core (0.2.1) + - powersync-sqlite-core (0.3.0) - RCT-Folly (2024.01.01.00): - boost - DoubleConversion @@ -1005,11 +1005,11 @@ PODS: - React-debug - react-native-encrypted-storage (4.0.3): - React-Core - - react-native-quick-sqlite (1.4.0): + - react-native-quick-sqlite (2.0.0): - DoubleConversion - glog - hermes-engine - - powersync-sqlite-core (~> 0.2.1) + - powersync-sqlite-core (~> 0.3.0) - RCT-Folly (= 2024.01.01.00) - RCTRequired - RCTTypeSafety @@ -1030,71 +1030,7 @@ PODS: - ReactCommon/turbomodule/core - Yoga - react-native-safe-area-context (4.10.5): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2024.01.01.00) - - RCTRequired - - RCTTypeSafety - - React-Codegen - - React-Core - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - react-native-safe-area-context/common (= 4.10.5) - - react-native-safe-area-context/fabric (= 4.10.5) - - React-NativeModulesApple - - React-RCTFabric - - React-rendererdebug - - React-utils - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - Yoga - - react-native-safe-area-context/common (4.10.5): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2024.01.01.00) - - RCTRequired - - RCTTypeSafety - - React-Codegen - - React-Core - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - React-NativeModulesApple - - React-RCTFabric - - React-rendererdebug - - React-utils - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - Yoga - - react-native-safe-area-context/fabric (4.10.5): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2024.01.01.00) - - RCTRequired - - RCTTypeSafety - - React-Codegen - React-Core - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - react-native-safe-area-context/common - - React-NativeModulesApple - - React-RCTFabric - - React-rendererdebug - - React-utils - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - Yoga - React-nativeconfig (0.74.5) - React-NativeModulesApple (0.74.5): - glog @@ -1347,51 +1283,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - RNReanimated (3.15.4): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2024.01.01.00) - - RCTRequired - - RCTTypeSafety - - React-Codegen - - React-Core - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - React-NativeModulesApple - - React-RCTFabric - - React-rendererdebug - - React-utils - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - RNReanimated/reanimated (= 3.15.4) - - RNReanimated/worklets (= 3.15.4) - - Yoga - - RNReanimated/reanimated (3.15.4): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2024.01.01.00) - - RCTRequired - - RCTTypeSafety - - React-Codegen - - React-Core - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - React-NativeModulesApple - - React-RCTFabric - - React-rendererdebug - - React-utils - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - Yoga - - RNReanimated/worklets (3.15.4): + - RNReanimated (3.10.1): - DoubleConversion - glog - hermes-engine @@ -1413,29 +1305,6 @@ PODS: - ReactCommon/turbomodule/core - Yoga - RNScreens (3.31.1): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2024.01.01.00) - - RCTRequired - - RCTTypeSafety - - React-Codegen - - React-Core - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - React-NativeModulesApple - - React-RCTFabric - - React-RCTImage - - React-rendererdebug - - React-utils - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - RNScreens/common (= 3.31.1) - - Yoga - - RNScreens/common (3.31.1): - DoubleConversion - glog - hermes-engine @@ -1532,7 +1401,7 @@ DEPENDENCIES: - React-logger (from `../node_modules/react-native/ReactCommon/logger`) - React-Mapbuffer (from `../node_modules/react-native/ReactCommon`) - react-native-encrypted-storage (from `../../../node_modules/react-native-encrypted-storage`) - - "react-native-quick-sqlite (from `../node_modules/@journeyapps/react-native-quick-sqlite`)" + - "react-native-quick-sqlite (from `../../../node_modules/@journeyapps/react-native-quick-sqlite`)" - react-native-safe-area-context (from `../../../node_modules/react-native-safe-area-context`) - React-nativeconfig (from `../node_modules/react-native/ReactCommon`) - React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`) @@ -1559,7 +1428,7 @@ DEPENDENCIES: - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - "RNCMaskedView (from `../../../node_modules/@react-native-community/masked-view`)" - RNGestureHandler (from `../../../node_modules/react-native-gesture-handler`) - - RNReanimated (from `../node_modules/react-native-reanimated`) + - RNReanimated (from `../../../node_modules/react-native-reanimated`) - RNScreens (from `../../../node_modules/react-native-screens`) - RNVectorIcons (from `../../../node_modules/react-native-vector-icons`) - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) @@ -1659,7 +1528,7 @@ EXTERNAL SOURCES: react-native-encrypted-storage: :path: "../../../node_modules/react-native-encrypted-storage" react-native-quick-sqlite: - :path: "../node_modules/@journeyapps/react-native-quick-sqlite" + :path: "../../../node_modules/@journeyapps/react-native-quick-sqlite" react-native-safe-area-context: :path: "../../../node_modules/react-native-safe-area-context" React-nativeconfig: @@ -1713,7 +1582,7 @@ EXTERNAL SOURCES: RNGestureHandler: :path: "../../../node_modules/react-native-gesture-handler" RNReanimated: - :path: "../node_modules/react-native-reanimated" + :path: "../../../node_modules/react-native-reanimated" RNScreens: :path: "../../../node_modules/react-native-screens" RNVectorIcons: @@ -1725,7 +1594,7 @@ SPEC CHECKSUMS: boost: d3f49c53809116a5d38da093a8aa78bf551aed09 DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 EXConstants: 409690fbfd5afea964e5e9d6c4eb2c2b59222c59 - Expo: 963ef4ae102e4f4ac114a8510d70127c44adffbf + Expo: 67b60b3b80a3c8e9f3bcaaa84d06d140229a246d ExpoAsset: 323700f291684f110fb55f0d4022a3362ea9f875 ExpoCamera: 929be541d1c1319fcf32f9f5d9df8b97804346b5 ExpoCrypto: 156078f266bf28f80ecf5e2a9c3a0d6ffce07a1c @@ -1733,14 +1602,14 @@ SPEC CHECKSUMS: ExpoFont: 00756e6c796d8f7ee8d211e29c8b619e75cbf238 ExpoHead: fcb28a68ed4ba28f177394d2dfb8a0a8824cd103 ExpoKeepAwake: 3b8815d9dd1d419ee474df004021c69fdd316d08 - ExpoModulesCore: a113755f96c40590671f01cfcdce8ebdf0cf5f83 + ExpoModulesCore: 0e7d4d5c13169bbbd53496721d811adbcc5d600a ExpoSecureStore: 060cebcb956b80ddae09821610ac1aa9e1ac74cd - EXSplashScreen: 10b116117c9bb6a272ba782706f21dadc23f44d9 + EXSplashScreen: 17a656c08a0095be15b620c52e61dfdb665863d2 FBLazyVector: ac12dc084d1c8ec4cc4d7b3cf1b0ebda6dab85af fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f hermes-engine: 8c1577f3fdb849cbe7729c2e7b5abc4b845e88f8 - powersync-sqlite-core: 38ead13d8b21920cfbc79e9b3415b833574a506d + powersync-sqlite-core: ad0e70e23bacd858fe2e79032dc4aabdf972d1bd RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47 RCTDeprecation: 3afceddffa65aee666dafd6f0116f1d975db1584 RCTRequired: ec1239bc9d8bf63e10fb92bd8b26171a9258e0c1 @@ -1766,16 +1635,16 @@ SPEC CHECKSUMS: React-logger: 257858bd55f3a4e1bc0cf07ddc8fb9faba6f8c7c React-Mapbuffer: 6c1cacdbf40b531f549eba249e531a7d0bfd8e7f react-native-encrypted-storage: db300a3f2f0aba1e818417c1c0a6be549038deb7 - react-native-quick-sqlite: a9b4884734cb8de16fc8cb81a3411613fde21e80 - react-native-safe-area-context: afa5d614d6b1b73b743c9261985876606560d128 + react-native-quick-sqlite: 9244f46798e83dd5526a5bcc303b5fceaea4c8e4 + react-native-safe-area-context: a240ad4b683349e48b1d51fed1611138d1bdad97 React-nativeconfig: ba9a2e54e2f0882cf7882698825052793ed4c851 React-NativeModulesApple: 8d11ff8955181540585c944cf48e9e7236952697 React-perflogger: ed4e0c65781521e0424f2e5e40b40cc7879d737e React-RCTActionSheet: 49d53ff03bb5688ca4606c55859053a0cd129ea5 React-RCTAnimation: 07b4923885c52c397c4ec103924bf6e53b42c73e - React-RCTAppDelegate: fc766c91b215650b9dd0dc7e19cb846165662d9f + React-RCTAppDelegate: 316e295076734baf9bdf1bfac7d92ab647aed930 React-RCTBlob: 85c57b0d5e667ff8a472163ba3af0628171a64bb - React-RCTFabric: 7058f9ea5584364af58ba384312c7c3880631d28 + React-RCTFabric: 97c1465ded4dc92841f5376a39e43e1b2c455f40 React-RCTImage: b965c85bec820e2a9c154b1fb00a2ecdd59a9c92 React-RCTLinking: 75f04a5f27c26c4e73a39c50df470820d219df79 React-RCTNetwork: c1a9143f4d5778efc92da40d83969d03912ccc24 @@ -1792,10 +1661,10 @@ SPEC CHECKSUMS: React-utils: f242eb7e7889419d979ca0e1c02ccc0ea6e43b29 ReactCommon: f7da14a8827b72704169a48c929bcde802698361 RNCMaskedView: 0e1bc4bfa8365eba5fbbb71e07fbdc0555249489 - RNGestureHandler: 156548e18203327173a764c6932a3f52e90cb9cd - RNReanimated: 7ee83f9cbe173965b5d2828af2ddac310ec1c5ae - RNScreens: 63fe8222c172a79f5c30dd1aefaeb369c6eb57b6 - RNVectorIcons: 46a635b764a63e9a4ffedae054bca3847e0c8934 + RNGestureHandler: 2282cfbcf86c360d29f44ace393203afd5c6cff7 + RNReanimated: 35f9ac9c3ac42d0497ebd1cce5c39d7687a8493e + RNScreens: b32a9ff15bea7fcdbe5dff6477bc503f792b1208 + RNVectorIcons: 845eda5c7819bd29699cafd0fc98c9d4afe28c96 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d Yoga: 950bbfd7e6f04790fdb51149ed51df41f329fcc8 ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5 diff --git a/demos/react-native-supabase-todolist/ios/powersyncexample.xcodeproj/project.pbxproj b/demos/react-native-supabase-todolist/ios/powersyncexample.xcodeproj/project.pbxproj index 388fc758..c92dad1c 100644 --- a/demos/react-native-supabase-todolist/ios/powersyncexample.xcodeproj/project.pbxproj +++ b/demos/react-native-supabase-todolist/ios/powersyncexample.xcodeproj/project.pbxproj @@ -13,9 +13,9 @@ 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */; }; 59196A12A76D4073A1C90FA5 /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0783202F60264A90AD94BA39 /* noop-file.swift */; }; - 96905EF65AED1B983A6B3ABC /* libPods-powersyncexample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-powersyncexample.a */; }; B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */; }; BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; }; + E775442C2DB8E67DE5263CFC /* libPods-powersyncexample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C95F34CB18838BF18ABEE79 /* libPods-powersyncexample.a */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -27,9 +27,9 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = powersyncexample/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = powersyncexample/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = powersyncexample/main.m; sourceTree = ""; }; - 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-powersyncexample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-powersyncexample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 6C2E3173556A471DD304B334 /* Pods-powersyncexample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-powersyncexample.debug.xcconfig"; path = "Target Support Files/Pods-powersyncexample/Pods-powersyncexample.debug.xcconfig"; sourceTree = ""; }; - 7A4D352CD337FB3A3BF06240 /* Pods-powersyncexample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-powersyncexample.release.xcconfig"; path = "Target Support Files/Pods-powersyncexample/Pods-powersyncexample.release.xcconfig"; sourceTree = ""; }; + 1F64EA95D2C06DD87AAF037C /* Pods-powersyncexample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-powersyncexample.release.xcconfig"; path = "Target Support Files/Pods-powersyncexample/Pods-powersyncexample.release.xcconfig"; sourceTree = ""; }; + 30B06D3467092F6FEB76FF81 /* Pods-powersyncexample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-powersyncexample.debug.xcconfig"; path = "Target Support Files/Pods-powersyncexample/Pods-powersyncexample.debug.xcconfig"; sourceTree = ""; }; + 6C95F34CB18838BF18ABEE79 /* libPods-powersyncexample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-powersyncexample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = powersyncexample/SplashScreen.storyboard; sourceTree = ""; }; BB2F792C24A3F905000567C9 /* Expo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = ""; }; C7800BEF0023EF5D896607F6 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = powersyncexample/PrivacyInfo.xcprivacy; sourceTree = ""; }; @@ -42,7 +42,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 96905EF65AED1B983A6B3ABC /* libPods-powersyncexample.a in Frameworks */, + E775442C2DB8E67DE5263CFC /* libPods-powersyncexample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -70,7 +70,7 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-powersyncexample.a */, + 6C95F34CB18838BF18ABEE79 /* libPods-powersyncexample.a */, ); name = Frameworks; sourceTree = ""; @@ -125,8 +125,8 @@ D65327D7A22EEC0BE12398D9 /* Pods */ = { isa = PBXGroup; children = ( - 6C2E3173556A471DD304B334 /* Pods-powersyncexample.debug.xcconfig */, - 7A4D352CD337FB3A3BF06240 /* Pods-powersyncexample.release.xcconfig */, + 30B06D3467092F6FEB76FF81 /* Pods-powersyncexample.debug.xcconfig */, + 1F64EA95D2C06DD87AAF037C /* Pods-powersyncexample.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -146,14 +146,14 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "powersyncexample" */; buildPhases = ( - 08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */, + 85B4027DBCF604F86A8C696E /* [CP] Check Pods Manifest.lock */, 01820CF66976138D9A5DD430 /* [Expo] Configure project */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - 800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */, - A1719D29411D545557907636 /* [CP] Embed Pods Frameworks */, + BAC714DBE338A9877E1EDF0E /* [CP] Embed Pods Frameworks */, + FB9025BE929D1AE381CD63AF /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -244,7 +244,7 @@ shellPath = /bin/sh; shellScript = "# This script configures Expo modules and generates the modules provider file.\nbash -l -c \"./Pods/Target\\ Support\\ Files/Pods-powersyncexample/expo-configure-project.sh\"\n"; }; - 08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */ = { + 85B4027DBCF604F86A8C696E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -266,7 +266,27 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */ = { + BAC714DBE338A9877E1EDF0E /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-powersyncexample/Pods-powersyncexample-frameworks.sh", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/powersync-sqlite-core/powersync-sqlite-core.framework/powersync-sqlite-core", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/powersync-sqlite-core.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-powersyncexample/Pods-powersyncexample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + FB9025BE929D1AE381CD63AF /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -328,26 +348,6 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-powersyncexample/Pods-powersyncexample-resources.sh\"\n"; showEnvVarsInLog = 0; }; - A1719D29411D545557907636 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-powersyncexample/Pods-powersyncexample-frameworks.sh", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/powersync-sqlite-core/powersync-sqlite-core.framework/powersync-sqlite-core", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/powersync-sqlite-core.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-powersyncexample/Pods-powersyncexample-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -367,7 +367,7 @@ /* Begin XCBuildConfiguration section */ 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6C2E3173556A471DD304B334 /* Pods-powersyncexample.debug.xcconfig */; + baseConfigurationReference = 30B06D3467092F6FEB76FF81 /* Pods-powersyncexample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -400,7 +400,7 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7A4D352CD337FB3A3BF06240 /* Pods-powersyncexample.release.xcconfig */; + baseConfigurationReference = 1F64EA95D2C06DD87AAF037C /* Pods-powersyncexample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; diff --git a/demos/react-native-supabase-todolist/package.json b/demos/react-native-supabase-todolist/package.json index a78cfc13..bd54151e 100644 --- a/demos/react-native-supabase-todolist/package.json +++ b/demos/react-native-supabase-todolist/package.json @@ -10,8 +10,7 @@ "dependencies": { "@azure/core-asynciterator-polyfill": "^1.0.2", "@expo/vector-icons": "^14.0.3", - "@op-engineering/op-sqlite": "^9.1.3", - "@powersync/op-sqlite": "workspace:*", + "@journeyapps/react-native-quick-sqlite": "^2.0.0", "@powersync/attachments": "workspace:*", "@powersync/common": "workspace:*", "@powersync/react": "workspace:*", diff --git a/packages/react-native/src/db/adapters/react-native-quick-sqlite/ReactNativeQuickSQLiteOpenFactory.ts b/packages/react-native/src/db/adapters/react-native-quick-sqlite/ReactNativeQuickSQLiteOpenFactory.ts index c2ac70a0..ac50a7cc 100644 --- a/packages/react-native/src/db/adapters/react-native-quick-sqlite/ReactNativeQuickSQLiteOpenFactory.ts +++ b/packages/react-native/src/db/adapters/react-native-quick-sqlite/ReactNativeQuickSQLiteOpenFactory.ts @@ -16,7 +16,13 @@ export class ReactNativeQuickSqliteOpenFactory implements SQLOpenFactory { * in the options (if provided) * https://github.com/margelo/react-native-quick-sqlite/blob/main/README.md#loading-existing-dbs */ - const rnqs = require('@journeyapps/react-native-quick-sqlite'); + + try { + var rnqs = require('@journeyapps/react-native-quick-sqlite'); + } catch (e) { + throw new Error(`Could not resolve @journeyapps/react-native-quick-sqlite. +To open databases with React Native Quick SQLite please install @journeyapps/react-native-quick-sqlite.`); + } const { dbFilename } = this.options; const openOptions = { location: this.options.dbLocation }; let DB; diff --git a/packages/react-native/src/index.ts b/packages/react-native/src/index.ts index 7c41057a..7f451732 100644 --- a/packages/react-native/src/index.ts +++ b/packages/react-native/src/index.ts @@ -4,7 +4,7 @@ export * from '@powersync/react'; export * from './db/PowerSyncDatabase'; export * from './db/adapters/react-native-quick-sqlite/RNQSDBAdapter'; -export * from './db/adapters/react-native-quick-sqlite//RNQSDBOpenFactory'; +export * from './db/adapters/react-native-quick-sqlite/RNQSDBOpenFactory'; export * from './sync/stream/ReactNativeRemote'; export * from './sync/stream/ReactNativeStreamingSyncImplementation'; export * from './db/adapters/react-native-quick-sqlite/ReactNativeQuickSQLiteOpenFactory'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 01440adf..35afa694 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -767,18 +767,15 @@ importers: '@expo/vector-icons': specifier: ^14.0.3 version: 14.0.3 - '@op-engineering/op-sqlite': - specifier: ^9.1.3 - version: 9.1.3(react-native@0.74.5)(react@18.2.0) + '@journeyapps/react-native-quick-sqlite': + specifier: ^2.0.0 + version: 2.0.0(react-native@0.74.5)(react@18.2.0) '@powersync/attachments': specifier: workspace:* version: link:../../packages/attachments '@powersync/common': specifier: workspace:* version: link:../../packages/common - '@powersync/op-sqlite': - specifier: workspace:* - version: link:../../packages/powersync-op-sqlite '@powersync/react': specifier: workspace:* version: link:../../packages/react @@ -12743,16 +12740,6 @@ packages: deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dev: true - /@op-engineering/op-sqlite@9.1.3(react-native@0.74.5)(react@18.2.0): - resolution: {integrity: sha512-yOdJiystmGaf9x4PfgwhdTJhmicVoPOdSJXZ7gkEXZBGnCYWNL4oMq2FuGAnPclfVKMipne2PRHVKscZ+oC6sA==} - peerDependencies: - react: '*' - react-native: '>0.73.0' - dependencies: - react: 18.2.0 - react-native: 0.74.5(@babel/core@7.24.5)(@babel/preset-env@7.25.4)(@types/react@18.2.79)(react@18.2.0) - dev: false - /@op-engineering/op-sqlite@9.1.3(react-native@0.75.3)(react@18.3.1): resolution: {integrity: sha512-yOdJiystmGaf9x4PfgwhdTJhmicVoPOdSJXZ7gkEXZBGnCYWNL4oMq2FuGAnPclfVKMipne2PRHVKscZ+oC6sA==} peerDependencies: