@ionic/portals-react-native 0.5.1 → 0.6.0
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/ReactNativePortals.podspec +39 -14
- package/android/build.gradle +78 -108
- package/android/gradle.properties +5 -3
- package/android/src/main/java/io/ionic/portals/reactnative/PortalView.kt +11 -8
- package/android/src/main/java/io/ionic/portals/reactnative/ReactNativePortalManager.kt +37 -16
- package/android/src/main/java/io/ionic/portals/reactnative/ReactNativePortalsModule.kt +2 -3
- package/android/src/main/java/io/ionic/portals/reactnative/ReactNativeWebVitalsModule.kt +11 -19
- package/ios/IonicPortals+Codable.swift +77 -0
- package/ios/LiveUpdateManager+Async.swift +16 -46
- package/ios/Podfile +29 -4
- package/ios/Podfile.lock +478 -241
- package/ios/Portal.swift +50 -54
- package/ios/PortalView.swift +26 -8
- package/ios/PortalsConfig.swift +1 -88
- package/ios/PortalsReactNative-Bridging-Header.h +2 -0
- package/ios/PortalsReactNative.swift +41 -36
- package/ios/SyncResult+SyncError+Encodable.swift +55 -0
- package/ios/WebVitals.swift +19 -26
- package/package.json +62 -43
- package/src/{PortalView.android.tsx → BasePortalView.android.tsx} +2 -3
- package/src/{PortalView.tsx → BasePortalView.tsx} +2 -3
- package/src/{index.ts → index.tsx} +77 -39
- package/ios/LiveUpdate+Dict.swift +0 -30
- package/ios/LiveUpdateManagerError+Dict.swift +0 -19
- package/ios/ReactNativePortals.xcodeproj/project.pbxproj +0 -465
- package/ios/ReactNativePortals.xcodeproj/xcshareddata/xcschemes/ReactNativePortals.xcscheme +0 -67
- package/ios/ReactNativePortals.xcworkspace/contents.xcworkspacedata +0 -10
- package/ios/ReactNativePortals.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/SyncResult+Dict.swift +0 -35
- package/lib/commonjs/PortalView.android.js +0 -28
- package/lib/commonjs/PortalView.android.js.map +0 -1
- package/lib/commonjs/PortalView.js +0 -15
- package/lib/commonjs/PortalView.js.map +0 -1
- package/lib/commonjs/index.js +0 -200
- package/lib/commonjs/index.js.map +0 -1
- package/lib/module/PortalView.android.js +0 -20
- package/lib/module/PortalView.android.js.map +0 -1
- package/lib/module/PortalView.js +0 -8
- package/lib/module/PortalView.js.map +0 -1
- package/lib/module/index.js +0 -176
- package/lib/module/index.js.map +0 -1
- package/lib/typescript/PortalView.android.d.ts +0 -4
- package/lib/typescript/PortalView.d.ts +0 -4
- package/lib/typescript/index.d.ts +0 -181
- /package/ios/{PortalManager.m → PortalManager.mm} +0 -0
- /package/ios/{PortalView.m → PortalView.mm} +0 -0
- /package/ios/{PortalWebVitals.m → PortalWebVitals.mm} +0 -0
- /package/ios/{PortalsPubSub.m → PortalsPubSub.mm} +0 -0
|
@@ -7,63 +7,33 @@
|
|
|
7
7
|
//
|
|
8
8
|
|
|
9
9
|
import IonicLiveUpdates
|
|
10
|
+
import Capacitor
|
|
10
11
|
|
|
11
|
-
struct SyncResults {
|
|
12
|
+
struct SyncResults: Encodable {
|
|
12
13
|
var results: [LiveUpdateManager.SyncResult]
|
|
13
|
-
var errors: [LiveUpdateManager.
|
|
14
|
+
var errors: [LiveUpdateManager.SyncError]
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
extension SyncResults {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
init(_ results: ([LiveUpdateManager.SyncResult], [LiveUpdateManager.SyncError])) {
|
|
19
|
+
self.results = results.0
|
|
20
|
+
self.errors = results.1
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var dict: JSValue {
|
|
24
|
+
get throws {
|
|
25
|
+
try JSValueEncoder(optionalEncodingStrategy: .undefined)
|
|
26
|
+
.encode(self)
|
|
27
|
+
}
|
|
22
28
|
}
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
extension LiveUpdateManager {
|
|
26
32
|
func syncSome(_ appIds: [String]) async -> SyncResults {
|
|
27
|
-
await
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
private func _syncSome(_ appIds: [String]) -> AsyncStream<Result<LiveUpdateManager.SyncResult, LiveUpdateManager.Error>> {
|
|
31
|
-
AsyncStream { continuation in
|
|
32
|
-
sync(appIds: appIds, isParallel: true) {
|
|
33
|
-
continuation.finish()
|
|
34
|
-
} appComplete: { result in
|
|
35
|
-
continuation.yield(result)
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
func syncAll() async -> SyncResults {
|
|
41
|
-
await _syncAll().syncResults
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
private func _syncAll() -> AsyncStream<Result<LiveUpdateManager.SyncResult, LiveUpdateManager.Error>> {
|
|
46
|
-
AsyncStream { continuation in
|
|
47
|
-
sync(isParallel: true) {
|
|
48
|
-
continuation.finish()
|
|
49
|
-
} appComplete: { result in
|
|
50
|
-
continuation.yield(result)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
33
|
+
SyncResults(await sync(appIds: appIds))
|
|
53
34
|
}
|
|
54
|
-
}
|
|
55
35
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
get async {
|
|
59
|
-
await reduce(into: SyncResults(results: [], errors: [])) { acc, next in
|
|
60
|
-
switch next {
|
|
61
|
-
case .success(let liveUpdate):
|
|
62
|
-
acc.results.append(liveUpdate)
|
|
63
|
-
case .failure(let error):
|
|
64
|
-
acc.errors.append(error)
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
36
|
+
func syncAll() async -> SyncResults {
|
|
37
|
+
SyncResults(await sync())
|
|
68
38
|
}
|
|
69
39
|
}
|
package/ios/Podfile
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require_relative '../node_modules/react-native/scripts/react_native_pods'
|
|
2
4
|
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
|
|
3
5
|
|
|
@@ -6,9 +8,32 @@ platform :ios, '14.0'
|
|
|
6
8
|
target 'ReactNativePortals' do
|
|
7
9
|
# Comment the next line if you don't want to use dynamic frameworks
|
|
8
10
|
config = use_native_modules!
|
|
9
|
-
|
|
10
|
-
use_react_native!(path: config['reactNativePath'])
|
|
11
|
+
use_react_native!(path: config[:reactNativePath])
|
|
11
12
|
# Pods for ReactNativePortals
|
|
12
|
-
pod 'IonicPortals', '~> 0.
|
|
13
|
-
pod 'IonicLiveUpdates', '~> 0.
|
|
13
|
+
pod 'IonicPortals', '~> 0.11.0'
|
|
14
|
+
pod 'IonicLiveUpdates', '~> 0.5.2'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
dynamic_frameworks = ['Capacitor', 'CapacitorCordova']
|
|
18
|
+
|
|
19
|
+
pre_install do |installer|
|
|
20
|
+
installer.pod_targets.each do |pod|
|
|
21
|
+
if dynamic_frameworks.include?(pod.name)
|
|
22
|
+
def pod.static_framework?
|
|
23
|
+
false
|
|
24
|
+
end
|
|
25
|
+
def pod.build_type
|
|
26
|
+
Pod::BuildType.dynamic_framework
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
post_install do |installer|
|
|
33
|
+
installer.pods_project.targets.each do |target|
|
|
34
|
+
target.build_configurations.each do |config|
|
|
35
|
+
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)',
|
|
36
|
+
'_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
|
|
37
|
+
end
|
|
38
|
+
end
|
|
14
39
|
end
|