@hot-updater/react-native 0.20.0-rc.0 → 0.20.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 (34) hide show
  1. package/android/build.gradle +6 -3
  2. package/android/gradle.properties +2 -2
  3. package/android/proguard-rules.pro +2 -0
  4. package/android/src/main/java/com/hotupdater/HotUpdater.kt +1 -11
  5. package/android/src/main/java/com/hotupdater/HotUpdaterFactory.kt +4 -3
  6. package/android/src/main/java/com/hotupdater/HotUpdaterImpl.kt +37 -30
  7. package/android/src/main/java/com/hotupdater/ReactIntegrationManagerBase.kt +0 -3
  8. package/android/src/main/java/com/hotupdater/VersionedPreferencesService.kt +3 -5
  9. package/android/src/main/java/com/hotupdater/ZipFileUnzipService.kt +34 -12
  10. package/android/src/newarch/HotUpdaterModule.kt +4 -8
  11. package/android/src/newarch/HotUpdaterPackage.kt +35 -0
  12. package/android/src/newarch/ReactIntegrationManager.kt +26 -21
  13. package/android/src/oldarch/HotUpdaterModule.kt +1 -2
  14. package/android/src/oldarch/ReactIntegrationManager.kt +7 -26
  15. package/ios/HotUpdater/Internal/HotUpdaterImpl.swift +22 -7
  16. package/ios/HotUpdater/Internal/VersionedPreferencesService.swift +9 -9
  17. package/lib/commonjs/wrap.js +2 -1
  18. package/lib/commonjs/wrap.js.map +1 -1
  19. package/lib/typescript/commonjs/wrap.d.ts +2 -2
  20. package/lib/typescript/module/wrap.d.ts +2 -2
  21. package/package.json +6 -6
  22. package/src/wrap.tsx +2 -2
  23. package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeHotUpdaterSpec.java +0 -94
  24. package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -36
  25. package/android/app/build/generated/source/codegen/jni/HotUpdater-generated.cpp +0 -68
  26. package/android/app/build/generated/source/codegen/jni/HotUpdater.h +0 -31
  27. package/android/app/build/generated/source/codegen/jni/HotUpdaterSpec-generated.cpp +0 -68
  28. package/android/app/build/generated/source/codegen/jni/HotUpdaterSpec.h +0 -31
  29. package/android/app/build/generated/source/codegen/jni/react/renderer/components/HotUpdater/HotUpdaterJSI-generated.cpp +0 -69
  30. package/android/app/build/generated/source/codegen/jni/react/renderer/components/HotUpdater/HotUpdaterJSI.h +0 -168
  31. package/android/app/build/generated/source/codegen/jni/react/renderer/components/HotUpdaterSpec/HotUpdaterSpecJSI-generated.cpp +0 -69
  32. package/android/app/build/generated/source/codegen/jni/react/renderer/components/HotUpdaterSpec/HotUpdaterSpecJSI.h +0 -172
  33. package/ios/HotUpdater/Package.resolved +0 -15
  34. /package/android/src/{main/java/com/hotupdater → oldarch}/HotUpdaterPackage.kt +0 -0
@@ -1,69 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateModuleCpp.js
8
- */
9
-
10
- #include "HotUpdaterSpecJSI.h"
11
-
12
- namespace facebook::react {
13
-
14
- static jsi::Value __hostFunction_NativeHotUpdaterCxxSpecJSI_reload(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
- static_cast<NativeHotUpdaterCxxSpecJSI *>(&turboModule)->reload(
16
- rt
17
- );
18
- return jsi::Value::undefined();
19
- }
20
- static jsi::Value __hostFunction_NativeHotUpdaterCxxSpecJSI_updateBundle(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
21
- return static_cast<NativeHotUpdaterCxxSpecJSI *>(&turboModule)->updateBundle(
22
- rt,
23
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
24
- );
25
- }
26
- static jsi::Value __hostFunction_NativeHotUpdaterCxxSpecJSI_getAppVersion(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
27
- return static_cast<NativeHotUpdaterCxxSpecJSI *>(&turboModule)->getAppVersion(
28
- rt
29
- );
30
- }
31
- static jsi::Value __hostFunction_NativeHotUpdaterCxxSpecJSI_setChannel(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
32
- return static_cast<NativeHotUpdaterCxxSpecJSI *>(&turboModule)->setChannel(
33
- rt,
34
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
35
- );
36
- }
37
- static jsi::Value __hostFunction_NativeHotUpdaterCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
38
- static_cast<NativeHotUpdaterCxxSpecJSI *>(&turboModule)->addListener(
39
- rt,
40
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
41
- );
42
- return jsi::Value::undefined();
43
- }
44
- static jsi::Value __hostFunction_NativeHotUpdaterCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
45
- static_cast<NativeHotUpdaterCxxSpecJSI *>(&turboModule)->removeListeners(
46
- rt,
47
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber()
48
- );
49
- return jsi::Value::undefined();
50
- }
51
- static jsi::Value __hostFunction_NativeHotUpdaterCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
52
- return static_cast<NativeHotUpdaterCxxSpecJSI *>(&turboModule)->getConstants(
53
- rt
54
- );
55
- }
56
-
57
- NativeHotUpdaterCxxSpecJSI::NativeHotUpdaterCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
58
- : TurboModule("HotUpdater", jsInvoker) {
59
- methodMap_["reload"] = MethodMetadata {0, __hostFunction_NativeHotUpdaterCxxSpecJSI_reload};
60
- methodMap_["updateBundle"] = MethodMetadata {1, __hostFunction_NativeHotUpdaterCxxSpecJSI_updateBundle};
61
- methodMap_["getAppVersion"] = MethodMetadata {0, __hostFunction_NativeHotUpdaterCxxSpecJSI_getAppVersion};
62
- methodMap_["setChannel"] = MethodMetadata {1, __hostFunction_NativeHotUpdaterCxxSpecJSI_setChannel};
63
- methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeHotUpdaterCxxSpecJSI_addListener};
64
- methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeHotUpdaterCxxSpecJSI_removeListeners};
65
- methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeHotUpdaterCxxSpecJSI_getConstants};
66
- }
67
-
68
-
69
- } // namespace facebook::react
@@ -1,172 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateModuleH.js
8
- */
9
-
10
- #pragma once
11
-
12
- #include <ReactCommon/TurboModule.h>
13
- #include <react/bridging/Bridging.h>
14
-
15
- namespace facebook::react {
16
-
17
-
18
-
19
- #pragma mark - NativeHotUpdaterUpdateBundleParams
20
-
21
- template <typename P0, typename P1>
22
- struct NativeHotUpdaterUpdateBundleParams {
23
- P0 bundleId;
24
- P1 zipUrl;
25
- bool operator==(const NativeHotUpdaterUpdateBundleParams &other) const {
26
- return bundleId == other.bundleId && zipUrl == other.zipUrl;
27
- }
28
- };
29
-
30
- template <typename T>
31
- struct NativeHotUpdaterUpdateBundleParamsBridging {
32
- static T types;
33
-
34
- static T fromJs(
35
- jsi::Runtime &rt,
36
- const jsi::Object &value,
37
- const std::shared_ptr<CallInvoker> &jsInvoker) {
38
- T result{
39
- bridging::fromJs<decltype(types.bundleId)>(rt, value.getProperty(rt, "bundleId"), jsInvoker),
40
- bridging::fromJs<decltype(types.zipUrl)>(rt, value.getProperty(rt, "zipUrl"), jsInvoker)};
41
- return result;
42
- }
43
-
44
- #ifdef DEBUG
45
- static jsi::String bundleIdToJs(jsi::Runtime &rt, decltype(types.bundleId) value) {
46
- return bridging::toJs(rt, value);
47
- }
48
-
49
- static std::optional<jsi::String> zipUrlToJs(jsi::Runtime &rt, decltype(types.zipUrl) value) {
50
- return bridging::toJs(rt, value);
51
- }
52
- #endif
53
-
54
- static jsi::Object toJs(
55
- jsi::Runtime &rt,
56
- const T &value,
57
- const std::shared_ptr<CallInvoker> &jsInvoker) {
58
- auto result = facebook::jsi::Object(rt);
59
- result.setProperty(rt, "bundleId", bridging::toJs(rt, value.bundleId, jsInvoker));
60
- result.setProperty(rt, "zipUrl", bridging::toJs(rt, value.zipUrl, jsInvoker));
61
- return result;
62
- }
63
- };
64
-
65
- class JSI_EXPORT NativeHotUpdaterCxxSpecJSI : public TurboModule {
66
- protected:
67
- NativeHotUpdaterCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
68
-
69
- public:
70
- virtual void reload(jsi::Runtime &rt) = 0;
71
- virtual jsi::Value updateBundle(jsi::Runtime &rt, jsi::Object params) = 0;
72
- virtual jsi::Value getAppVersion(jsi::Runtime &rt) = 0;
73
- virtual jsi::Value setChannel(jsi::Runtime &rt, jsi::String channel) = 0;
74
- virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0;
75
- virtual void removeListeners(jsi::Runtime &rt, double count) = 0;
76
- virtual jsi::Object getConstants(jsi::Runtime &rt) = 0;
77
-
78
- };
79
-
80
- template <typename T>
81
- class JSI_EXPORT NativeHotUpdaterCxxSpec : public TurboModule {
82
- public:
83
- jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
84
- return delegate_.create(rt, propName);
85
- }
86
-
87
- std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
88
- return delegate_.getPropertyNames(runtime);
89
- }
90
-
91
- static constexpr std::string_view kModuleName = "HotUpdater";
92
-
93
- protected:
94
- NativeHotUpdaterCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
95
- : TurboModule(std::string{NativeHotUpdaterCxxSpec::kModuleName}, jsInvoker),
96
- delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
97
-
98
-
99
- private:
100
- class Delegate : public NativeHotUpdaterCxxSpecJSI {
101
- public:
102
- Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
103
- NativeHotUpdaterCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
104
-
105
- }
106
-
107
- void reload(jsi::Runtime &rt) override {
108
- static_assert(
109
- bridging::getParameterCount(&T::reload) == 1,
110
- "Expected reload(...) to have 1 parameters");
111
-
112
- return bridging::callFromJs<void>(
113
- rt, &T::reload, jsInvoker_, instance_);
114
- }
115
- jsi::Value updateBundle(jsi::Runtime &rt, jsi::Object params) override {
116
- static_assert(
117
- bridging::getParameterCount(&T::updateBundle) == 2,
118
- "Expected updateBundle(...) to have 2 parameters");
119
-
120
- return bridging::callFromJs<jsi::Value>(
121
- rt, &T::updateBundle, jsInvoker_, instance_, std::move(params));
122
- }
123
- jsi::Value getAppVersion(jsi::Runtime &rt) override {
124
- static_assert(
125
- bridging::getParameterCount(&T::getAppVersion) == 1,
126
- "Expected getAppVersion(...) to have 1 parameters");
127
-
128
- return bridging::callFromJs<jsi::Value>(
129
- rt, &T::getAppVersion, jsInvoker_, instance_);
130
- }
131
- jsi::Value setChannel(jsi::Runtime &rt, jsi::String channel) override {
132
- static_assert(
133
- bridging::getParameterCount(&T::setChannel) == 2,
134
- "Expected setChannel(...) to have 2 parameters");
135
-
136
- return bridging::callFromJs<jsi::Value>(
137
- rt, &T::setChannel, jsInvoker_, instance_, std::move(channel));
138
- }
139
- void addListener(jsi::Runtime &rt, jsi::String eventName) override {
140
- static_assert(
141
- bridging::getParameterCount(&T::addListener) == 2,
142
- "Expected addListener(...) to have 2 parameters");
143
-
144
- return bridging::callFromJs<void>(
145
- rt, &T::addListener, jsInvoker_, instance_, std::move(eventName));
146
- }
147
- void removeListeners(jsi::Runtime &rt, double count) override {
148
- static_assert(
149
- bridging::getParameterCount(&T::removeListeners) == 2,
150
- "Expected removeListeners(...) to have 2 parameters");
151
-
152
- return bridging::callFromJs<void>(
153
- rt, &T::removeListeners, jsInvoker_, instance_, std::move(count));
154
- }
155
- jsi::Object getConstants(jsi::Runtime &rt) override {
156
- static_assert(
157
- bridging::getParameterCount(&T::getConstants) == 1,
158
- "Expected getConstants(...) to have 1 parameters");
159
-
160
- return bridging::callFromJs<jsi::Object>(
161
- rt, &T::getConstants, jsInvoker_, instance_);
162
- }
163
-
164
- private:
165
- friend class NativeHotUpdaterCxxSpec;
166
- T *instance_;
167
- };
168
-
169
- Delegate delegate_;
170
- };
171
-
172
- } // namespace facebook::react
@@ -1,15 +0,0 @@
1
- {
2
- "originHash" : "11a19903c341bf413adfdb15a6fb5dff9a819b0557a6cfe9e5fe00f32a0ff74e",
3
- "pins" : [
4
- {
5
- "identity" : "ziparchive",
6
- "kind" : "remoteSourceControl",
7
- "location" : "https://github.com/ZipArchive/ZipArchive.git",
8
- "state" : {
9
- "revision" : "df35718ea19a94e015b91dc4881dee028ce4cdba",
10
- "version" : "2.6.0"
11
- }
12
- }
13
- ],
14
- "version" : 3
15
- }