@trainstar/synchro-react-native 0.4.0-rc.2 → 0.4.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -10
- package/SynchroReactNative.podspec +3 -1
- package/android/build.gradle +8 -7
- package/android/src/androidTest/kotlin/com/trainstar/synchro/rn/SynchroModuleTransactionTest.kt +7 -10
- package/ios/SynchroModule.swift +953 -713
- package/ios/SynchroOwnership.swift +173 -0
- package/ios-test-host/{main.m → AppDelegate.m} +0 -7
- package/ios-test-host/main.swift +12 -0
- package/ios-tests/SynchroModuleTransactionTests.swift +320 -35
- package/ios-tests/TransactionSessionTests.swift +167 -12
- package/lib/module/NativeSynchro.js.map +1 -1
- package/lib/typescript/src/NativeSynchro.d.ts +13 -14
- package/lib/typescript/src/NativeSynchro.d.ts.map +1 -1
- package/package.json +12 -8
- package/src/NativeSynchro.ts +13 -17
- package/tooling-patches/apply.cjs +82 -1
- package/tooling-patches/react-native-gradle-plugin-0.82.1-kotlin-2.4.21.patch +131 -0
- package/tooling-patches/react-native-gradle-plugin-0.88.0-kotlin-2.4.21.patch +30 -0
package/README.md
CHANGED
|
@@ -2,25 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
React Native TurboModule bridge for Synchro. The package wraps the native Swift and Kotlin SDKs; it does not implement a separate sync engine in JavaScript.
|
|
4
4
|
|
|
5
|
+
The iOS bridge and native Apple SDK compile in Swift 6 language mode.
|
|
6
|
+
Their CocoaPods and Swift Package Manager declarations require Swift 6.
|
|
7
|
+
|
|
5
8
|
## Requirements
|
|
6
9
|
|
|
7
|
-
- React Native `>=0.82.1 <0.
|
|
10
|
+
- React Native `>=0.82.1 <0.89.0` and React `>=19.1.1 <20.0.0`.
|
|
11
|
+
- React Native `0.88.0` requires React `19.3.0` and Node `^22.13.0 || ^24.3.0 || >=26.0.0`.
|
|
8
12
|
- React Native `0.82.1` needs the [fmt 12.1.0 backport](https://trainstar.github.io/synchro/reference/support-policy/#react-native-0821-fmt-backport) with Xcode 27.
|
|
9
|
-
- React Native `0.83.10` contains the fmt correction.
|
|
10
13
|
- Applications built with Xcode 27 must adopt the [UIKit scene lifecycle](https://developer.apple.com/documentation/uikit/transitioning-to-the-uikit-scene-based-life-cycle).
|
|
11
14
|
- iOS `17.0+`
|
|
12
15
|
- Android `minSdk 24`
|
|
13
|
-
- Node `20.19.4+`
|
|
14
16
|
- Android development and CI should use JDK `17`
|
|
17
|
+
- Android builds require the Kotlin `2.4.21`, AGP `9.4.1`, Gradle `9.8.2`, and API `37` host setup.
|
|
18
|
+
- Follow the complete [Android toolchain upgrade](https://trainstar.github.io/synchro/clients/consumption/#android-toolchain-upgrade), including the minimum-RN application changes.
|
|
15
19
|
|
|
16
20
|
## Installation
|
|
17
21
|
|
|
18
|
-
Install the published package only after Synchro `0.4.0-rc.
|
|
22
|
+
Install the published package only after Synchro `0.4.0-rc.4` is available. Before that,
|
|
19
23
|
use the local artifact flow in
|
|
20
24
|
[Client Consumption](https://trainstar.github.io/synchro/clients/consumption/).
|
|
21
25
|
|
|
22
26
|
```sh
|
|
23
|
-
npm install @trainstar/synchro-react-native@0.4.0-rc.
|
|
27
|
+
npm install @trainstar/synchro-react-native@0.4.0-rc.4
|
|
24
28
|
```
|
|
25
29
|
|
|
26
30
|
Apply the delivered React Native CLI correction after each fresh npm install and
|
|
@@ -48,6 +52,31 @@ adds its fixed source-extension glob. It also preserves the CLI's authored
|
|
|
48
52
|
temporary-cache suffix patterns while treating the host temporary directory as
|
|
49
53
|
a literal prefix. It does not change the upstream version.
|
|
50
54
|
|
|
55
|
+
React Native `0.82.1` and `0.88.0` use an included Gradle plugin.
|
|
56
|
+
Current Android validation compiles that plugin with Kotlin `2.4.21` and Kotlin API `2.4` under Gradle `9.8.2`.
|
|
57
|
+
Apply the exact delivered correction after installation and before an Android build:
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
node node_modules/@trainstar/synchro-react-native/tooling-patches/apply.cjs rngp
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The command accepts exactly RN `0.82.1` with RNGP `0.82.1`, or RN `0.88.0` with RNGP `0.88.0`.
|
|
64
|
+
The broad peer-dependency range does not expand these exact correction pairs.
|
|
65
|
+
Each new version requires its actual source identities and consumer validation.
|
|
66
|
+
The command does not migrate application build files.
|
|
67
|
+
It verifies each Kotlin catalog and compiler-options source hash before
|
|
68
|
+
and after it changes the Kotlin compiler and API modes.
|
|
69
|
+
|
|
70
|
+
React Native hosts retain the [current upstream Gradle integration settings](https://github.com/react-native-community/template/blob/0.88-stable/template/android/gradle.properties):
|
|
71
|
+
|
|
72
|
+
```properties
|
|
73
|
+
android.builtInKotlin=false
|
|
74
|
+
android.newDsl=false
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
These settings use the external Kotlin `2.4.21` plugin with AGP `9.4.1`.
|
|
78
|
+
The native Android SDK also validates AGP's built-in Kotlin integration.
|
|
79
|
+
|
|
51
80
|
Applications that use `bunyamin` 1.6.3 with `stream-json` 1.9.1 must also apply
|
|
52
81
|
the delivered correction before they run that tooling:
|
|
53
82
|
|
|
@@ -71,11 +100,11 @@ TypeScript build-info paths with its installed `fs-extra` literal operation.
|
|
|
71
100
|
It rejects the current project directory and paths outside it before removal.
|
|
72
101
|
It does not change compilation or TypeScript generation.
|
|
73
102
|
|
|
74
|
-
Before you run `pod install`, add these published Synchro `0.4.0-rc.
|
|
103
|
+
Before you run `pod install`, add these published Synchro `0.4.0-rc.4` dependencies to the
|
|
75
104
|
application `ios/Podfile`:
|
|
76
105
|
|
|
77
106
|
```ruby
|
|
78
|
-
pod 'Synchro', :git => 'https://github.com/trainstar/synchro.git', :tag => 'v0.4.0-rc.
|
|
107
|
+
pod 'Synchro', :git => 'https://github.com/trainstar/synchro.git', :tag => 'v0.4.0-rc.4'
|
|
79
108
|
pod 'GRDB.swift', :git => 'https://github.com/groue/GRDB.swift.git', :tag => 'v7.8.0'
|
|
80
109
|
```
|
|
81
110
|
|
|
@@ -265,7 +294,7 @@ When one mutation in a group does not apply, the server applies no mutation of t
|
|
|
265
294
|
|
|
266
295
|
After a failed group with a conflict, local state holds the server row for the conflicting member. It holds local values for every other member. The SDK does not revert those local values. Use `inspectRejectedMutations()` to find them and write new intent.
|
|
267
296
|
|
|
268
|
-
The atomic API requires the Synchro `0.4.0-rc.
|
|
297
|
+
The atomic API requires the Synchro `0.4.0-rc.4` extension and adapter. Use this deployment order:
|
|
269
298
|
|
|
270
299
|
1. Install the `0.4.0` extension and adapter on the server.
|
|
271
300
|
2. Release the client code that calls `atomicWriteTransaction()`.
|
|
@@ -295,8 +324,9 @@ The iOS schema bridge rejects malformed JSON with the existing `UNKNOWN` error c
|
|
|
295
324
|
|
|
296
325
|
## Development
|
|
297
326
|
|
|
298
|
-
The published package
|
|
299
|
-
|
|
327
|
+
The published package requires Node `20.19.4` or later.
|
|
328
|
+
React Native `0.88.0` adds the higher Node requirement listed above.
|
|
329
|
+
Repository development uses the Node `22.20.0` pin in `.nvmrc`.
|
|
300
330
|
|
|
301
331
|
```sh
|
|
302
332
|
make lint-rn
|
|
@@ -5,6 +5,7 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
|
5
5
|
Pod::Spec.new do |s|
|
|
6
6
|
s.name = "SynchroReactNative"
|
|
7
7
|
s.version = package["version"]
|
|
8
|
+
s.swift_version = "6.0"
|
|
8
9
|
s.summary = package["description"]
|
|
9
10
|
s.homepage = package["homepage"]
|
|
10
11
|
s.license = package["license"]
|
|
@@ -16,13 +17,14 @@ Pod::Spec.new do |s|
|
|
|
16
17
|
s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
|
|
17
18
|
s.private_header_files = "ios/**/*.h"
|
|
18
19
|
s.compiler_flags = "-Werror=protocol"
|
|
20
|
+
s.libraries = "c++"
|
|
19
21
|
|
|
20
22
|
s.dependency "Synchro", "= #{s.version}"
|
|
21
23
|
|
|
22
24
|
install_modules_dependencies(s)
|
|
23
25
|
|
|
24
26
|
s.app_spec "TestHost" do |app_spec|
|
|
25
|
-
app_spec.source_files = "ios-test-host/
|
|
27
|
+
app_spec.source_files = ["ios-test-host/AppDelegate.m", "ios-test-host/main.swift"]
|
|
26
28
|
app_spec.info_plist = {
|
|
27
29
|
"UIApplicationSceneManifest" => {
|
|
28
30
|
"UIApplicationSupportsMultipleScenes" => false
|
package/android/build.gradle
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
buildscript {
|
|
2
2
|
ext.SynchroReactNative = [
|
|
3
|
-
kotlinVersion: "2.
|
|
3
|
+
kotlinVersion: "2.4.21",
|
|
4
4
|
minSdkVersion: 24,
|
|
5
|
-
compileSdkVersion:
|
|
6
|
-
targetSdkVersion:
|
|
5
|
+
compileSdkVersion: 37,
|
|
6
|
+
targetSdkVersion: 37
|
|
7
7
|
]
|
|
8
8
|
|
|
9
9
|
ext.getExtOrDefault = { prop ->
|
|
@@ -20,19 +20,20 @@ buildscript {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
dependencies {
|
|
23
|
-
classpath "com.android.tools.build:gradle:
|
|
24
|
-
// noinspection DifferentKotlinGradleVersion
|
|
23
|
+
classpath "com.android.tools.build:gradle:9.4.1"
|
|
25
24
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
|
|
30
29
|
apply plugin: "com.android.library"
|
|
31
|
-
|
|
30
|
+
if (rootProject.findProperty("android.builtInKotlin")?.toString() == "false") {
|
|
31
|
+
apply plugin: "kotlin-android"
|
|
32
|
+
}
|
|
32
33
|
|
|
33
34
|
apply plugin: "com.facebook.react"
|
|
34
35
|
|
|
35
|
-
def defaultSynchroVersion = "0.4.0-rc.
|
|
36
|
+
def defaultSynchroVersion = "0.4.0-rc.4"
|
|
36
37
|
def resolvedSynchroVersion = findProperty("synchroVersion")?.toString() ?: defaultSynchroVersion
|
|
37
38
|
|
|
38
39
|
android {
|
package/android/src/androidTest/kotlin/com/trainstar/synchro/rn/SynchroModuleTransactionTest.kt
CHANGED
|
@@ -407,10 +407,7 @@ class SynchroModuleTransactionTest {
|
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
/**
|
|
410
|
-
*
|
|
411
|
-
* @VisibleForTesting subclass. Its legacy-architecture assertion is inert only because the pinned
|
|
412
|
-
* react-android 0.83.0 debug artifact sets UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE to false.
|
|
413
|
-
* This context runs no JavaScript, so these tests do not cover the bridgeless JavaScript host.
|
|
410
|
+
* This context exercises native SQLite calls. The application tests verify JavaScript dispatch.
|
|
414
411
|
*/
|
|
415
412
|
@Suppress("DEPRECATION")
|
|
416
413
|
internal fun bridgeTestContext(context: android.content.Context): BridgeReactContext = BridgeReactContext(context)
|
|
@@ -442,14 +439,14 @@ private class RecordingPromise(val name: String) : Promise {
|
|
|
442
439
|
}
|
|
443
440
|
|
|
444
441
|
override fun resolve(value: Any?) = record { resolved.add(value) }
|
|
445
|
-
override fun reject(code: String
|
|
446
|
-
override fun reject(code: String
|
|
447
|
-
override fun reject(code: String
|
|
442
|
+
override fun reject(code: String?, message: String?) = rejectWith(code, null)
|
|
443
|
+
override fun reject(code: String?, throwable: Throwable?) = rejectWith(code, throwable)
|
|
444
|
+
override fun reject(code: String?, message: String?, throwable: Throwable?) = rejectWith(code, throwable)
|
|
448
445
|
override fun reject(throwable: Throwable) = rejectWith(null, throwable)
|
|
449
446
|
override fun reject(throwable: Throwable, userInfo: WritableMap) = rejectWith(null, throwable)
|
|
450
|
-
override fun reject(code: String
|
|
451
|
-
override fun reject(code: String
|
|
452
|
-
override fun reject(code: String
|
|
447
|
+
override fun reject(code: String?, userInfo: WritableMap) = rejectWith(code, null)
|
|
448
|
+
override fun reject(code: String?, throwable: Throwable?, userInfo: WritableMap) = rejectWith(code, throwable)
|
|
449
|
+
override fun reject(code: String?, message: String?, userInfo: WritableMap) = rejectWith(code, null)
|
|
453
450
|
override fun reject(code: String?, message: String?, throwable: Throwable?, userInfo: WritableMap?) =
|
|
454
451
|
rejectWith(code, throwable)
|
|
455
452
|
|