Skip to content

Commit b26d26d

Browse files
committed
chore: remove getBundled related code from module
1 parent 6ef0f47 commit b26d26d

File tree

8 files changed

+9
-97
lines changed

8 files changed

+9
-97
lines changed

packages/powersync-op-sqlite/android/src/main/java/com/powersync/opsqlite/PowerSyncOpSqliteModule.kt

Lines changed: 0 additions & 25 deletions
This file was deleted.

packages/powersync-op-sqlite/android/src/main/java/com/powersync/opsqlite/PowerSyncOpSqlitePackage.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,16 @@ import java.util.HashMap
99

1010
class PowerSyncOpSqlitePackage : TurboReactPackage() {
1111
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
12-
return if (name == PowerSyncOpSqliteModule.NAME) {
13-
PowerSyncOpSqliteModule(reactContext)
14-
} else {
15-
null
16-
}
12+
return null
1713
}
1814

1915
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
2016
return ReactModuleInfoProvider {
2117
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
2218
val isTurboModule: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
23-
moduleInfos[PowerSyncOpSqliteModule.NAME] = ReactModuleInfo(
24-
PowerSyncOpSqliteModule.NAME,
25-
PowerSyncOpSqliteModule.NAME,
19+
moduleInfos["PowerSyncOpSqlite"] = ReactModuleInfo(
20+
"PowerSyncOpSqlite",
21+
"PowerSyncOpSqlite",
2622
false, // canOverrideExistingModule
2723
false, // needsEagerInit
2824
true, // hasConstants

packages/powersync-op-sqlite/android/src/newarch/PowerSyncOpSqliteSpec.kt

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/powersync-op-sqlite/android/src/oldarch/PowerSyncOpSqliteSpec.kt

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/powersync-op-sqlite/ios/PowerSyncOpSqlite.mm

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,4 @@
33
@implementation PowerSyncOpSqlite
44
RCT_EXPORT_MODULE()
55

6-
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getBundlePath)
7-
{
8-
return [NSBundle mainBundle].bundlePath;
9-
}
10-
116
@end

packages/powersync-op-sqlite/src/NativePowerSyncOpSqlite.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/powersync-op-sqlite/src/db/OPSqliteAdapter.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import Lock from 'async-lock';
1717
import { OPSQLiteConnection } from './OPSQLiteConnection';
1818
import { Platform } from 'react-native';
1919
import { SqliteOptions } from './SqliteOptions';
20-
import { getBundlePath } from '..';
2120

2221
/**
2322
* Adapter for React Native Quick SQLite
@@ -149,8 +148,7 @@ export class OPSQLiteDBAdapter extends BaseObserver<DBAdapterListener> implement
149148

150149
private async loadPowerSyncExtension(DB: DB) {
151150
if (Platform.OS === 'ios') {
152-
const bundlePath: string = getBundlePath();
153-
const libPath = `${bundlePath}/Frameworks/powersync-sqlite-core.framework/powersync-sqlite-core`;
151+
const libPath = getDylibPath('co.powersync.sqlitecore', 'powersync-sqlite-core');
154152
DB.loadExtension(libPath, 'sqlite3_powersync_init');
155153
} else {
156154
DB.loadExtension('libpowersync', 'sqlite3_powersync_init');
Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,4 @@
1-
import { NativeModules, Platform } from 'react-native';
2-
3-
const LINKING_ERROR =
4-
`The package '@powersync/op-sqlite' doesn't seem to be linked. Make sure: \n\n` +
5-
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
6-
'- You rebuilt the app after installing the package\n' +
7-
'- You are not using Expo Go\n';
8-
9-
const isTurboModuleEnabled = global.__turboModuleProxy != null;
10-
11-
const PowerSyncOpSqliteModule = isTurboModuleEnabled
12-
? require('./NativePowerSyncOpSqlite').default
13-
: NativeModules.PowerSyncOpSqlite;
14-
15-
const PowerSyncOpSqlite = PowerSyncOpSqliteModule
16-
? PowerSyncOpSqliteModule
17-
: new Proxy(
18-
{},
19-
{
20-
get() {
21-
throw new Error(LINKING_ERROR);
22-
}
23-
}
24-
);
25-
26-
export function getBundlePath(): string {
27-
return PowerSyncOpSqlite.getBundlePath();
28-
}
29-
30-
export { OPSqliteOpenFactory, OPSQLiteOpenFactoryOptions } from './db/OPSqliteDBOpenFactory';
1+
export {
2+
OPSqliteOpenFactory,
3+
OPSQLiteOpenFactoryOptions
4+
} from './db/OPSqliteDBOpenFactory';

0 commit comments

Comments
 (0)