@dittolive/ditto 4.7.3 → 4.8.0-rc.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.
Files changed (118) hide show
  1. package/DittoReactNative.podspec +33 -2
  2. package/README.md +2 -2
  3. package/node/ditto.cjs.js +326 -374
  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 +10 -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 +2399 -2029
  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/lib/commonjs/ditto.rn.js +0 -93
  37. package/react-native/lib/commonjs/ditto.rn.js.map +0 -1
  38. package/react-native/lib/commonjs/index.js +0 -61
  39. package/react-native/lib/commonjs/index.js.map +0 -1
  40. package/react-native/lib/module/ditto.rn.js +0 -89
  41. package/react-native/lib/module/ditto.rn.js.map +0 -1
  42. package/react-native/lib/module/index.js +0 -27
  43. package/react-native/lib/module/index.js.map +0 -1
  44. package/react-native/lib/typescript/ditto.rn.d.ts +0 -15
  45. package/react-native/lib/typescript/ditto.rn.d.ts.map +0 -1
  46. package/react-native/lib/typescript/index.d.ts +0 -1
  47. package/react-native/lib/typescript/index.d.ts.map +0 -1
  48. package/react-native/src/ditto.rn.ts +0 -123
  49. package/react-native/src/environment/environment.fallback.ts +0 -4
  50. package/react-native/src/index.ts +0 -29
  51. package/react-native/src/sources/@cbor-redux.ts +0 -2
  52. package/react-native/src/sources/@ditto.core.ts +0 -1
  53. package/react-native/src/sources/@environment.ts +0 -1
  54. package/react-native/src/sources/attachment-fetch-event.ts +0 -54
  55. package/react-native/src/sources/attachment-fetcher-manager.ts +0 -145
  56. package/react-native/src/sources/attachment-fetcher.ts +0 -265
  57. package/react-native/src/sources/attachment-token.ts +0 -129
  58. package/react-native/src/sources/attachment.ts +0 -121
  59. package/react-native/src/sources/augment.ts +0 -108
  60. package/react-native/src/sources/authenticator.ts +0 -314
  61. package/react-native/src/sources/base-pending-cursor-operation.ts +0 -255
  62. package/react-native/src/sources/base-pending-id-specific-operation.ts +0 -112
  63. package/react-native/src/sources/bridge.ts +0 -557
  64. package/react-native/src/sources/build-time-constants.ts +0 -8
  65. package/react-native/src/sources/cbor.ts +0 -20
  66. package/react-native/src/sources/collection-interface.ts +0 -73
  67. package/react-native/src/sources/collection.ts +0 -219
  68. package/react-native/src/sources/collections-event.ts +0 -99
  69. package/react-native/src/sources/connection-request.ts +0 -142
  70. package/react-native/src/sources/counter.ts +0 -82
  71. package/react-native/src/sources/ditto.ts +0 -991
  72. package/react-native/src/sources/document-id.ts +0 -163
  73. package/react-native/src/sources/document-path.ts +0 -308
  74. package/react-native/src/sources/document.ts +0 -237
  75. package/react-native/src/sources/epilogue.ts +0 -32
  76. package/react-native/src/sources/error-codes.ts +0 -114
  77. package/react-native/src/sources/error.ts +0 -256
  78. package/react-native/src/sources/essentials.ts +0 -81
  79. package/react-native/src/sources/ffi-error.ts +0 -134
  80. package/react-native/src/sources/ffi.ts +0 -2190
  81. package/react-native/src/sources/identity.ts +0 -163
  82. package/react-native/src/sources/init.ts +0 -71
  83. package/react-native/src/sources/internal.ts +0 -143
  84. package/react-native/src/sources/keep-alive.ts +0 -73
  85. package/react-native/src/sources/key-path.ts +0 -198
  86. package/react-native/src/sources/live-query-event.ts +0 -208
  87. package/react-native/src/sources/live-query-manager.ts +0 -110
  88. package/react-native/src/sources/live-query.ts +0 -167
  89. package/react-native/src/sources/logger.ts +0 -196
  90. package/react-native/src/sources/main.ts +0 -61
  91. package/react-native/src/sources/observer-manager.ts +0 -185
  92. package/react-native/src/sources/observer.ts +0 -79
  93. package/react-native/src/sources/pending-collections-operation.ts +0 -241
  94. package/react-native/src/sources/pending-cursor-operation.ts +0 -218
  95. package/react-native/src/sources/pending-id-specific-operation.ts +0 -218
  96. package/react-native/src/sources/presence-manager.ts +0 -170
  97. package/react-native/src/sources/presence.ts +0 -427
  98. package/react-native/src/sources/query-result-item.ts +0 -131
  99. package/react-native/src/sources/query-result.ts +0 -55
  100. package/react-native/src/sources/register.ts +0 -95
  101. package/react-native/src/sources/small-peer-info.ts +0 -166
  102. package/react-native/src/sources/static-tcp-client.ts +0 -8
  103. package/react-native/src/sources/store-observer.ts +0 -170
  104. package/react-native/src/sources/store.ts +0 -630
  105. package/react-native/src/sources/subscription-manager.ts +0 -99
  106. package/react-native/src/sources/subscription.ts +0 -89
  107. package/react-native/src/sources/sync-subscription.ts +0 -90
  108. package/react-native/src/sources/sync.ts +0 -561
  109. package/react-native/src/sources/test-helpers.ts +0 -24
  110. package/react-native/src/sources/transport-conditions-manager.ts +0 -104
  111. package/react-native/src/sources/transport-config.ts +0 -430
  112. package/react-native/src/sources/update-result.ts +0 -66
  113. package/react-native/src/sources/update-results-map.ts +0 -65
  114. package/react-native/src/sources/websocket-client.ts +0 -7
  115. package/react-native/src/sources/write-transaction-collection.ts +0 -122
  116. package/react-native/src/sources/write-transaction-pending-cursor-operation.ts +0 -101
  117. package/react-native/src/sources/write-transaction-pending-id-specific-operation.ts +0 -74
  118. 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.3**
6
+ Version: **4.8.0-rc.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.7.3/api-reference/) for this particular version.
9
+ [API Reference](https://software.ditto.live/js/Ditto/4.8.0-rc.1/api-reference/) for this particular version.
10
10
 
11
11
  ---
12
12