@trainstar/synchro-react-native 0.4.0-rc.3 → 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 +35 -5
- package/SynchroReactNative.podspec +2 -1
- package/android/build.gradle +8 -7
- package/ios/SynchroModule.swift +776 -540
- 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 +93 -72
- package/ios-tests/TransactionSessionTests.swift +167 -12
- package/package.json +4 -1
- 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,6 +2,9 @@
|
|
|
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
10
|
- React Native `>=0.82.1 <0.89.0` and React `>=19.1.1 <20.0.0`.
|
|
@@ -11,15 +14,17 @@ React Native TurboModule bridge for Synchro. The package wraps the native Swift
|
|
|
11
14
|
- iOS `17.0+`
|
|
12
15
|
- Android `minSdk 24`
|
|
13
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.
|
|
14
19
|
|
|
15
20
|
## Installation
|
|
16
21
|
|
|
17
|
-
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,
|
|
18
23
|
use the local artifact flow in
|
|
19
24
|
[Client Consumption](https://trainstar.github.io/synchro/clients/consumption/).
|
|
20
25
|
|
|
21
26
|
```sh
|
|
22
|
-
npm install @trainstar/synchro-react-native@0.4.0-rc.
|
|
27
|
+
npm install @trainstar/synchro-react-native@0.4.0-rc.4
|
|
23
28
|
```
|
|
24
29
|
|
|
25
30
|
Apply the delivered React Native CLI correction after each fresh npm install and
|
|
@@ -47,6 +52,31 @@ adds its fixed source-extension glob. It also preserves the CLI's authored
|
|
|
47
52
|
temporary-cache suffix patterns while treating the host temporary directory as
|
|
48
53
|
a literal prefix. It does not change the upstream version.
|
|
49
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
|
+
|
|
50
80
|
Applications that use `bunyamin` 1.6.3 with `stream-json` 1.9.1 must also apply
|
|
51
81
|
the delivered correction before they run that tooling:
|
|
52
82
|
|
|
@@ -70,11 +100,11 @@ TypeScript build-info paths with its installed `fs-extra` literal operation.
|
|
|
70
100
|
It rejects the current project directory and paths outside it before removal.
|
|
71
101
|
It does not change compilation or TypeScript generation.
|
|
72
102
|
|
|
73
|
-
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
|
|
74
104
|
application `ios/Podfile`:
|
|
75
105
|
|
|
76
106
|
```ruby
|
|
77
|
-
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'
|
|
78
108
|
pod 'GRDB.swift', :git => 'https://github.com/groue/GRDB.swift.git', :tag => 'v7.8.0'
|
|
79
109
|
```
|
|
80
110
|
|
|
@@ -264,7 +294,7 @@ When one mutation in a group does not apply, the server applies no mutation of t
|
|
|
264
294
|
|
|
265
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.
|
|
266
296
|
|
|
267
|
-
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:
|
|
268
298
|
|
|
269
299
|
1. Install the `0.4.0` extension and adapter on the server.
|
|
270
300
|
2. Release the client code that calls `atomicWriteTransaction()`.
|
|
@@ -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"]
|
|
@@ -23,7 +24,7 @@ Pod::Spec.new do |s|
|
|
|
23
24
|
install_modules_dependencies(s)
|
|
24
25
|
|
|
25
26
|
s.app_spec "TestHost" do |app_spec|
|
|
26
|
-
app_spec.source_files = "ios-test-host/
|
|
27
|
+
app_spec.source_files = ["ios-test-host/AppDelegate.m", "ios-test-host/main.swift"]
|
|
27
28
|
app_spec.info_plist = {
|
|
28
29
|
"UIApplicationSceneManifest" => {
|
|
29
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 {
|