[expo] Use `requireNativeModule` instead of `NativeModulesProxy.*` (#23573)# Why Uses `requireNativeModule` instead of the legacy `NativeModulesProxy`.
Add web support to expo-keep-awake (#15826)# Why - Reimplements https://github.com/expo/expo/pull/9467 which is stale. - Resolves https://github.com/expo/expo/issues/6889 <!-- Please descri
Add web support to expo-keep-awake (#15826)# Why - Reimplements https://github.com/expo/expo/pull/9467 which is stale. - Resolves https://github.com/expo/expo/issues/6889 <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> # How - `KeepAwake.activateKeepAwake` now returns a promise to accommodate web. - Added `KeepAwake.isAvailableAsync` which returns false on certain web browsers. - Added `KeepAwake.addListener` to observe state changes on web. <!-- How did you build this feature or fix this bug and why? --> # Test Plan <!-- Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction. --> # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [x] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [x] This diff will work correctly for `expo build` (eg: updated `@expo/xdl`). - [x] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin). Co-authored-by: Expo Bot <[email protected]>
show more ...
[keep-awake] define `KeepAwakeOptions` type, update doc comments (#20489)
[expo][keep-awake] Fix `Unable to deactivate keep awake` warnings (#17319)# Why a slightly different proposal of #13432 and to fix #12584 my hypothesis is that in the case, the Activity is de
[expo][keep-awake] Fix `Unable to deactivate keep awake` warnings (#17319)# Why a slightly different proposal of #13432 and to fix #12584 my hypothesis is that in the case, the Activity is dead (`finish()` called) but the process is still alive and the react-native bridge is still alive. before the Activity dead, `deactivateKeepAwake` is called. however, the unhandled promise rejection will be kept in the bridge queue. it will show in the yellow box when next time the new Activity created. sometimes, android will not finish Activity when pressing back button, [especially on android 12](https://developer.android.com/about/versions/12/behavior-changes-all#back-press). to reliably test the issue, i would turn on the `Don't keep activities` flag in android developer menu: <img src="https://user-images.githubusercontent.com/46429/166503633-5d8cfe46-599a-4b35-8f1c-d228a5ab0a40.png" height="500" /> according to the study from #13432, the `FLAG_KEEP_SCREEN_ON` scope is window based. if the Activity is dead, we don't need to remove the flag. # How based on the observations above, my assumption is that it's a common case and we don't need to show the warning. this pr is to remove the warning. - update `activateKeepAwake` and `deactivateKeepAwake` to return `Promise<void>`, so that we can handle to promise rejection. - add `{ suppressDeactivateWarnings: true }` option to suppress the promise rejection. - use the `{ suppressDeactivateWarnings: true }` in `withExpoRoot` # Test Plan #### Integration Test 1. turn on `Don't keep activities` flag in android developer menu. 2. on a sdk45 project 3. launch app -> press back (triangle) button -> press square button to resume the app. see whether the warning is displayed. #### Unit Test ``` useKeepAwake ✓ test default calls without any parameters (6 ms) ✓ test explicit calls with parameters (1 ms) ``` i did try to test the promise rejection. i got no luck to test the promise rejection in hook as well as the `useEffect` cleanup function.
Rename unimodules imports to expo-modules-core
[keep-awake] add doc comments in source (#12386)
[expo-keep-awake] Removed deprecated methods and components (#6006)* Removed deprecated methods and components * Remove conditional hook
[lint] Add a "lint" script to all packages and fix lint warnings & errorsThis turns on linting for all of the packages, enforced by `expotools check-packages`. I added a "lint" script to each packa
[lint] Add a "lint" script to all packages and fix lint warnings & errorsThis turns on linting for all of the packages, enforced by `expotools check-packages`. I added a "lint" script to each package and an `.eslintrc.js` file created by expo-module-scripts. For some packages like jest-expo that are intended to run on Node, I used a small handwritten ESLint config that uses the universe/node config.Tested with `expotools check-packages` after fixing all the lint warnings and errors.
Make AppEntry import from expo-keep-awake; update KeepAwake API to use hooks; docsWith modular imports, we expect application code to import from `expo-keep-awake` instead of the `expo` package. Th
Make AppEntry import from expo-keep-awake; update KeepAwake API to use hooks; docsWith modular imports, we expect application code to import from `expo-keep-awake` instead of the `expo` package. This commit updates AppEntry -- both in the `expo` package and the one we internally use with `expo-yarn-workspaces` to import from `expo-keep-awake`. Tested this by deleting `__generated__` in native-component-list, running `yarn` to regenerate it, and loading NCL with no message about importing from `expo-keep-awake`.Since we are updating the files that import and use KeepAwake, I took this opportunity to revisit the KeepAwake API. I converted the component to a hook, which now works with React. (It is very easy to re-implement most of the component -- just do `function KeepAwake(tag) { useKeepAwake(tag); return null; }`.) I also renamed `activate` and `deactivate` to `activate/deactivateKeepAwake` so the names make sense afar from the import statement.Added deprecation messages to the old exports and updated the docs.
[expo-keep-awake] Refactor KeepAwake to utilize unimodules (#3747)* Move KeepAwake functionalities to internal module and expose it thru external one. * Make internat module RN not aware. * U
[expo-keep-awake] Refactor KeepAwake to utilize unimodules (#3747)* Move KeepAwake functionalities to internal module and expose it thru external one. * Make internat module RN not aware. * Update docs and changelog. Correct android. * Update CHANGELOG.md Co-Authored-By: mczernek <[email protected]> * Update docs/pages/versions/unversioned/sdk/keep-awake.md Co-Authored-By: mczernek <[email protected]> * Update docs/pages/versions/unversioned/sdk/keep-awake.md Co-Authored-By: mczernek <[email protected]> * Update docs/pages/versions/unversioned/sdk/keep-awake.md Co-Authored-By: mczernek <[email protected]> * Update docs/pages/versions/unversioned/sdk/keep-awake.md Co-Authored-By: mczernek <[email protected]> * Update docs/pages/versions/unversioned/sdk/keep-awake.md Co-Authored-By: mczernek <[email protected]> * Apply suggestions from code review Co-Authored-By: mczernek <[email protected]>
[packages] Move unimodules foundation to `org.unimodules` scope
[sdk] Extract LinearGradient and KeepAwake (#3287)