feat(expo): add an official config plugin for CNG and EAS Build
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- react-native, typescript
- Área
- build-system, mobile
Línea de trabajo
Empieza por la sección Configuration del README, el podspec principal y el script de Gradle de Android para rastrear los switches existentes y la configuración manual. Después, revisa la documentación de Expo config-plugin y CNG antes de definir la superficie del plugin y la cobertura de fixtures. Se considera terminado cuando haya opciones tipadas publicadas, transformaciones nativas idempotentes, pruebas de validación y merge, un fixture limpio de prebuild de iOS/Android y una guía README actualizada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
react-native-nitro-sqlite works in Expo development builds through autolinking, but its optional native build configuration is currently manual:
- iOS FTS5/other SQLite flags require a consumer
Podfilepost_installmutation. - Android flags require
android/gradle.properties(nitroSqliteFlags). - sqlite-vec uses the separate
NITRO_SQLITE_VEC=1/nitroSqliteVec=trueswitches after the companion package is installed. - iOS App Group database storage requires both
RNNitroSQLite_AppGroupinInfo.plistand the Xcode App Groups entitlement. - iOS system SQLite currently requires setting
NITRO_SQLITE_USE_PHONE_VERSION=1while installing pods.
That prevents a complete managed Expo / EAS Build / Continuous Native Generation setup: generated ios and android projects should not need hand-edited Podfiles, Gradle properties, Info.plists, or entitlements.
Expo recommends library-owned config plugins for native setup. A built-in plugin would make the existing supported native capabilities reproducible across local expo prebuild, expo run:*, and EAS Build.
Proposed package surface
Ship a compiled plugin with the core package:
// app.config.ts
export default {
expo: {
plugins: [
[
'react-native-nitro-sqlite',
{
fts5: true,
sqliteVec: false,
ios: {
appGroup: 'group.com.example.shared',
useSystemSqlite: false,
},
sqliteFlags: {
ios: ['SQLITE_ENABLE_GEOPOLY=1'],
android: ['-DSQLITE_ENABLE_GEOPOLY=1'],
},
},
],
],
},
}
Suggested API principles:
fts5?: booleandefaults tofalse; the plugin mapstruetoSQLITE_ENABLE_FTS5=1on both platforms. Keep it opt-in: FTS adds binary size/attack surface and is not required by every database consumer.sqliteFlags?: { ios?: string[]; android?: string[] }is additive/advanced. Validate each entry (KEY=VALUEon iOS,-DKEY=VALUEon Android), de-duplicate it, and reject flags that contradict the library's fixed safety/ABI settings. Do not add a broad arbitrary-string escape hatch that can silently break a build.ios?: { appGroup?: string; useSystemSqlite?: boolean }.appGroupwrites the existingRNNitroSQLite_AppGroupInfo.plist key and adds the exact identifier to the app target'scom.apple.security.application-groupsentitlement. It must preserve existing groups and fail clearly for malformed identifiers.useSystemSqliteshould reproduce the current pod-install setting for the library pod only.sqliteVec?: booleanbelongs to the companionreact-native-nitro-sqlite-vecpackage's plugin, not core. The core plugin may detect that the companion is installed and emit a targeted error / documentation link whensqliteVec: trueis passed, but should not import or hard-depend on it. The companion plugin can delegate shared flag helpers from core and configure both native switches only when the companion package is resolvable.
The first version should intentionally not expose the podspec's performance_mode: it is hard-coded today and its threading semantics need a separate API/safety decision. Likewise, useSystemSqlite should be explicit and documented as a platform-version/feature trade-off, not enabled implicitly.
Native modifications
iOS
- Use
withInfoPlistforRNNitroSQLite_AppGroup. - Use
withEntitlementsPlist(and, only if necessary,withXcodeProject) to merge the App Groups entitlement without removing app-owned entries. - Use the narrowest safe CocoaPods/Podfile-properties mechanism to apply library-scoped C/C++ preprocessor definitions and
NITRO_SQLITE_USE_PHONE_VERSION=1. Do not mutate unrelated targets or overwrite an app'spost_installhook.
Android
- Use
withGradlePropertiesto mergenitroSqliteFlagsinto the existing property without duplicate-Ddefinitions. - The companion plugin owns
nitroSqliteVec=true; it must verify the companion package is installed before enabling it. - No manifest change is expected for core SQLite/FTS/vector configuration.
Acceptance criteria
- The package exposes
app.plugin.jsand typed plugin options, with the plugin build included in published artifacts and compatible with app.config.js/ts/json configuration. - Re-running prebuild is idempotent: no duplicate flags, plist keys, app groups, Podfile edits, or Gradle properties.
- Existing manual configuration remains supported and composes without overrides; conflicts produce actionable errors.
fts5: trueproduces a build whereSELECT sqlite_compileoption_used('ENABLE_FTS5')is true on iOS and Android, and FTS table creation succeeds.- The companion package's plugin reliably enables sqlite-vec on iOS and Android; a build without it leaves the base package vector-free.
ios.appGroupproduces both the Info.plist value consumed by NitroSQLite and the matching app-target entitlement, while preserving pre-existing entitlements.ios.useSystemSqliteproduces a build linked with system SQLite and the docs state which bundled capabilities may differ.- Unit tests cover option validation, platform transformations, merging and idempotency. An Expo example/test fixture runs clean prebuild for iOS and Android and checks generated plist/entitlements/Gradle outputs. CI should run that CNG fixture against the supported Expo SDK range.
- README documents the declarative setup plus the legacy manual setup, explicit rebuild requirement, and EAS Build behavior.
Prior art / context
- Current manual configuration: README “Configuration” section; core podspec and Android Gradle script already read the relevant switches.
- Existing Expo issues appear to be historical build failures (#2, #12, #65, #85, #100) rather than a CNG config-plugin implementation. App Group support was added in #8, but it still requires manual native configuration.
- Expo documentation: https://docs.expo.dev/config-plugins/development-for-libraries/ and https://docs.expo.dev/workflow/continuous-native-generation/
- Lenguaje dominante
- C
- Estrellas
- 579
- Forks
- 53
- Merge medio
- 2 d 3 h
- PR fusionados (30 d)
- 70
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de margelo/react-native-nitro-sqlite
-
feat: bind named SQL parametersAbiertoarea:api area:runtime enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
margelo/react-native-nitro-sqlite#402 ·
Los mantenedores suelen responder en 1 día
-
area:api area:runtime enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
margelo/react-native-nitro-sqlite#401 ·
Los mantenedores suelen responder en 1 día
-
area:api area:runtime enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
margelo/react-native-nitro-sqlite#400 ·
Los mantenedores suelen responder en 1 día
-
area:api area:runtime enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
margelo/react-native-nitro-sqlite#399 ·
Los mantenedores suelen responder en 1 día
-
area:api area:runtime enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
margelo/react-native-nitro-sqlite#398 ·
Los mantenedores suelen responder en 1 día
Todos los issues de margelo/react-native-nitro-sqlite
Issues similares
-
IO.get_env on Node truncates names at embedded NULPosiblemente ocupada @Yi-111-a la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
HigherOrderCO/Bend#1449 · 1 comentario ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
FujiNetWIFI/fujinet-firmware#1872 ·
Los mantenedores suelen responder en 1 día
-
bug C/C++ code
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
webarkit/WebARKitLib#84 ·
Los mantenedores suelen responder en 1 día
-
Bad device URI "://" on network printers. Printing stopped working between 2.4.19 and 2.4.20Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
OpenPrinting/cups#1751 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
obsproject/obs-studio#14013 ·
Los mantenedores suelen responder en 1 día