Skip to content

Migrate to new arch#595

Open
vgirbes wants to merge 1 commit into
andpor:masterfrom
vgirbes:master
Open

Migrate to new arch#595
vgirbes wants to merge 1 commit into
andpor:masterfrom
vgirbes:master

Conversation

@vgirbes
Copy link
Copy Markdown

@vgirbes vgirbes commented May 12, 2026

We have a react-native application which needs to be upgraded to 0.82v. We needed to adapt the react-native-sqlite-storage to be able to use it with react-native new architecture. These are the changes we've made to adapt the library with Claude Code help.

Changes in the local library (react-native-sqlite-storage/)

Required because the published v6.1.0 does not compile against React Native 0.82 + New Architecture.


File: platforms/android/build.gradle
Change: Added apply plugin: 'com.facebook.react' (only when New Architecture is enabled), react { libraryName, codegenJavaPackageName, jsRootDir } block, srcDirs for codegen, and buildConfigField for IS_NEW_ARCHITECTURE_ENABLED.
Reason: Without these changes, the codegen step was not executed and NativeSQLiteSpec.java was never generated.


File: SQLitePluginPackage.java
Change: Replaced ReactFeatureFlags.useTurboModules with BuildConfig.IS_NEW_ARCHITECTURE_ENABLED.
Reason: The previous API was removed in React Native 0.81+.


File: SQLitePlugin.java
Change: Removed the getName() override.
Reason: The method is now generated as final by the codegen process.


Files: src/specs/NativeSQLite.ts, SQLitePlugin.java, lib/sqlite.core.js
Change: Renamed the bridge method from delete to deleteDb.
Reason: delete is a reserved keyword in C++, causing the generated JSI bindings to fail compilation. The public JS API remains unchanged (SQLite.deleteDatabase(...) is still used).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant