Expo config plugin for WatermelonDB that includes support for JSI
npx expo install @nozbe/watermelondb @babel/plugin-proposal-decorators
babel.config.js
file to include the decorator plugin:module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: [["@babel/plugin-proposal-decorators", { legacy: true }]],
};
};
npx expo install @expo/config-plugins expo-build-properties
Expo SDK 49:
npx expo install @skam22/watermelondb-expo-plugin@^49.0.0
Expo SDK 50:
npx expo install @skam22/watermelondb-expo-plugin@^50.0.0
Expo SDK 51:
npx expo install @skam22/watermelondb-expo-plugin@^51.0.0
app.json
plugin block to add the following:{
"expo": {
"plugins": [
[
"expo-build-properties",
{
"android": {
"kotlinVersion": "1.8.10",
"compileSdkVersion": 33,
"targetSdkVersion": 33,
"packagingOptions": {
"pickFirst": ["**/libc++_shared.so"]
}
},
"ios": {
"extraPods": [
{
"name": "simdjson",
"configurations": ["Debug", "Release"],
"path": "path_to/node_modules/@nozbe/simdjson",
"modular_headers": true
}
]
}
}
],
"@skam22/watermelondb-expo-plugin"
]
}
}
npx expo run:ios
npx expo run:android
Contributions are very welcome! Current limitations of this plugin:
The modifications to the native files are all accomplished by reading the existing contents of the document, searching for an existing line to anchor around, inserting the modification, and then saving the file.
If the structure/contents/spelling of these default files change in future versions of react native or expo in any way, these plugin modifications will fail.
For example, android/settings.gradle
references the line:
include ':app'
android/app/build.gradle
references the line:
def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true";
android/app/proguard-rules.pro
references the line
# Add any project specific keep options here: