expo-modules-core 0.3.1 → 0.4.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.
- package/CHANGELOG.md +32 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/core/interfaces/Package.java +1 -1
- package/build/NativeModulesProxy.native.js +1 -1
- package/build/NativeModulesProxy.native.js.map +1 -1
- package/build/NativeViewManagerAdapter.js +1 -1
- package/build/NativeViewManagerAdapter.js.map +1 -1
- package/build/Platform.d.ts +5 -0
- package/build/Platform.js +6 -1
- package/build/Platform.js.map +1 -1
- package/build/environment/browser.d.ts +1 -0
- package/build/environment/browser.js +7 -0
- package/build/environment/browser.js.map +1 -1
- package/build/environment/browser.web.d.ts +1 -0
- package/build/environment/browser.web.js +1 -0
- package/build/environment/browser.web.js.map +1 -1
- package/ios/EXDefines.h +22 -8
- package/ios/ExpoModulesCore.podspec +2 -1
- package/ios/ModuleRegistryAdapter/EXModuleRegistryAdapter.m +4 -3
- package/ios/NativeModulesProxy/EXNativeModulesProxy.m +28 -10
- package/ios/Services/EXReactNativeAdapter.m +1 -1
- package/ios/Swift/ModuleRegistry.swift +1 -1
- package/ios/Swift/ModulesProvider.swift +2 -2
- package/ios/Tests/Mocks/ModulesProviderMock.swift +1 -1
- package/package.json +2 -2
- package/src/NativeModulesProxy.native.ts +1 -1
- package/src/NativeViewManagerAdapter.tsx +1 -1
- package/src/Platform.ts +11 -1
- package/src/environment/browser.ts +11 -0
- package/src/environment/browser.web.ts +1 -0
- package/ios/ExpoModulesCore.xcframework/Info.plist +0 -40
- package/ios/ExpoModulesCore.xcframework/ios-arm64/ExpoModulesCore.framework/ExpoModulesCore +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64/ExpoModulesCore.framework/Info.plist +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/Project/arm64.swiftsourceinfo +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/arm64-apple-ios.swiftinterface +0 -278
- package/ios/ExpoModulesCore.xcframework/ios-arm64/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/arm64.swiftdoc +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/arm64.swiftinterface +0 -278
- package/ios/ExpoModulesCore.xcframework/ios-arm64/ExpoModulesCore.framework/Modules/module.modulemap +0 -23
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/ExpoModulesCore +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/Info.plist +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/Project/arm64.swiftsourceinfo +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/Project/x86_64.swiftsourceinfo +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +0 -278
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/arm64.swiftdoc +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/arm64.swiftinterface +0 -278
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +0 -278
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/x86_64.swiftdoc +0 -0
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/Modules/ExpoModulesCore.swiftmodule/x86_64.swiftinterface +0 -278
- package/ios/ExpoModulesCore.xcframework/ios-arm64_x86_64-simulator/ExpoModulesCore.framework/Modules/module.modulemap +0 -23
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,38 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.4.2 — 2021-10-01
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 0.4.1 — 2021-09-29
|
|
18
|
+
|
|
19
|
+
### 🐛 Bug fixes
|
|
20
|
+
|
|
21
|
+
- Removed accidentally published prebuilt binaries on iOS.
|
|
22
|
+
|
|
23
|
+
## 0.4.0 — 2021-09-28
|
|
24
|
+
|
|
25
|
+
### 🐛 Bug fixes
|
|
26
|
+
|
|
27
|
+
- Fix imports that affect versioned code inside of Expo Go. ([#14436](https://github.com/expo/expo/pull/14436) by [@cruzach](https://github.com/cruzach))
|
|
28
|
+
- Fixed event emitter being registered after module registry initialization. ([#14502](https://github.com/expo/expo/pull/14502) by [@tsapeta](https://github.com/tsapeta))
|
|
29
|
+
- Fix building errors from use_frameworks! in Podfile. ([#14523](https://github.com/expo/expo/pull/14523) by [@kudo](https://github.com/kudo))
|
|
30
|
+
|
|
31
|
+
## 0.3.2 — 2021-09-15
|
|
32
|
+
|
|
33
|
+
### 🛠 Breaking changes
|
|
34
|
+
|
|
35
|
+
- Dropped support for iOS 11.0 ([#14383](https://github.com/expo/expo/pull/14383) by [@cruzach](https://github.com/cruzach))
|
|
36
|
+
|
|
37
|
+
### 🎉 New features
|
|
38
|
+
|
|
39
|
+
- Added `Platform.isAsyncDebugging` to detect remote debugging ([#14396](https://github.com/expo/expo/pull/14396) by [@EvanBacon](https://github.com/EvanBacon))
|
|
40
|
+
|
|
41
|
+
### 🐛 Bug fixes
|
|
42
|
+
|
|
43
|
+
- Revert prebuilt binaries on iOS to fix build errors. ([#14418](https://github.com/expo/expo/pull/14418) by [@kudo](https://github.com/kudo))
|
|
44
|
+
|
|
13
45
|
## 0.3.1 — 2021-09-09
|
|
14
46
|
|
|
15
47
|
### ⚠️ Notices
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '0.
|
|
6
|
+
version = '0.4.2'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
// Simple helper that allows the root project to override versions declared by this library.
|
|
@@ -57,7 +57,7 @@ android {
|
|
|
57
57
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
58
58
|
targetSdkVersion safeExtGet("targetSdkVersion", 30)
|
|
59
59
|
versionCode 1
|
|
60
|
-
versionName "0.
|
|
60
|
+
versionName "0.4.2"
|
|
61
61
|
}
|
|
62
62
|
lintOptions {
|
|
63
63
|
abortOnError false
|
|
@@ -28,7 +28,7 @@ public interface Package {
|
|
|
28
28
|
return Collections.emptyList();
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
default List<? extends SingletonModule> createSingletonModules(Context context) {
|
|
31
|
+
default List<? extends expo.modules.core.interfaces.SingletonModule> createSingletonModules(Context context) {
|
|
32
32
|
return Collections.emptyList();
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -39,7 +39,7 @@ if (NativeProxy) {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
|
-
console.warn(`The "
|
|
42
|
+
console.warn(`The "EXNativeModulesProxy" native module is not exported through NativeModules; verify that expo-modules-core's native code is linked properly`);
|
|
43
43
|
}
|
|
44
44
|
export default NativeModulesProxy;
|
|
45
45
|
//# sourceMappingURL=NativeModulesProxy.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeModulesProxy.native.js","sourceRoot":"","sources":["../src/NativeModulesProxy.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAI7C,MAAM,WAAW,GAAG,aAAa,CAAC,oBAAoB,CAAC;AACvD,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAC/C,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAE7C,MAAM,kBAAkB,GAAgD,EAAE,CAAC;AAE3E,IAAI,WAAW,EAAE;IACf,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;QAClE,kBAAkB,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QACpF,WAAW,CAAC,kBAAkB,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YACjE,kBAAkB,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAe,EAAgB,EAAE;gBACrF,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC;gBAC3C,IAAI,cAAc,KAAK,IAAI,CAAC,MAAM,EAAE;oBAClC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,iBAAiB,UAAU,IAAI,UAAU,CAAC,IAAI,YAAY,cAAc,IACtE,cAAc,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WACtC,iBAAiB,IAAI,CAAC,MAAM,EAAE,CAC/B,CACF,CAAC;iBACH;gBACD,OAAO,WAAW,CAAC,UAAU,CAAC,UAAU,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;YACvD,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,+EAA+E;QAC/E,kFAAkF;QAClF,EAAE;QACF,wEAAwE;QACxE,gDAAgD;QAChD,EAAE;QACF,6GAA6G;QAC7G,gGAAgG;QAChG,4HAA4H;QAC5H,qCAAqC;QACrC,IAAI,aAAa,CAAC,yBAAyB,EAAE;YAC3C,kBAAkB,CAAC,UAAU,CAAC,CAAC,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,CACvD,aAAa,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;YAClF,kBAAkB,CAAC,UAAU,CAAC,CAAC,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,CAC3D,aAAa,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;SACvF;aAAM;YACL,oBAAoB;YACpB,kHAAkH;YAClH,sHAAsH;YACtH,kBAAkB,CAAC,UAAU,CAAC,CAAC,WAAW,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;YACtD,kBAAkB,CAAC,UAAU,CAAC,CAAC,eAAe,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;SAC3D;IACH,CAAC,CAAC,CAAC;CACJ;KAAM;IACL,OAAO,CAAC,IAAI,CACV
|
|
1
|
+
{"version":3,"file":"NativeModulesProxy.native.js","sourceRoot":"","sources":["../src/NativeModulesProxy.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAI7C,MAAM,WAAW,GAAG,aAAa,CAAC,oBAAoB,CAAC;AACvD,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAC/C,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAE7C,MAAM,kBAAkB,GAAgD,EAAE,CAAC;AAE3E,IAAI,WAAW,EAAE;IACf,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;QAClE,kBAAkB,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QACpF,WAAW,CAAC,kBAAkB,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YACjE,kBAAkB,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAe,EAAgB,EAAE;gBACrF,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC;gBAC3C,IAAI,cAAc,KAAK,IAAI,CAAC,MAAM,EAAE;oBAClC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,iBAAiB,UAAU,IAAI,UAAU,CAAC,IAAI,YAAY,cAAc,IACtE,cAAc,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WACtC,iBAAiB,IAAI,CAAC,MAAM,EAAE,CAC/B,CACF,CAAC;iBACH;gBACD,OAAO,WAAW,CAAC,UAAU,CAAC,UAAU,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;YACvD,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,+EAA+E;QAC/E,kFAAkF;QAClF,EAAE;QACF,wEAAwE;QACxE,gDAAgD;QAChD,EAAE;QACF,6GAA6G;QAC7G,gGAAgG;QAChG,4HAA4H;QAC5H,qCAAqC;QACrC,IAAI,aAAa,CAAC,yBAAyB,EAAE;YAC3C,kBAAkB,CAAC,UAAU,CAAC,CAAC,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,CACvD,aAAa,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;YAClF,kBAAkB,CAAC,UAAU,CAAC,CAAC,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,CAC3D,aAAa,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;SACvF;aAAM;YACL,oBAAoB;YACpB,kHAAkH;YAClH,sHAAsH;YACtH,kBAAkB,CAAC,UAAU,CAAC,CAAC,WAAW,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;YACtD,kBAAkB,CAAC,UAAU,CAAC,CAAC,eAAe,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;SAC3D;IACH,CAAC,CAAC,CAAC;CACJ;KAAM;IACL,OAAO,CAAC,IAAI,CACV,gJAAgJ,CACjJ,CAAC;CACH;AAED,eAAe,kBAAkB,CAAC","sourcesContent":["import { NativeModules } from 'react-native';\n\nimport { ProxyNativeModule } from './NativeModulesProxy.types';\n\nconst NativeProxy = NativeModules.NativeUnimoduleProxy;\nconst modulesConstantsKey = 'modulesConstants';\nconst exportedMethodsKey = 'exportedMethods';\n\nconst NativeModulesProxy: { [moduleName: string]: ProxyNativeModule } = {};\n\nif (NativeProxy) {\n Object.keys(NativeProxy[exportedMethodsKey]).forEach((moduleName) => {\n NativeModulesProxy[moduleName] = NativeProxy[modulesConstantsKey][moduleName] || {};\n NativeProxy[exportedMethodsKey][moduleName].forEach((methodInfo) => {\n NativeModulesProxy[moduleName][methodInfo.name] = (...args: unknown[]): Promise<any> => {\n const { key, argumentsCount } = methodInfo;\n if (argumentsCount !== args.length) {\n return Promise.reject(\n new Error(\n `Native method ${moduleName}.${methodInfo.name} expects ${argumentsCount} ${\n argumentsCount === 1 ? 'argument' : 'arguments'\n } but received ${args.length}`\n )\n );\n }\n return NativeProxy.callMethod(moduleName, key, args);\n };\n });\n\n // These are called by EventEmitter (which is a wrapper for NativeEventEmitter)\n // only on iOS and they use iOS-specific native module, EXReactNativeEventEmitter.\n //\n // On Android only {start,stop}Observing are called on the native module\n // and these should be exported as Expo methods.\n //\n // Before the RN 65, addListener/removeListeners weren't called on Android. However, it no longer stays true.\n // See https://github.com/facebook/react-native/commit/f5502fbda9fe271ff6e1d0da773a3a8ee206a453.\n // That's why, we check if the `EXReactNativeEventEmitter` exists and only if yes, we use it in the listener implementation.\n // Otherwise, those methods are NOOP.\n if (NativeModules.EXReactNativeEventEmitter) {\n NativeModulesProxy[moduleName].addListener = (...args) =>\n NativeModules.EXReactNativeEventEmitter.addProxiedListener(moduleName, ...args);\n NativeModulesProxy[moduleName].removeListeners = (...args) =>\n NativeModules.EXReactNativeEventEmitter.removeProxiedListeners(moduleName, ...args);\n } else {\n // Fixes on Android:\n // WARN `new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.\n // WARN `new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.\n NativeModulesProxy[moduleName].addListener = () => {};\n NativeModulesProxy[moduleName].removeListeners = () => {};\n }\n });\n} else {\n console.warn(\n `The \"EXNativeModulesProxy\" native module is not exported through NativeModules; verify that expo-modules-core's native code is linked properly`\n );\n}\n\nexport default NativeModulesProxy;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnavailabilityError } from './errors/UnavailabilityError';
|
|
2
2
|
export function requireNativeViewManager(viewName) {
|
|
3
|
-
throw new UnavailabilityError('
|
|
3
|
+
throw new UnavailabilityError('expo-modules-core', 'requireNativeViewManager');
|
|
4
4
|
}
|
|
5
5
|
//# sourceMappingURL=NativeViewManagerAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeViewManagerAdapter.js","sourceRoot":"","sources":["../src/NativeViewManagerAdapter.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,MAAM,UAAU,wBAAwB,CAAU,QAAgB;IAChE,MAAM,IAAI,mBAAmB,CAAC,
|
|
1
|
+
{"version":3,"file":"NativeViewManagerAdapter.js","sourceRoot":"","sources":["../src/NativeViewManagerAdapter.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,MAAM,UAAU,wBAAwB,CAAU,QAAgB;IAChE,MAAM,IAAI,mBAAmB,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC;AACjF,CAAC","sourcesContent":["import React from 'react';\n\nimport { UnavailabilityError } from './errors/UnavailabilityError';\n\nexport function requireNativeViewManager<P = any>(viewName: string): React.ComponentType<P> {\n throw new UnavailabilityError('expo-modules-core', 'requireNativeViewManager');\n}\n"]}
|
package/build/Platform.d.ts
CHANGED
|
@@ -35,5 +35,10 @@ declare const Platform: {
|
|
|
35
35
|
* return false in native React runtimes and Node.js.
|
|
36
36
|
*/
|
|
37
37
|
canUseViewport: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* If the JavaScript is being executed in a remote JavaScript environment.
|
|
40
|
+
* When `true`, synchronous native invocations cannot be executed.
|
|
41
|
+
*/
|
|
42
|
+
isAsyncDebugging: boolean;
|
|
38
43
|
};
|
|
39
44
|
export default Platform;
|
package/build/Platform.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Platform as ReactNativePlatform } from 'react-native';
|
|
2
|
-
import { isDOMAvailable, canUseEventListeners, canUseViewport } from './environment/browser';
|
|
2
|
+
import { isDOMAvailable, canUseEventListeners, canUseViewport, isAsyncDebugging, } from './environment/browser';
|
|
3
3
|
const Platform = {
|
|
4
4
|
/**
|
|
5
5
|
* Denotes the currently running platform.
|
|
@@ -32,6 +32,11 @@ const Platform = {
|
|
|
32
32
|
* return false in native React runtimes and Node.js.
|
|
33
33
|
*/
|
|
34
34
|
canUseViewport,
|
|
35
|
+
/**
|
|
36
|
+
* If the JavaScript is being executed in a remote JavaScript environment.
|
|
37
|
+
* When `true`, synchronous native invocations cannot be executed.
|
|
38
|
+
*/
|
|
39
|
+
isAsyncDebugging,
|
|
35
40
|
};
|
|
36
41
|
export default Platform;
|
|
37
42
|
//# sourceMappingURL=Platform.js.map
|
package/build/Platform.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Platform.js","sourceRoot":"","sources":["../src/Platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,mBAAmB,EAAkB,MAAM,cAAc,CAAC;AAE/E,OAAO,
|
|
1
|
+
{"version":3,"file":"Platform.js","sourceRoot":"","sources":["../src/Platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,mBAAmB,EAAkB,MAAM,cAAc,CAAC;AAE/E,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAM/B,MAAM,QAAQ,GAAG;IACf;;;OAGG;IACH,EAAE,EAAE,mBAAmB,CAAC,EAAE;IAC1B;;;;;;;OAOG;IACH,MAAM,EAAE,mBAAmB,CAAC,MAAwB;IACpD;;;OAGG;IACH,cAAc;IACd;;;;OAIG;IACH,oBAAoB;IACpB;;;;OAIG;IACH,cAAc;IACd;;;OAGG;IACH,gBAAgB;CACjB,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { Platform as ReactNativePlatform, PlatformOSType } from 'react-native';\n\nimport {\n isDOMAvailable,\n canUseEventListeners,\n canUseViewport,\n isAsyncDebugging,\n} from './environment/browser';\n\nexport type PlatformSelectOSType = PlatformOSType | 'native' | 'electron' | 'default';\n\nexport type PlatformSelect = <T>(specifics: { [platform in PlatformSelectOSType]?: T }) => T;\n\nconst Platform = {\n /**\n * Denotes the currently running platform.\n * Can be one of ios, android, web.\n */\n OS: ReactNativePlatform.OS,\n /**\n * Returns the value with the matching platform.\n * Object keys can be any of ios, android, native, web, default.\n *\n * @ios ios, native, default\n * @android android, native, default\n * @web web, default\n */\n select: ReactNativePlatform.select as PlatformSelect,\n /**\n * Denotes if the DOM API is available in the current environment.\n * The DOM is not available in native React runtimes and Node.js.\n */\n isDOMAvailable,\n /**\n * Denotes if the current environment can attach event listeners\n * to the window. This will return false in native React\n * runtimes and Node.js.\n */\n canUseEventListeners,\n /**\n * Denotes if the current environment can inspect properties of the\n * screen on which the current window is being rendered. This will\n * return false in native React runtimes and Node.js.\n */\n canUseViewport,\n /**\n * If the JavaScript is being executed in a remote JavaScript environment.\n * When `true`, synchronous native invocations cannot be executed.\n */\n isAsyncDebugging,\n};\n\nexport default Platform;\n"]}
|
|
@@ -2,4 +2,11 @@
|
|
|
2
2
|
export const isDOMAvailable = false;
|
|
3
3
|
export const canUseEventListeners = false;
|
|
4
4
|
export const canUseViewport = false;
|
|
5
|
+
export let isAsyncDebugging = false;
|
|
6
|
+
if (__DEV__) {
|
|
7
|
+
// These native globals are injected by native React runtimes and not standard browsers
|
|
8
|
+
// we can use them to determine if the JS is being executed in Chrome.
|
|
9
|
+
isAsyncDebugging =
|
|
10
|
+
!global.nativeExtensions && !global.nativeCallSyncHook && !global.RN$Bridgeless;
|
|
11
|
+
}
|
|
5
12
|
//# sourceMappingURL=browser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/environment/browser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/environment/browser.ts"],"names":[],"mappings":"AAEA,oDAAoD;AACpD,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AACpC,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAC1C,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AAEpC,MAAM,CAAC,IAAI,gBAAgB,GAAY,KAAK,CAAC;AAE7C,IAAI,OAAO,EAAE;IACX,uFAAuF;IACvF,sEAAsE;IACtE,gBAAgB;QACd,CAAC,MAAM,CAAC,gBAAgB,IAAI,CAAC,MAAM,CAAC,kBAAkB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;CACnF","sourcesContent":["declare const global: any;\n\n// In standard node environments there is no DOM API\nexport const isDOMAvailable = false;\nexport const canUseEventListeners = false;\nexport const canUseViewport = false;\n\nexport let isAsyncDebugging: boolean = false;\n\nif (__DEV__) {\n // These native globals are injected by native React runtimes and not standard browsers\n // we can use them to determine if the JS is being executed in Chrome.\n isAsyncDebugging =\n !global.nativeExtensions && !global.nativeCallSyncHook && !global.RN$Bridgeless;\n}\n"]}
|
|
@@ -3,4 +3,5 @@
|
|
|
3
3
|
export const isDOMAvailable = typeof window !== 'undefined' && !!window.document?.createElement;
|
|
4
4
|
export const canUseEventListeners = isDOMAvailable && !!(window.addEventListener || window.attachEvent);
|
|
5
5
|
export const canUseViewport = isDOMAvailable && !!window.screen;
|
|
6
|
+
export const isAsyncDebugging = false;
|
|
6
7
|
//# sourceMappingURL=browser.web.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.web.js","sourceRoot":"","sources":["../../src/environment/browser.web.ts"],"names":[],"mappings":"AAOA,sEAAsE;AACtE,wBAAwB;AACxB,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC;AAChG,MAAM,CAAC,MAAM,oBAAoB,GAC/B,cAAc,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC","sourcesContent":["declare global {\n // Add IE-specific interface to Window\n interface Window {\n attachEvent(event: string, listener: EventListener): boolean;\n }\n}\n\n// Used for delegating node actions when browser APIs aren't available\n// like in SSR websites.\nexport const isDOMAvailable = typeof window !== 'undefined' && !!window.document?.createElement;\nexport const canUseEventListeners =\n isDOMAvailable && !!(window.addEventListener || window.attachEvent);\nexport const canUseViewport = isDOMAvailable && !!window.screen;\n"]}
|
|
1
|
+
{"version":3,"file":"browser.web.js","sourceRoot":"","sources":["../../src/environment/browser.web.ts"],"names":[],"mappings":"AAOA,sEAAsE;AACtE,wBAAwB;AACxB,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC;AAChG,MAAM,CAAC,MAAM,oBAAoB,GAC/B,cAAc,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC","sourcesContent":["declare global {\n // Add IE-specific interface to Window\n interface Window {\n attachEvent(event: string, listener: EventListener): boolean;\n }\n}\n\n// Used for delegating node actions when browser APIs aren't available\n// like in SSR websites.\nexport const isDOMAvailable = typeof window !== 'undefined' && !!window.document?.createElement;\nexport const canUseEventListeners =\n isDOMAvailable && !!(window.addEventListener || window.attachEvent);\nexport const canUseViewport = isDOMAvailable && !!window.screen;\nexport const isAsyncDebugging = false;\n"]}
|
package/ios/EXDefines.h
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
// Copyright © 2018 650 Industries. All rights reserved.
|
|
2
2
|
|
|
3
|
+
#if defined(__cplusplus)
|
|
4
|
+
#define EX_EXTERN extern "C" __attribute__((visibility("default")))
|
|
5
|
+
#define EX_EXTERN_C_BEGIN extern "C" {
|
|
6
|
+
#define EX_EXTERN_C_END }
|
|
7
|
+
#else
|
|
8
|
+
#define EX_EXTERN extern __attribute__((visibility("default")))
|
|
9
|
+
#define EX_EXTERN_C_BEGIN
|
|
10
|
+
#define EX_EXTERN_C_END
|
|
11
|
+
#endif
|
|
12
|
+
|
|
13
|
+
EX_EXTERN_C_BEGIN
|
|
14
|
+
|
|
3
15
|
#define EX_EXPORTED_METHODS_PREFIX __ex_export__
|
|
4
16
|
#define EX_PROPSETTERS_PREFIX __ex_set__
|
|
5
17
|
|
|
@@ -20,7 +32,7 @@
|
|
|
20
32
|
- (void)EX_CONCAT(EX_PROPSETTERS_PREFIX, external_name):(type)value view:(viewClass *)view
|
|
21
33
|
|
|
22
34
|
#define _EX_DEFINE_CUSTOM_LOAD(_custom_load_code) \
|
|
23
|
-
|
|
35
|
+
EX_EXTERN void EXRegisterModule(Class); \
|
|
24
36
|
+ (void)load { \
|
|
25
37
|
EXRegisterModule(self); \
|
|
26
38
|
_custom_load_code \
|
|
@@ -37,7 +49,7 @@
|
|
|
37
49
|
_EX_DEFINE_CUSTOM_LOAD(_custom_load_code)
|
|
38
50
|
|
|
39
51
|
#define EX_REGISTER_SINGLETON_MODULE_WITH_CUSTOM_LOAD(singleton_name, _custom_load_code) \
|
|
40
|
-
|
|
52
|
+
EX_EXTERN void EXRegisterSingletonModule(Class); \
|
|
41
53
|
+ (const NSString *)name { \
|
|
42
54
|
return @#singleton_name; \
|
|
43
55
|
} \
|
|
@@ -86,9 +98,11 @@ typedef void (^EXPromiseRejectBlock)(NSString *code, NSString *message, NSError
|
|
|
86
98
|
#pragma mark - Externs
|
|
87
99
|
|
|
88
100
|
// These should be defined by the concrete platform adapter
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
101
|
+
EX_EXTERN void EXLogInfo(NSString *format, ...);
|
|
102
|
+
EX_EXTERN void EXLogWarn(NSString *format, ...);
|
|
103
|
+
EX_EXTERN void EXLogError(NSString *format, ...);
|
|
104
|
+
EX_EXTERN void EXFatal(NSError *);
|
|
105
|
+
EX_EXTERN NSError * EXErrorWithMessage(NSString *);
|
|
106
|
+
EX_EXTERN UIApplication *EXSharedApplication(void);
|
|
107
|
+
|
|
108
|
+
EX_EXTERN_C_END
|
|
@@ -10,9 +10,10 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
s.license = package['license']
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.homepage = package['homepage']
|
|
13
|
-
s.platform = :ios, '
|
|
13
|
+
s.platform = :ios, '12.0'
|
|
14
14
|
s.swift_version = '5.4'
|
|
15
15
|
s.source = { git: 'https://github.com/expo/expo.git' }
|
|
16
|
+
s.static_framework = true
|
|
16
17
|
s.header_dir = 'ExpoModulesCore'
|
|
17
18
|
|
|
18
19
|
# Swift/Objective-C compatibility
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
// Copyright 2018-present 650 Industries. All rights reserved.
|
|
2
2
|
|
|
3
3
|
#import <ExpoModulesCore/EXNativeModulesProxy.h>
|
|
4
|
-
#import <ExpoModulesCore/EXReactNativeEventEmitter.h>
|
|
5
4
|
#import <ExpoModulesCore/EXViewManagerAdapter.h>
|
|
6
5
|
#import <ExpoModulesCore/EXModuleRegistryAdapter.h>
|
|
6
|
+
#import <ExpoModulesCore/EXModuleRegistryProvider.h>
|
|
7
7
|
#import <ExpoModulesCore/EXViewManagerAdapterClassesRegistry.h>
|
|
8
8
|
#import <ExpoModulesCore/EXModuleRegistryHolderReactModule.h>
|
|
9
|
+
#import <ExpoModulesCore/EXReactNativeEventEmitter.h>
|
|
9
10
|
#if __has_include(<ExpoModulesCore/ExpoModulesCore-Swift.h>)
|
|
10
|
-
// For
|
|
11
|
+
// For cocoapods framework, the generated swift header will be inside ExpoModulesCore module
|
|
11
12
|
#import <ExpoModulesCore/ExpoModulesCore-Swift.h>
|
|
12
|
-
#
|
|
13
|
+
#else
|
|
13
14
|
#import "ExpoModulesCore-Swift.h"
|
|
14
15
|
#endif
|
|
15
16
|
|
|
@@ -6,18 +6,19 @@
|
|
|
6
6
|
#import <React/RCTUIManager.h>
|
|
7
7
|
#import <React/RCTComponentData.h>
|
|
8
8
|
#import <React/RCTModuleData.h>
|
|
9
|
+
#import <React/RCTEventDispatcherProtocol.h>
|
|
9
10
|
|
|
10
|
-
#import <ExpoModulesCore/EXModuleRegistryProvider.h>
|
|
11
|
-
#import <ExpoModulesCore/EXReactNativeEventEmitter.h>
|
|
12
11
|
#import <ExpoModulesCore/EXNativeModulesProxy.h>
|
|
13
12
|
#import <ExpoModulesCore/EXEventEmitter.h>
|
|
14
13
|
#import <ExpoModulesCore/EXViewManager.h>
|
|
15
14
|
#import <ExpoModulesCore/EXViewManagerAdapter.h>
|
|
16
15
|
#import <ExpoModulesCore/EXViewManagerAdapterClassesRegistry.h>
|
|
16
|
+
#import <ExpoModulesCore/EXModuleRegistryProvider.h>
|
|
17
|
+
#import <ExpoModulesCore/EXReactNativeEventEmitter.h>
|
|
17
18
|
#if __has_include(<ExpoModulesCore/ExpoModulesCore-Swift.h>)
|
|
18
|
-
// For
|
|
19
|
+
// For cocoapods framework, the generated swift header will be inside ExpoModulesCore module
|
|
19
20
|
#import <ExpoModulesCore/ExpoModulesCore-Swift.h>
|
|
20
|
-
#
|
|
21
|
+
#else
|
|
21
22
|
#import "ExpoModulesCore-Swift.h"
|
|
22
23
|
#endif
|
|
23
24
|
|
|
@@ -35,6 +36,13 @@ static const NSString *methodInfoArgumentsCountKey = @"argumentsCount";
|
|
|
35
36
|
|
|
36
37
|
@end
|
|
37
38
|
|
|
39
|
+
@interface RCTComponentData (EXNativeModulesProxy)
|
|
40
|
+
|
|
41
|
+
- (instancetype)initWithManagerClass:(Class)managerClass bridge:(RCTBridge *)bridge eventDispatcher:(id<RCTEventDispatcherProtocol>) eventDispatcher; // available in RN 0.65+
|
|
42
|
+
- (instancetype)initWithManagerClass:(Class)managerClass bridge:(RCTBridge *)bridge;
|
|
43
|
+
|
|
44
|
+
@end
|
|
45
|
+
|
|
38
46
|
@interface EXNativeModulesProxy ()
|
|
39
47
|
|
|
40
48
|
@property (nonatomic, strong) NSRegularExpression *regexp;
|
|
@@ -181,6 +189,8 @@ RCT_EXPORT_METHOD(callMethod:(NSString *)moduleName methodNameOrKey:(id)methodNa
|
|
|
181
189
|
|
|
182
190
|
- (id<ModulesProviderObjCProtocol>)getExpoModulesProvider
|
|
183
191
|
{
|
|
192
|
+
// Dynamically gets the modules provider class.
|
|
193
|
+
// NOTE: This needs to be versioned in Expo Go.
|
|
184
194
|
Class generatedExpoModulesProvider = NSClassFromString(@"ExpoModulesProvider");
|
|
185
195
|
// Checks if `ExpoModulesProvider` was generated
|
|
186
196
|
if (generatedExpoModulesProvider) {
|
|
@@ -234,10 +244,6 @@ RCT_EXPORT_METHOD(callMethod:(NSString *)moduleName methodNameOrKey:(id)methodNa
|
|
|
234
244
|
}
|
|
235
245
|
}
|
|
236
246
|
|
|
237
|
-
// Let the modules consume the registry :)
|
|
238
|
-
// It calls `setModuleRegistry:` on all `EXModuleRegistryConsumer`s.
|
|
239
|
-
[_exModuleRegistry initialize];
|
|
240
|
-
|
|
241
247
|
// Register the view managers as additional modules.
|
|
242
248
|
[bridge registerAdditionalModuleClasses:additionalModuleClasses];
|
|
243
249
|
|
|
@@ -248,7 +254,10 @@ RCT_EXPORT_METHOD(callMethod:(NSString *)moduleName methodNameOrKey:(id)methodNa
|
|
|
248
254
|
// Get the newly created instance of `EXReactEventEmitter` bridge module and register it in expo modules registry.
|
|
249
255
|
EXReactNativeEventEmitter *eventEmitter = [bridge moduleForClass:[EXReactNativeEventEmitter class]];
|
|
250
256
|
[_exModuleRegistry registerInternalModule:eventEmitter];
|
|
251
|
-
|
|
257
|
+
|
|
258
|
+
// Let the modules consume the registry :)
|
|
259
|
+
// It calls `setModuleRegistry:` on all `EXModuleRegistryConsumer`s.
|
|
260
|
+
[_exModuleRegistry initialize];
|
|
252
261
|
}
|
|
253
262
|
|
|
254
263
|
- (void)registerComponentDataForModuleClasses:(NSArray<Class> *)moduleClasses inBridge:(RCTBridge *)bridge
|
|
@@ -261,7 +270,16 @@ RCT_EXPORT_METHOD(callMethod:(NSString *)moduleName methodNameOrKey:(id)methodNa
|
|
|
261
270
|
NSString *className = NSStringFromClass(moduleClass);
|
|
262
271
|
|
|
263
272
|
if ([moduleClass isSubclassOfClass:[RCTViewManager class]] && !componentDataByName[className]) {
|
|
264
|
-
|
|
273
|
+
RCTComponentData *componentData = [RCTComponentData alloc];
|
|
274
|
+
if ([componentData respondsToSelector:@selector(initWithManagerClass:bridge:eventDispatcher:)]) {
|
|
275
|
+
// Init method was changed in RN 0.65
|
|
276
|
+
[componentData initWithManagerClass:moduleClass bridge:bridge eventDispatcher:bridge.eventDispatcher];
|
|
277
|
+
} else {
|
|
278
|
+
// fallback for older RNs
|
|
279
|
+
[componentData initWithManagerClass:moduleClass bridge:bridge];
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
componentDataByName[className] = componentData;
|
|
265
283
|
}
|
|
266
284
|
}
|
|
267
285
|
}
|
|
@@ -217,7 +217,7 @@ EX_REGISTER_MODULE();
|
|
|
217
217
|
} else if (
|
|
218
218
|
_isForegrounded && (
|
|
219
219
|
[notification.name isEqualToString:UIApplicationWillResignActiveNotification] ||
|
|
220
|
-
[notification.name isEqualToString:
|
|
220
|
+
[notification.name isEqualToString:UIApplicationDidEnterBackgroundNotification] ||
|
|
221
221
|
RCTSharedApplication().applicationState == UIApplicationStateBackground
|
|
222
222
|
)
|
|
223
223
|
) {
|
|
@@ -26,7 +26,7 @@ public class ModuleRegistry: Sequence {
|
|
|
26
26
|
// TODO: (@tsapeta) App context is deallocated, throw an error?
|
|
27
27
|
return
|
|
28
28
|
}
|
|
29
|
-
provider.
|
|
29
|
+
provider.getModuleClasses().forEach { moduleType in
|
|
30
30
|
register(module: moduleType.init(appContext: appContext))
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -12,7 +12,7 @@ public protocol ModulesProviderObjCProtocol {}
|
|
|
12
12
|
Swift protocol defining the requirements for modules providers. Extends its Objective-C counterpart `ModulesProviderObjCProtocol`.
|
|
13
13
|
*/
|
|
14
14
|
public protocol ModulesProviderProtocol: ModulesProviderObjCProtocol {
|
|
15
|
-
func
|
|
15
|
+
func getModuleClasses() -> [AnyModule.Type]
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -21,7 +21,7 @@ public protocol ModulesProviderProtocol: ModulesProviderObjCProtocol {
|
|
|
21
21
|
*/
|
|
22
22
|
@objc
|
|
23
23
|
open class ModulesProvider: NSObject, ModulesProviderProtocol, ModulesProviderObjCProtocol {
|
|
24
|
-
open func
|
|
24
|
+
open func getModuleClasses() -> [AnyModule.Type] {
|
|
25
25
|
return []
|
|
26
26
|
}
|
|
27
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-modules-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "The core of Expo Modules architecture",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"@testing-library/react-hooks": "^7.0.1",
|
|
43
43
|
"expo-module-scripts": "^2.0.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "2718b696f4a6919905b0f47ebb24ff65b42d8ff9"
|
|
46
46
|
}
|
|
@@ -52,7 +52,7 @@ if (NativeProxy) {
|
|
|
52
52
|
});
|
|
53
53
|
} else {
|
|
54
54
|
console.warn(
|
|
55
|
-
`The "
|
|
55
|
+
`The "EXNativeModulesProxy" native module is not exported through NativeModules; verify that expo-modules-core's native code is linked properly`
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -3,5 +3,5 @@ import React from 'react';
|
|
|
3
3
|
import { UnavailabilityError } from './errors/UnavailabilityError';
|
|
4
4
|
|
|
5
5
|
export function requireNativeViewManager<P = any>(viewName: string): React.ComponentType<P> {
|
|
6
|
-
throw new UnavailabilityError('
|
|
6
|
+
throw new UnavailabilityError('expo-modules-core', 'requireNativeViewManager');
|
|
7
7
|
}
|
package/src/Platform.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { Platform as ReactNativePlatform, PlatformOSType } from 'react-native';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
isDOMAvailable,
|
|
5
|
+
canUseEventListeners,
|
|
6
|
+
canUseViewport,
|
|
7
|
+
isAsyncDebugging,
|
|
8
|
+
} from './environment/browser';
|
|
4
9
|
|
|
5
10
|
export type PlatformSelectOSType = PlatformOSType | 'native' | 'electron' | 'default';
|
|
6
11
|
|
|
@@ -38,6 +43,11 @@ const Platform = {
|
|
|
38
43
|
* return false in native React runtimes and Node.js.
|
|
39
44
|
*/
|
|
40
45
|
canUseViewport,
|
|
46
|
+
/**
|
|
47
|
+
* If the JavaScript is being executed in a remote JavaScript environment.
|
|
48
|
+
* When `true`, synchronous native invocations cannot be executed.
|
|
49
|
+
*/
|
|
50
|
+
isAsyncDebugging,
|
|
41
51
|
};
|
|
42
52
|
|
|
43
53
|
export default Platform;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
declare const global: any;
|
|
2
|
+
|
|
1
3
|
// In standard node environments there is no DOM API
|
|
2
4
|
export const isDOMAvailable = false;
|
|
3
5
|
export const canUseEventListeners = false;
|
|
4
6
|
export const canUseViewport = false;
|
|
7
|
+
|
|
8
|
+
export let isAsyncDebugging: boolean = false;
|
|
9
|
+
|
|
10
|
+
if (__DEV__) {
|
|
11
|
+
// These native globals are injected by native React runtimes and not standard browsers
|
|
12
|
+
// we can use them to determine if the JS is being executed in Chrome.
|
|
13
|
+
isAsyncDebugging =
|
|
14
|
+
!global.nativeExtensions && !global.nativeCallSyncHook && !global.RN$Bridgeless;
|
|
15
|
+
}
|
|
@@ -11,3 +11,4 @@ export const isDOMAvailable = typeof window !== 'undefined' && !!window.document
|
|
|
11
11
|
export const canUseEventListeners =
|
|
12
12
|
isDOMAvailable && !!(window.addEventListener || window.attachEvent);
|
|
13
13
|
export const canUseViewport = isDOMAvailable && !!window.screen;
|
|
14
|
+
export const isAsyncDebugging = false;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>AvailableLibraries</key>
|
|
6
|
-
<array>
|
|
7
|
-
<dict>
|
|
8
|
-
<key>LibraryIdentifier</key>
|
|
9
|
-
<string>ios-arm64</string>
|
|
10
|
-
<key>LibraryPath</key>
|
|
11
|
-
<string>ExpoModulesCore.framework</string>
|
|
12
|
-
<key>SupportedArchitectures</key>
|
|
13
|
-
<array>
|
|
14
|
-
<string>arm64</string>
|
|
15
|
-
</array>
|
|
16
|
-
<key>SupportedPlatform</key>
|
|
17
|
-
<string>ios</string>
|
|
18
|
-
</dict>
|
|
19
|
-
<dict>
|
|
20
|
-
<key>LibraryIdentifier</key>
|
|
21
|
-
<string>ios-arm64_x86_64-simulator</string>
|
|
22
|
-
<key>LibraryPath</key>
|
|
23
|
-
<string>ExpoModulesCore.framework</string>
|
|
24
|
-
<key>SupportedArchitectures</key>
|
|
25
|
-
<array>
|
|
26
|
-
<string>arm64</string>
|
|
27
|
-
<string>x86_64</string>
|
|
28
|
-
</array>
|
|
29
|
-
<key>SupportedPlatform</key>
|
|
30
|
-
<string>ios</string>
|
|
31
|
-
<key>SupportedPlatformVariant</key>
|
|
32
|
-
<string>simulator</string>
|
|
33
|
-
</dict>
|
|
34
|
-
</array>
|
|
35
|
-
<key>CFBundlePackageType</key>
|
|
36
|
-
<string>XFWK</string>
|
|
37
|
-
<key>XCFrameworkFormatVersion</key>
|
|
38
|
-
<string>1.0</string>
|
|
39
|
-
</dict>
|
|
40
|
-
</plist>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|