@dynamic-labs/react-native-extension 4.15.0 → 4.17.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/index.cjs +16 -14
- package/index.js +16 -14
- package/package.json +5 -5
package/index.cjs
CHANGED
|
@@ -14,7 +14,7 @@ var expoLinking = require('expo-linking');
|
|
|
14
14
|
var expoWebBrowser = require('expo-web-browser');
|
|
15
15
|
var expoSecureStore = require('expo-secure-store');
|
|
16
16
|
|
|
17
|
-
var version = "4.
|
|
17
|
+
var version = "4.17.0";
|
|
18
18
|
|
|
19
19
|
function _extends() {
|
|
20
20
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -145,6 +145,19 @@ const WebView = ({
|
|
|
145
145
|
},
|
|
146
146
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- we only care about the unmount callback
|
|
147
147
|
[]);
|
|
148
|
+
const blockAndReloadWebView = react.useCallback(() => {
|
|
149
|
+
var _a;
|
|
150
|
+
/**
|
|
151
|
+
* iOS and Android both may trigger this event when the webview
|
|
152
|
+
* is removed due to memory pressure.
|
|
153
|
+
*
|
|
154
|
+
* When the webview is killed by the OS, the message transport must
|
|
155
|
+
* be blocked to prevent the "No handlers registered" error while
|
|
156
|
+
* the webview is reloading
|
|
157
|
+
*/
|
|
158
|
+
core.messageTransport.block();
|
|
159
|
+
(_a = webViewRef.current) === null || _a === void 0 ? void 0 : _a.reload();
|
|
160
|
+
}, [core, webViewRef]);
|
|
148
161
|
return /*#__PURE__*/jsxRuntime.jsx(reactNativeWebview.WebView, {
|
|
149
162
|
ref: webViewRef,
|
|
150
163
|
source: {
|
|
@@ -155,19 +168,8 @@ const WebView = ({
|
|
|
155
168
|
onMessage: onMessageHandler,
|
|
156
169
|
hideKeyboardAccessoryView: true,
|
|
157
170
|
webviewDebuggingEnabled: _webviewDebuggingEnabled,
|
|
158
|
-
onContentProcessDidTerminate:
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* iOS and Android both may trigger this event when the webview
|
|
162
|
-
* is removed due to memory pressure.
|
|
163
|
-
*
|
|
164
|
-
* When the webview is killed by the OS, the message transport must
|
|
165
|
-
* be blocked to prevent the "No handlers registered" error while
|
|
166
|
-
* the webview is reloading
|
|
167
|
-
*/
|
|
168
|
-
core.messageTransport.block();
|
|
169
|
-
(_a = webViewRef.current) === null || _a === void 0 ? void 0 : _a.reload();
|
|
170
|
-
},
|
|
171
|
+
onContentProcessDidTerminate: blockAndReloadWebView,
|
|
172
|
+
onRenderProcessGone: blockAndReloadWebView,
|
|
171
173
|
onError: () => core.initialization.error = new Error('Could not load Dynamic WebView')
|
|
172
174
|
}, 'webview');
|
|
173
175
|
};
|
package/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createURL, openURL } from 'expo-linking';
|
|
|
10
10
|
import { openAuthSessionAsync } from 'expo-web-browser';
|
|
11
11
|
import { getItemAsync, deleteItemAsync, setItemAsync } from 'expo-secure-store';
|
|
12
12
|
|
|
13
|
-
var version = "4.
|
|
13
|
+
var version = "4.17.0";
|
|
14
14
|
|
|
15
15
|
function _extends() {
|
|
16
16
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -141,6 +141,19 @@ const WebView = ({
|
|
|
141
141
|
},
|
|
142
142
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- we only care about the unmount callback
|
|
143
143
|
[]);
|
|
144
|
+
const blockAndReloadWebView = useCallback(() => {
|
|
145
|
+
var _a;
|
|
146
|
+
/**
|
|
147
|
+
* iOS and Android both may trigger this event when the webview
|
|
148
|
+
* is removed due to memory pressure.
|
|
149
|
+
*
|
|
150
|
+
* When the webview is killed by the OS, the message transport must
|
|
151
|
+
* be blocked to prevent the "No handlers registered" error while
|
|
152
|
+
* the webview is reloading
|
|
153
|
+
*/
|
|
154
|
+
core.messageTransport.block();
|
|
155
|
+
(_a = webViewRef.current) === null || _a === void 0 ? void 0 : _a.reload();
|
|
156
|
+
}, [core, webViewRef]);
|
|
144
157
|
return /*#__PURE__*/jsx(WebView$1, {
|
|
145
158
|
ref: webViewRef,
|
|
146
159
|
source: {
|
|
@@ -151,19 +164,8 @@ const WebView = ({
|
|
|
151
164
|
onMessage: onMessageHandler,
|
|
152
165
|
hideKeyboardAccessoryView: true,
|
|
153
166
|
webviewDebuggingEnabled: _webviewDebuggingEnabled,
|
|
154
|
-
onContentProcessDidTerminate:
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* iOS and Android both may trigger this event when the webview
|
|
158
|
-
* is removed due to memory pressure.
|
|
159
|
-
*
|
|
160
|
-
* When the webview is killed by the OS, the message transport must
|
|
161
|
-
* be blocked to prevent the "No handlers registered" error while
|
|
162
|
-
* the webview is reloading
|
|
163
|
-
*/
|
|
164
|
-
core.messageTransport.block();
|
|
165
|
-
(_a = webViewRef.current) === null || _a === void 0 ? void 0 : _a.reload();
|
|
166
|
-
},
|
|
167
|
+
onContentProcessDidTerminate: blockAndReloadWebView,
|
|
168
|
+
onRenderProcessGone: blockAndReloadWebView,
|
|
167
169
|
onError: () => core.initialization.error = new Error('Could not load Dynamic WebView')
|
|
168
170
|
}, 'webview');
|
|
169
171
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/react-native-extension",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.17.0",
|
|
4
4
|
"main": "./index.cjs",
|
|
5
5
|
"module": "./index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@turnkey/react-native-passkey-stamper": "0.2.15",
|
|
18
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
19
|
-
"@dynamic-labs/client": "4.
|
|
20
|
-
"@dynamic-labs/logger": "4.
|
|
21
|
-
"@dynamic-labs/message-transport": "4.
|
|
18
|
+
"@dynamic-labs/assert-package-version": "4.17.0",
|
|
19
|
+
"@dynamic-labs/client": "4.17.0",
|
|
20
|
+
"@dynamic-labs/logger": "4.17.0",
|
|
21
|
+
"@dynamic-labs/message-transport": "4.17.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^18.2.0",
|