Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
2d0bba7
feat: Create `packages/react-native-mmkv` nitro module
mrousavy Aug 21, 2025
8072215
Add Example
mrousavy Aug 21, 2025
d004581
Remove current `package/`
mrousavy Aug 21, 2025
e58076d
feat: Add monorepo
mrousavy Aug 21, 2025
954b1f0
feat: Nitrogen specs
mrousavy Aug 21, 2025
3e48f27
Add files
mrousavy Aug 21, 2025
c232e95
Set up MMKV
mrousavy Aug 21, 2025
147cfab
fix
mrousavy Aug 21, 2025
851bf4d
fix: Rename to build
mrousavy Aug 21, 2025
2ea1528
feat: Add spec implementations
mrousavy Aug 21, 2025
817bf74
fix: Public include
mrousavy Aug 21, 2025
f4c05f3
Set up example
mrousavy Aug 21, 2025
4aebc53
Add iOS
mrousavy Aug 21, 2025
6e9e73b
This is what you need to your app to make it build??
mrousavy Aug 21, 2025
1b1207b
Implement MMKV
mrousavy Aug 21, 2025
463d69f
fix: Fix cannot default-construct HybridObject error
mrousavy Aug 21, 2025
af59a2c
gitignore
mrousavy Aug 21, 2025
cee36d1
Path theoretically cannot be empty
mrousavy Aug 21, 2025
6541044
Expose default ID natively
mrousavy Aug 21, 2025
b60251c
It finally inits!
mrousavy Aug 21, 2025
bad30a5
chore: Clang format
mrousavy Aug 21, 2025
15453e3
Pattern-match types in variant
mrousavy Aug 21, 2025
27ad9b2
feat: Add memory warning and web mock instances
mrousavy Aug 21, 2025
809218a
Use mock instance
mrousavy Aug 21, 2025
74bf6da
feat: Implement `addOnValueChangedListener` natively
mrousavy Aug 21, 2025
bdd4805
chore: Format C++
mrousavy Aug 21, 2025
4d02a65
Clang format
mrousavy Aug 21, 2025
c288634
Update format
mrousavy Aug 21, 2025
0a77f9c
Update .clang-format
mrousavy Aug 21, 2025
efea1ef
Notify on value changed
mrousavy Aug 21, 2025
49b11cb
fix: Update GitHub actions
mrousavy Aug 21, 2025
1dc6d90
Add jest
mrousavy Aug 21, 2025
07e08c8
fix: Add build:android-release script
mrousavy Aug 21, 2025
f1770b0
chore: Add github formatter
mrousavy Aug 21, 2025
c661c17
fix: Use namespace here..? why? idk
mrousavy Aug 21, 2025
aff766a
feat: Implement Android platform context
mrousavy Aug 21, 2025
b908e45
Delete .bundle
mrousavy Aug 21, 2025
cb333f5
feat: Add back hooks
mrousavy Aug 21, 2025
655a200
Add back hooks test
mrousavy Aug 21, 2025
c2fec2d
Add hooks to example again
mrousavy Aug 21, 2025
48475a1
Update App.test.tsx
mrousavy Aug 21, 2025
c90b6cc
fix: Only build 64-bit in example
mrousavy Aug 28, 2025
d034670
fix: Update gemfile order? idk
mrousavy Aug 28, 2025
80343ed
fix: Fix wrong CI names
mrousavy Aug 28, 2025
559050a
fix: Use hermesc from root node_modules
mrousavy Aug 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package/.clang-format → .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

# Standard
BasedOnStyle: llvm
Standard: c++14
Standard: c++20

# Indentation
IndentWidth: 2
ColumnLimit: 100
ColumnLimit: 140

# Includes
SortIncludes: true
SortIncludes: CaseSensitive
SortUsingDeclarations: true

# Pointer and reference alignment
Expand All @@ -20,7 +20,7 @@ ReflowComments: true
# Line breaking options
BreakBeforeBraces: Attach
BreakConstructorInitializers: BeforeColon
AlwaysBreakTemplateDeclarations: true
AllowShortFunctionsOnASingleLine: Empty
IndentCaseLabels: true
NamespaceIndentation: Inner

42 changes: 12 additions & 30 deletions .github/workflows/build-android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: oven-sh/setup-bun@v2

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore node_modules from cache
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile --cwd package
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd package/example
- name: Install npm dependencies (bun)
run: bun install
- name: Install npm dependencies in example/ (bun)
working-directory: example
run: bun install

- name: Setup JDK 17
uses: actions/setup-java@v4
Expand All @@ -38,29 +29,20 @@ jobs:
java-package: jdk

- name: Run Gradle Build for example/android/
working-directory: package/example
run: yarn build:android-release
working-directory: example
run: bun run build:android-release

- name: Upload arm64 APK to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: package/example/android/app/build/outputs/apk/release/app-arm64-v8a-release.apk
asset_name: "MMKVExample-${{ github.event.release.tag_name }}-arm64-v8a.apk"
asset_content_type: application/vnd.android.package-archive
- name: Upload x86_64 APK to Release
- name: Upload APK to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: package/example/android/app/build/outputs/apk/release/app-x86_64-release.apk
asset_name: "MMKVExample-${{ github.event.release.tag_name }}-x86_64.apk"
asset_path: example/android/app/build/outputs/apk/release/app-release.apk
asset_name: "MmkvExample-${{ github.event.release.tag_name }}.apk"
asset_content_type: application/vnd.android.package-archive

# Gradle cache doesn't like daemons
- name: Stop Gradle Daemon
working-directory: package/example/android
working-directory: example/android
run: ./gradlew --stop
102 changes: 71 additions & 31 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,44 @@ on:
- main
paths:
- '.github/workflows/build-android.yml'
- 'package/android/**'
- 'package/cpp/**'
- 'package/MMKV/**'
- 'package/yarn.lock'
- 'package/example/android/**'
- 'package/example/yarn.lock'
- 'example/android/**'
- '**/nitrogen/generated/shared/**'
- '**/nitrogen/generated/android/**'
- 'packages/react-native-nitro-test/cpp/**'
- 'packages/react-native-nitro-test/android/**'
- 'packages/react-native-nitro-test-external/cpp/**'
- 'packages/react-native-nitro-test-external/android/**'
- 'packages/react-native-nitro-modules/cpp/**'
- 'packages/react-native-nitro-modules/android/**'
- '**/bun.lock'
- '**/react-native.config.js'
- '**/nitro.json'
pull_request:
paths:
- '.github/workflows/build-android.yml'
- 'package/android/**'
- 'package/cpp/**'
- 'package/MMKV/**'
- 'package/yarn.lock'
- 'package/example/android/**'
- 'package/example/yarn.lock'
- 'example/android/**'
- '**/nitrogen/generated/shared/**'
- '**/nitrogen/generated/android/**'
- 'packages/react-native-nitro-test/cpp/**'
- 'packages/react-native-nitro-test/android/**'
- 'packages/react-native-nitro-test-external/cpp/**'
- 'packages/react-native-nitro-test-external/android/**'
- 'packages/react-native-nitro-modules/cpp/**'
- 'packages/react-native-nitro-modules/android/**'
- '**/bun.lock'
- '**/react-native.config.js'
- '**/nitro.json'

jobs:
build_example:
name: Build Android Example App
build_new:
name: Build Android Example App (new architecture)
runs-on: ubuntu-latest
defaults:
run:
working-directory: package/
steps:
- uses: actions/checkout@v5
- uses: oven-sh/setup-bun@v2

- name: Install npm dependencies (bun)
run: bun install

- name: Setup JDK 17
uses: actions/setup-java@v4
Expand All @@ -39,30 +52,57 @@ jobs:
java-version: 17
java-package: jdk

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore node_modules from cache
- name: Restore Gradle cache
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd example
${{ runner.os }}-gradle-
- name: Run Gradle Build for example/android/
working-directory: example/android
run: ./gradlew assembleDebug --no-daemon --build-cache

# Gradle cache doesn't like daemons
- name: Stop Gradle Daemon
working-directory: example/android
run: ./gradlew --stop

build_old:
name: Build Android Example App (old architecture)
needs: build_new
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: oven-sh/setup-bun@v2

- name: Install npm dependencies (bun)
run: bun install

- name: Disable new architecture in gradle.properties
run: sed -i "s/newArchEnabled=true/newArchEnabled=false/g" example/android/gradle.properties

- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
java-package: jdk

- name: Restore Gradle cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run Gradle Build for example/android/
run: cd example/android && ./gradlew assembleDebug --build-cache && cd ../..
working-directory: example/android
run: ./gradlew assembleDebug --no-daemon --build-cache

# Gradle cache doesn't like daemons
- name: Stop Gradle Daemon
working-directory: example/android
run: ./gradlew --stop
37 changes: 14 additions & 23 deletions .github/workflows/build-ios-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,20 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- uses: oven-sh/setup-bun@v2

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore node_modules from cache
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile --cwd package
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd package/example
- name: Install npm dependencies (bun)
run: bun install
- name: Install npm dependencies in example/ (bun)
working-directory: example
run: bun install

- name: Setup Ruby (bundle)
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.2
bundler-cache: true
working-directory: package/example
working-directory: example

- name: Select Xcode 16.4
run: sudo xcode-select -s "/Applications/Xcode_16.4.app/Contents/Developer"
Expand All @@ -48,11 +39,11 @@ jobs:
restore-keys: |
${{ runner.os }}-pods-
- name: Install Pods
working-directory: package/example
run: yarn pods
working-directory: example
run: bun pods

- name: Build App (Release, Simulator)
working-directory: package/example/ios
working-directory: example/ios
run: |
set -o pipefail
xcodebuild \
Expand All @@ -68,15 +59,15 @@ jobs:

- name: Package .app for Simulator
run: |
cd package/example/ios/build/Build/Products/Release-iphonesimulator
zip -r ../../../../../../../MmkvExample-Release-Simulator.zip MMKVExample.app
cd example/ios/build/Build/Products/Release-iphonesimulator
zip -r ../../../../../../MmkvExample-Release-Simulator.zip MmkvExample.app

- name: Upload .app to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: MMKVExample-Release-Simulator.zip
asset_name: "MMKVExample-Simulator-${{ github.event.release.tag_name }}.app.zip"
asset_path: MmkvExample-Release-Simulator.zip
asset_name: "MmkvExample-Simulator-${{ github.event.release.tag_name }}.app.zip"
asset_content_type: application/zip
Loading
Loading