@dittolive/ditto 4.7.4 → 4.8.0-rc.2

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.
Files changed (126) hide show
  1. package/DittoReactNative.podspec +33 -2
  2. package/README.md +2 -2
  3. package/node/ditto.cjs.js +341 -376
  4. package/node/ditto.darwin-arm64.node +0 -0
  5. package/node/ditto.darwin-x64.node +0 -0
  6. package/node/ditto.linux-arm.node +0 -0
  7. package/node/ditto.linux-arm64.node +0 -0
  8. package/node/ditto.linux-x64.node +0 -0
  9. package/node/ditto.win32-x64.node +0 -0
  10. package/package.json +2 -2
  11. package/react-native/android/build.gradle +24 -64
  12. package/react-native/android/cpp-adapter.cpp +37 -104
  13. package/react-native/android/src/main/AndroidManifestNew.xml +2 -0
  14. package/react-native/android/src/main/java/com/dittolive/rnsdk/DittoRNSDKModule.java +5 -70
  15. package/react-native/cpp/include/ConnectionRequest.h +1 -1
  16. package/react-native/cpp/include/IO.h +2 -0
  17. package/react-native/cpp/include/Logger.h +2 -1
  18. package/react-native/cpp/include/Misc.h +1 -0
  19. package/react-native/cpp/include/main.h +4 -2
  20. package/react-native/cpp/src/Attachment.cpp +1 -3
  21. package/react-native/cpp/src/ConnectionRequest.cpp +1 -1
  22. package/react-native/cpp/src/IO.cpp +79 -0
  23. package/react-native/cpp/src/Logger.cpp +63 -0
  24. package/react-native/cpp/src/Misc.cpp +21 -0
  25. package/react-native/cpp/src/main.cpp +10 -4
  26. package/react-native/ditto.es6.js +2 -0
  27. package/react-native/dittoffi/dittoffi.h +137 -40
  28. package/react-native/ios/DittoRNSDK.mm +19 -124
  29. package/react-native.config.js +2 -1
  30. package/types/ditto.d.ts +2412 -2032
  31. package/web/ditto.es6.js +1 -1
  32. package/web/ditto.umd.js +1 -1
  33. package/web/ditto.wasm +0 -0
  34. package/node/transports.darwin-arm64.node +0 -0
  35. package/node/transports.darwin-x64.node +0 -0
  36. package/react-native/android/.gradle/8.9/checksums/checksums.lock +0 -0
  37. package/react-native/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  38. package/react-native/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  39. package/react-native/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  40. package/react-native/android/.gradle/8.9/gc.properties +0 -0
  41. package/react-native/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  42. package/react-native/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  43. package/react-native/android/.gradle/vcs-1/gc.properties +0 -0
  44. package/react-native/lib/commonjs/ditto.rn.js +0 -93
  45. package/react-native/lib/commonjs/ditto.rn.js.map +0 -1
  46. package/react-native/lib/commonjs/index.js +0 -61
  47. package/react-native/lib/commonjs/index.js.map +0 -1
  48. package/react-native/lib/module/ditto.rn.js +0 -89
  49. package/react-native/lib/module/ditto.rn.js.map +0 -1
  50. package/react-native/lib/module/index.js +0 -27
  51. package/react-native/lib/module/index.js.map +0 -1
  52. package/react-native/lib/typescript/ditto.rn.d.ts +0 -15
  53. package/react-native/lib/typescript/ditto.rn.d.ts.map +0 -1
  54. package/react-native/lib/typescript/index.d.ts +0 -1
  55. package/react-native/lib/typescript/index.d.ts.map +0 -1
  56. package/react-native/src/ditto.rn.ts +0 -123
  57. package/react-native/src/environment/environment.fallback.ts +0 -4
  58. package/react-native/src/index.ts +0 -29
  59. package/react-native/src/sources/@cbor-redux.ts +0 -2
  60. package/react-native/src/sources/@ditto.core.ts +0 -1
  61. package/react-native/src/sources/@environment.ts +0 -1
  62. package/react-native/src/sources/attachment-fetch-event.ts +0 -54
  63. package/react-native/src/sources/attachment-fetcher-manager.ts +0 -145
  64. package/react-native/src/sources/attachment-fetcher.ts +0 -265
  65. package/react-native/src/sources/attachment-token.ts +0 -129
  66. package/react-native/src/sources/attachment.ts +0 -121
  67. package/react-native/src/sources/augment.ts +0 -108
  68. package/react-native/src/sources/authenticator.ts +0 -314
  69. package/react-native/src/sources/base-pending-cursor-operation.ts +0 -255
  70. package/react-native/src/sources/base-pending-id-specific-operation.ts +0 -112
  71. package/react-native/src/sources/bridge.ts +0 -557
  72. package/react-native/src/sources/build-time-constants.ts +0 -8
  73. package/react-native/src/sources/cbor.ts +0 -20
  74. package/react-native/src/sources/collection-interface.ts +0 -73
  75. package/react-native/src/sources/collection.ts +0 -219
  76. package/react-native/src/sources/collections-event.ts +0 -99
  77. package/react-native/src/sources/connection-request.ts +0 -142
  78. package/react-native/src/sources/counter.ts +0 -82
  79. package/react-native/src/sources/ditto.ts +0 -991
  80. package/react-native/src/sources/document-id.ts +0 -163
  81. package/react-native/src/sources/document-path.ts +0 -308
  82. package/react-native/src/sources/document.ts +0 -237
  83. package/react-native/src/sources/epilogue.ts +0 -32
  84. package/react-native/src/sources/error-codes.ts +0 -114
  85. package/react-native/src/sources/error.ts +0 -256
  86. package/react-native/src/sources/essentials.ts +0 -81
  87. package/react-native/src/sources/ffi-error.ts +0 -134
  88. package/react-native/src/sources/ffi.ts +0 -2190
  89. package/react-native/src/sources/identity.ts +0 -163
  90. package/react-native/src/sources/init.ts +0 -71
  91. package/react-native/src/sources/internal.ts +0 -143
  92. package/react-native/src/sources/keep-alive.ts +0 -73
  93. package/react-native/src/sources/key-path.ts +0 -198
  94. package/react-native/src/sources/live-query-event.ts +0 -208
  95. package/react-native/src/sources/live-query-manager.ts +0 -110
  96. package/react-native/src/sources/live-query.ts +0 -167
  97. package/react-native/src/sources/logger.ts +0 -196
  98. package/react-native/src/sources/main.ts +0 -61
  99. package/react-native/src/sources/observer-manager.ts +0 -185
  100. package/react-native/src/sources/observer.ts +0 -79
  101. package/react-native/src/sources/pending-collections-operation.ts +0 -241
  102. package/react-native/src/sources/pending-cursor-operation.ts +0 -218
  103. package/react-native/src/sources/pending-id-specific-operation.ts +0 -218
  104. package/react-native/src/sources/presence-manager.ts +0 -170
  105. package/react-native/src/sources/presence.ts +0 -427
  106. package/react-native/src/sources/query-result-item.ts +0 -131
  107. package/react-native/src/sources/query-result.ts +0 -55
  108. package/react-native/src/sources/register.ts +0 -95
  109. package/react-native/src/sources/small-peer-info.ts +0 -166
  110. package/react-native/src/sources/static-tcp-client.ts +0 -8
  111. package/react-native/src/sources/store-observer.ts +0 -170
  112. package/react-native/src/sources/store.ts +0 -630
  113. package/react-native/src/sources/subscription-manager.ts +0 -99
  114. package/react-native/src/sources/subscription.ts +0 -89
  115. package/react-native/src/sources/sync-subscription.ts +0 -90
  116. package/react-native/src/sources/sync.ts +0 -561
  117. package/react-native/src/sources/test-helpers.ts +0 -24
  118. package/react-native/src/sources/transport-conditions-manager.ts +0 -104
  119. package/react-native/src/sources/transport-config.ts +0 -430
  120. package/react-native/src/sources/update-result.ts +0 -66
  121. package/react-native/src/sources/update-results-map.ts +0 -65
  122. package/react-native/src/sources/websocket-client.ts +0 -7
  123. package/react-native/src/sources/write-transaction-collection.ts +0 -122
  124. package/react-native/src/sources/write-transaction-pending-cursor-operation.ts +0 -101
  125. package/react-native/src/sources/write-transaction-pending-id-specific-operation.ts +0 -74
  126. package/react-native/src/sources/write-transaction.ts +0 -121
@@ -5,8 +5,13 @@
5
5
  # relative paths work in production somehow. Maybe when RN will stop forcing
6
6
  # the podspec to exist at root level or allow us to modify it via some property.
7
7
  require "json"
8
+ require 'fileutils'
9
+
10
+ framework_path = File.join(File.dirname(__FILE__), 'react-native', 'ios', 'DittoReactNative.xcframework')
11
+ local_framework_exists = File.exist?(framework_path)
8
12
 
9
13
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
14
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
10
15
 
11
16
  Pod::Spec.new do |s|
12
17
  s.name = "DittoReactNative"
@@ -17,11 +22,37 @@ Pod::Spec.new do |s|
17
22
  s.authors = package["author"]
18
23
 
19
24
  s.platforms = { :ios => "14.0" }
20
- s.source = { :http => 'https://ditto.live' }
25
+ s.source = { :http => 'https://ditto.live' }
21
26
 
22
27
  s.source_files = "react-native/ios/**/*.{h,m,mm}", "react-native/cpp/**/*.{h,cpp,hpp}",
28
+ if local_framework_exists
29
+ s.vendored_frameworks = "react-native/ios/DittoReactNative.xcframework"
30
+ else
31
+ s.dependency 'DittoReactNativeIOS', "~> #{package["version"]}"
32
+ end
33
+
23
34
  s.public_header_files = 'react-native/dittoffi/dittoffi.h', 'react-native/dittoffi/ifaddrs.h'
24
35
 
36
+ # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
37
+ # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
38
+ if respond_to?(:install_modules_dependencies, true)
39
+ install_modules_dependencies(s)
40
+ else
25
41
  s.dependency "React-Core"
26
- s.dependency 'DittoReactNativeIOS', "~> #{package["version"]}"
42
+
43
+ # Don't install the dependencies when we run `pod install` in the old architecture.
44
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
45
+ s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
46
+ s.pod_target_xcconfig = {
47
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
48
+ "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
49
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
50
+ }
51
+ s.dependency "React-Codegen"
52
+ s.dependency "RCT-Folly"
53
+ s.dependency "RCTRequired"
54
+ s.dependency "RCTTypeSafety"
55
+ s.dependency "ReactCommon/turbomodule/core"
56
+ end
57
+ end
27
58
  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.7.4**
6
+ Version: **4.8.0-rc.2**
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.7.4/api-reference/) for this particular version.
9
+ [API Reference](https://software.ditto.live/js/Ditto/4.8.0-rc.2/api-reference/) for this particular version.
10
10
 
11
11
  ---
12
12