@dittolive/ditto 4.5.2 → 4.5.4-alpha.1
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/DittoReactNative.podspec +1 -1
- package/README.md +2 -2
- package/node/ditto.cjs.js +1 -1
- package/node/ditto.darwin-arm64.node +0 -0
- package/node/ditto.darwin-x64.node +0 -0
- package/node/ditto.linux-arm.node +0 -0
- package/node/ditto.linux-x64.node +0 -0
- package/node/ditto.win32-x64.node +0 -0
- package/node/transports.darwin-arm64.node +0 -0
- package/node/transports.darwin-x64.node +0 -0
- package/package.json +1 -2
- package/react-native/android/.project +34 -0
- package/react-native/android/build.gradle +2 -2
- package/react-native/lib/commonjs/ditto.rn.js +40 -39
- package/react-native/lib/module/ditto.rn.js +30 -29
- package/web/ditto.es6.js +1 -1
- package/web/ditto.umd.js +1 -1
- package/web/ditto.wasm +0 -0
- package/node/ditto.cjs.js.map +0 -1
- package/node/ditto.cjs.pretty.js +0 -9657
- package/node/ditto.cjs.pretty.js.map +0 -1
- package/types/ditto.d.ts.map +0 -1
- package/web/ditto.es6.js.map +0 -1
- package/web/ditto.es6.pretty.js +0 -12600
- package/web/ditto.es6.pretty.js.map +0 -1
- package/web/ditto.umd.js.map +0 -1
- package/web/ditto.umd.pretty.js +0 -12669
- package/web/ditto.umd.pretty.js.map +0 -1
package/DittoReactNative.podspec
CHANGED
|
@@ -20,6 +20,6 @@ Pod::Spec.new do |s|
|
|
|
20
20
|
s.public_header_files = 'react-native/dittoffi/dittoffi.h', 'react-native/dittoffi/ifaddrs.h'
|
|
21
21
|
|
|
22
22
|
s.dependency "React-Core"
|
|
23
|
-
s.dependency 'DittoReactNativeIOS',
|
|
23
|
+
s.dependency 'DittoReactNativeIOS', "~> #{package["version"]}"
|
|
24
24
|
|
|
25
25
|
end
|
package/README.md
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
_Ditto is a cross-platform SDK that allows mobile, web, and IoT apps to sync
|
|
4
4
|
with and even without connectivity._
|
|
5
5
|
|
|
6
|
-
Version: **4.5.
|
|
6
|
+
Version: **4.5.4-alpha.1**
|
|
7
7
|
|
|
8
8
|
For more information please visit [ditto.live](https://ditto.live), as well as the
|
|
9
|
-
[API Reference](https://software.ditto.live/js/Ditto/4.5.
|
|
9
|
+
[API Reference](https://software.ditto.live/js/Ditto/4.5.4-alpha.1/api-reference/) for this particular version.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
package/node/ditto.cjs.js
CHANGED
|
@@ -1787,7 +1787,7 @@ class AttachmentToken {
|
|
|
1787
1787
|
|
|
1788
1788
|
// NOTE: this is patched up with the actual build version by Jake task
|
|
1789
1789
|
// build:package and has to be a valid semantic version as defined here: https://semver.org.
|
|
1790
|
-
const fullBuildVersionString = '4.5.
|
|
1790
|
+
const fullBuildVersionString = '4.5.4-alpha.1';
|
|
1791
1791
|
|
|
1792
1792
|
//
|
|
1793
1793
|
// Copyright © 2021 DittoLive Incorporated. All rights reserved.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dittolive/ditto",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.4-alpha.1",
|
|
4
4
|
"description": "Ditto is a cross-platform embeddable NoSQL database that can sync with or without an internet connection.",
|
|
5
5
|
"homepage": "https://ditto.live",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"browser/umd": "web/ditto.umd.js",
|
|
36
36
|
"types": "types/ditto.d.ts",
|
|
37
37
|
"react-native": "react-native/src/index.ts",
|
|
38
|
-
|
|
39
38
|
"scripts": {
|
|
40
39
|
"play:web": "npx serve --listen 5285",
|
|
41
40
|
"play:node": "node --experimental-repl-await --unhandled-rejections=strict playground.cjs"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<projectDescription>
|
|
3
|
+
<name>dittolive_ditto</name>
|
|
4
|
+
<comment>Project dittolive_ditto created by Buildship.</comment>
|
|
5
|
+
<projects>
|
|
6
|
+
</projects>
|
|
7
|
+
<buildSpec>
|
|
8
|
+
<buildCommand>
|
|
9
|
+
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
10
|
+
<arguments>
|
|
11
|
+
</arguments>
|
|
12
|
+
</buildCommand>
|
|
13
|
+
<buildCommand>
|
|
14
|
+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
|
15
|
+
<arguments>
|
|
16
|
+
</arguments>
|
|
17
|
+
</buildCommand>
|
|
18
|
+
</buildSpec>
|
|
19
|
+
<natures>
|
|
20
|
+
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
21
|
+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
|
22
|
+
</natures>
|
|
23
|
+
<filteredResources>
|
|
24
|
+
<filter>
|
|
25
|
+
<id>1708460510678</id>
|
|
26
|
+
<name></name>
|
|
27
|
+
<type>30</type>
|
|
28
|
+
<matcher>
|
|
29
|
+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
|
30
|
+
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
|
31
|
+
</matcher>
|
|
32
|
+
</filter>
|
|
33
|
+
</filteredResources>
|
|
34
|
+
</projectDescription>
|
|
@@ -153,7 +153,7 @@ dependencies {
|
|
|
153
153
|
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
|
154
154
|
//noinspection GradleDynamicVersion
|
|
155
155
|
implementation "com.facebook.react:react-native:+"
|
|
156
|
-
implementation "live.ditto:ditto:4.5.
|
|
156
|
+
implementation "live.ditto:ditto:4.5.4-alpha.1"
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
if (isNewArchitectureEnabled()) {
|
|
@@ -169,7 +169,7 @@ task downloadBinaries {
|
|
|
169
169
|
def defaultArchitectures = ['arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64']
|
|
170
170
|
|
|
171
171
|
defaultArchitectures.each { arch ->
|
|
172
|
-
def fileUrl = "https://software.ditto.live/react-native/ditto/4.5.
|
|
172
|
+
def fileUrl = "https://software.ditto.live/react-native/ditto/4.5.4-alpha.1/android/${arch}/libdittoffi.a"
|
|
173
173
|
|
|
174
174
|
new File("${project.projectDir}/../dittoffi/android/${arch}").mkdirs()
|
|
175
175
|
def localFilePath = "${project.projectDir}/../dittoffi/android/${arch}/libdittoffi.a"
|
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict'
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.boxCBytesIntoBuffer = boxCBytesIntoBuffer
|
|
7
|
-
exports.boxCStringIntoString = boxCStringIntoString
|
|
8
|
-
exports.ditto_sdk_transports_init = ditto_sdk_transports_init
|
|
9
|
-
exports.getDeadlockTimeout = getDeadlockTimeout
|
|
10
|
-
exports.getMissingAndroidPermissions = getMissingAndroidPermissions
|
|
11
|
-
exports.setDeadlockTimeout = setDeadlockTimeout
|
|
12
|
-
var _reactNative = require(
|
|
13
|
-
var _weakrefs = require(
|
|
14
|
-
require(
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true,
|
|
5
|
+
})
|
|
6
|
+
exports.boxCBytesIntoBuffer = boxCBytesIntoBuffer
|
|
7
|
+
exports.boxCStringIntoString = boxCStringIntoString
|
|
8
|
+
exports.ditto_sdk_transports_init = ditto_sdk_transports_init
|
|
9
|
+
exports.getDeadlockTimeout = getDeadlockTimeout
|
|
10
|
+
exports.getMissingAndroidPermissions = getMissingAndroidPermissions
|
|
11
|
+
exports.setDeadlockTimeout = setDeadlockTimeout
|
|
12
|
+
var _reactNative = require('react-native')
|
|
13
|
+
var _weakrefs = require('@ungap/weakrefs')
|
|
14
|
+
require('fastestsmallesttextencoderdecoder')
|
|
15
15
|
// import { fullBuildVersionString } from '../../sources/build-time-constants';
|
|
16
16
|
|
|
17
|
-
const dittoCore = global
|
|
18
|
-
const isLoaded = typeof dittoCore.ditto_sdk_transports_init === 'function'
|
|
17
|
+
const dittoCore = global
|
|
18
|
+
const isLoaded = typeof dittoCore.ditto_sdk_transports_init === 'function'
|
|
19
19
|
if (!isLoaded) {
|
|
20
|
-
var _NativeModules$DittoR
|
|
21
|
-
const result = (_NativeModules$DittoR = _reactNative.NativeModules.DittoRNSDK) === null || _NativeModules$DittoR === void 0 ? void 0 : _NativeModules$DittoR.install()
|
|
20
|
+
var _NativeModules$DittoR
|
|
21
|
+
const result = (_NativeModules$DittoR = _reactNative.NativeModules.DittoRNSDK) === null || _NativeModules$DittoR === void 0 ? void 0 : _NativeModules$DittoR.install()
|
|
22
22
|
if (!result) {
|
|
23
|
-
throw new Error('JSI bindings were not installed for: DittoRNSDK Module')
|
|
23
|
+
throw new Error('JSI bindings were not installed for: DittoRNSDK Module')
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
setInterval(() => {
|
|
27
|
-
dittoCore.ditto_tick()
|
|
28
|
-
}, 50)
|
|
27
|
+
dittoCore.ditto_tick()
|
|
28
|
+
}, 50)
|
|
29
29
|
|
|
30
30
|
// Stay as close as possible to the JS SDK with the API
|
|
31
31
|
// We have to rename the shim that has a different name.
|
|
32
32
|
if (typeof global.FinalizationRegistry === 'undefined' && typeof _weakrefs.FinalizationGroup !== 'undefined') {
|
|
33
|
-
global.FinalizationRegistry = _weakrefs.FinalizationGroup
|
|
33
|
+
global.FinalizationRegistry = _weakrefs.FinalizationGroup
|
|
34
34
|
}
|
|
35
35
|
const platformName = _reactNative.Platform.select({
|
|
36
36
|
ios: 'Ios',
|
|
37
37
|
android: 'Android',
|
|
38
|
-
default: 'Unknown'
|
|
39
|
-
})
|
|
40
|
-
dittoCore.ditto_init_sdk_version(platformName, 'JavaScript', '4.5.
|
|
38
|
+
default: 'Unknown',
|
|
39
|
+
})
|
|
40
|
+
dittoCore.ditto_init_sdk_version(platformName, 'JavaScript', '4.5.3')
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
// Export JSI methods.
|
|
44
44
|
Object.keys(dittoCore)
|
|
45
|
-
// we will provide our own decorated implementation.
|
|
46
|
-
.filter(key => key !== 'ditto_sdk_transports_init')
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
// we will provide our own decorated implementation.
|
|
46
|
+
.filter((key) => key !== 'ditto_sdk_transports_init')
|
|
47
|
+
.forEach((key) => {
|
|
48
|
+
exports[key] = dittoCore[key]
|
|
49
|
+
})
|
|
49
50
|
|
|
50
51
|
// Decorated implementation with an extra step of setting the context for
|
|
51
52
|
// Transports to work on Android.
|
|
52
53
|
function ditto_sdk_transports_init(transportsErrorPointer) {
|
|
53
54
|
if (_reactNative.Platform.OS === 'android') {
|
|
54
|
-
const res = dittoCore.ditto_sdk_transports_set_android_context()
|
|
55
|
+
const res = dittoCore.ditto_sdk_transports_set_android_context()
|
|
55
56
|
if (!res) {
|
|
56
|
-
throw new Error("Couldn't manage to set Android context with `ditto_sdk_transports_set_android_context()`")
|
|
57
|
+
throw new Error("Couldn't manage to set Android context with `ditto_sdk_transports_set_android_context()`")
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
|
-
return dittoCore.ditto_sdk_transports_init(transportsErrorPointer)
|
|
60
|
+
return dittoCore.ditto_sdk_transports_init(transportsErrorPointer)
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
/**
|
|
@@ -67,9 +68,9 @@ function ditto_sdk_transports_init(transportsErrorPointer) {
|
|
|
67
68
|
*/
|
|
68
69
|
function getMissingAndroidPermissions() {
|
|
69
70
|
if (_reactNative.Platform.OS !== 'android') {
|
|
70
|
-
return []
|
|
71
|
+
return []
|
|
71
72
|
}
|
|
72
|
-
return dittoCore.ditto_sdk_transports_android_missing_permissions()
|
|
73
|
+
return dittoCore.ditto_sdk_transports_android_missing_permissions()
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
//
|
|
@@ -77,16 +78,16 @@ function getMissingAndroidPermissions() {
|
|
|
77
78
|
//
|
|
78
79
|
|
|
79
80
|
function boxCStringIntoString(something) {
|
|
80
|
-
return something
|
|
81
|
+
return something
|
|
81
82
|
}
|
|
82
83
|
function boxCBytesIntoBuffer(cborBytes) {
|
|
83
|
-
const bytes = dittoCore.sliceBoxedToUInt8Array(cborBytes)
|
|
84
|
-
return bytes ? new Uint8Array(bytes) : null
|
|
84
|
+
const bytes = dittoCore.sliceBoxedToUInt8Array(cborBytes)
|
|
85
|
+
return bytes ? new Uint8Array(bytes) : null
|
|
85
86
|
}
|
|
86
87
|
function getDeadlockTimeout() {
|
|
87
|
-
return 0
|
|
88
|
+
return 0
|
|
88
89
|
}
|
|
89
90
|
function setDeadlockTimeout(something) {
|
|
90
|
-
return something
|
|
91
|
+
return something
|
|
91
92
|
}
|
|
92
|
-
//# sourceMappingURL=ditto.rn.js.map
|
|
93
|
+
//# sourceMappingURL=ditto.rn.js.map
|
|
@@ -1,58 +1,59 @@
|
|
|
1
|
-
import { NativeModules, Platform } from 'react-native'
|
|
1
|
+
import { NativeModules, Platform } from 'react-native'
|
|
2
2
|
// import { fullBuildVersionString } from '../../sources/build-time-constants';
|
|
3
3
|
|
|
4
4
|
// @ts-ignore No types provided by the 3rd party
|
|
5
|
-
import { FinalizationGroup } from '@ungap/weakrefs'
|
|
6
|
-
import 'fastestsmallesttextencoderdecoder'
|
|
5
|
+
import { FinalizationGroup } from '@ungap/weakrefs'
|
|
6
|
+
import 'fastestsmallesttextencoderdecoder'
|
|
7
7
|
|
|
8
8
|
// import type { Language, Platform as SDKPlatform } from '../../sources/ffi';
|
|
9
9
|
|
|
10
10
|
// No need to define types for each of them as these will not be used anywhere,
|
|
11
11
|
// but rather just pollute and require maintenance. It's good to highlight that
|
|
12
12
|
// these will be exported, though.
|
|
13
|
-
const dittoCore = global
|
|
14
|
-
const isLoaded = typeof dittoCore.ditto_sdk_transports_init === 'function'
|
|
13
|
+
const dittoCore = global
|
|
14
|
+
const isLoaded = typeof dittoCore.ditto_sdk_transports_init === 'function'
|
|
15
15
|
if (!isLoaded) {
|
|
16
|
-
var _NativeModules$DittoR
|
|
17
|
-
const result = (_NativeModules$DittoR = NativeModules.DittoRNSDK) === null || _NativeModules$DittoR === void 0 ? void 0 : _NativeModules$DittoR.install()
|
|
16
|
+
var _NativeModules$DittoR
|
|
17
|
+
const result = (_NativeModules$DittoR = NativeModules.DittoRNSDK) === null || _NativeModules$DittoR === void 0 ? void 0 : _NativeModules$DittoR.install()
|
|
18
18
|
if (!result) {
|
|
19
|
-
throw new Error('JSI bindings were not installed for: DittoRNSDK Module')
|
|
19
|
+
throw new Error('JSI bindings were not installed for: DittoRNSDK Module')
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
setInterval(() => {
|
|
23
|
-
dittoCore.ditto_tick()
|
|
24
|
-
}, 50)
|
|
23
|
+
dittoCore.ditto_tick()
|
|
24
|
+
}, 50)
|
|
25
25
|
|
|
26
26
|
// Stay as close as possible to the JS SDK with the API
|
|
27
27
|
// We have to rename the shim that has a different name.
|
|
28
28
|
if (typeof global.FinalizationRegistry === 'undefined' && typeof FinalizationGroup !== 'undefined') {
|
|
29
|
-
global.FinalizationRegistry = FinalizationGroup
|
|
29
|
+
global.FinalizationRegistry = FinalizationGroup
|
|
30
30
|
}
|
|
31
31
|
const platformName = Platform.select({
|
|
32
32
|
ios: 'Ios',
|
|
33
33
|
android: 'Android',
|
|
34
|
-
default: 'Unknown'
|
|
35
|
-
})
|
|
36
|
-
dittoCore.ditto_init_sdk_version(platformName, 'JavaScript', '4.5.
|
|
34
|
+
default: 'Unknown',
|
|
35
|
+
})
|
|
36
|
+
dittoCore.ditto_init_sdk_version(platformName, 'JavaScript', '4.5.3')
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// Export JSI methods.
|
|
40
40
|
Object.keys(dittoCore)
|
|
41
|
-
// we will provide our own decorated implementation.
|
|
42
|
-
.filter(key => key !== 'ditto_sdk_transports_init')
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
// we will provide our own decorated implementation.
|
|
42
|
+
.filter((key) => key !== 'ditto_sdk_transports_init')
|
|
43
|
+
.forEach((key) => {
|
|
44
|
+
exports[key] = dittoCore[key]
|
|
45
|
+
})
|
|
45
46
|
|
|
46
47
|
// Decorated implementation with an extra step of setting the context for
|
|
47
48
|
// Transports to work on Android.
|
|
48
49
|
export function ditto_sdk_transports_init(transportsErrorPointer) {
|
|
49
50
|
if (Platform.OS === 'android') {
|
|
50
|
-
const res = dittoCore.ditto_sdk_transports_set_android_context()
|
|
51
|
+
const res = dittoCore.ditto_sdk_transports_set_android_context()
|
|
51
52
|
if (!res) {
|
|
52
|
-
throw new Error("Couldn't manage to set Android context with `ditto_sdk_transports_set_android_context()`")
|
|
53
|
+
throw new Error("Couldn't manage to set Android context with `ditto_sdk_transports_set_android_context()`")
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
return dittoCore.ditto_sdk_transports_init(transportsErrorPointer)
|
|
56
|
+
return dittoCore.ditto_sdk_transports_init(transportsErrorPointer)
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
/**
|
|
@@ -63,9 +64,9 @@ export function ditto_sdk_transports_init(transportsErrorPointer) {
|
|
|
63
64
|
*/
|
|
64
65
|
export function getMissingAndroidPermissions() {
|
|
65
66
|
if (Platform.OS !== 'android') {
|
|
66
|
-
return []
|
|
67
|
+
return []
|
|
67
68
|
}
|
|
68
|
-
return dittoCore.ditto_sdk_transports_android_missing_permissions()
|
|
69
|
+
return dittoCore.ditto_sdk_transports_android_missing_permissions()
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
//
|
|
@@ -73,16 +74,16 @@ export function getMissingAndroidPermissions() {
|
|
|
73
74
|
//
|
|
74
75
|
|
|
75
76
|
export function boxCStringIntoString(something) {
|
|
76
|
-
return something
|
|
77
|
+
return something
|
|
77
78
|
}
|
|
78
79
|
export function boxCBytesIntoBuffer(cborBytes) {
|
|
79
|
-
const bytes = dittoCore.sliceBoxedToUInt8Array(cborBytes)
|
|
80
|
-
return bytes ? new Uint8Array(bytes) : null
|
|
80
|
+
const bytes = dittoCore.sliceBoxedToUInt8Array(cborBytes)
|
|
81
|
+
return bytes ? new Uint8Array(bytes) : null
|
|
81
82
|
}
|
|
82
83
|
export function getDeadlockTimeout() {
|
|
83
|
-
return 0
|
|
84
|
+
return 0
|
|
84
85
|
}
|
|
85
86
|
export function setDeadlockTimeout(something) {
|
|
86
|
-
return something
|
|
87
|
+
return something
|
|
87
88
|
}
|
|
88
|
-
//# sourceMappingURL=ditto.rn.js.map
|
|
89
|
+
//# sourceMappingURL=ditto.rn.js.map
|