From 9b1eac22b7665be9c9e3ffa37e48173e233f4276 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 22:23:00 +0000 Subject: [PATCH 01/21] bump expo version --- .../react-native/templates/e2e/scripts/download-expo.sh.ejs | 2 +- generators/react-native/templates/e2e/utils.js.ejs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/react-native/templates/e2e/scripts/download-expo.sh.ejs b/generators/react-native/templates/e2e/scripts/download-expo.sh.ejs index f4bf9a6fb..33a55b30c 100755 --- a/generators/react-native/templates/e2e/scripts/download-expo.sh.ejs +++ b/generators/react-native/templates/e2e/scripts/download-expo.sh.ejs @@ -17,7 +17,7 @@ if [ ! -d $APP_PATH ]; then mkdir $APP_PATH # query expo.io to find most recent ipaUrl - IPA_URL=$(curl --silent --show-error https://expo.io/--/api/v2/versions | jq -r '.sdkVersions."49.0.0".iosClientUrl') + IPA_URL=$(curl --silent --show-error https://expo.io/--/api/v2/versions | jq -r '.sdkVersions."50.0.0".iosClientUrl') # download tar.gz TMP_PATH=./exponent.tar.gz diff --git a/generators/react-native/templates/e2e/utils.js.ejs b/generators/react-native/templates/e2e/utils.js.ejs index 370210d2b..1b7c0fedd 100644 --- a/generators/react-native/templates/e2e/utils.js.ejs +++ b/generators/react-native/templates/e2e/utils.js.ejs @@ -81,7 +81,7 @@ const toggleSwitchToValue = async (switchId, targetValue) => { const scrollTo = async (fieldId, listId, size = 0.15, direction = 'up', speed = 'slow') => { await waitFor(element(by.id(fieldId))) .toBeVisible() - .whileElement(by.type('ABI49_0_0RCTScrollView').withAncestor(by.id(listId))) + .whileElement(by.type('ABI<%- nodeDependencies.expo.split('.')[0] %>_0_0RCTScrollView').withAncestor(by.id(listId))) .scroll(500, 'down'); }; From 51becd2c6c19d50d40635a3eba65a60b4d53a5b6 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Wed, 6 Mar 2024 19:34:31 -0300 Subject: [PATCH 02/21] bump expo to 51.0.10 --- .../react-native/resources/expo/package.json | 43 ++++++++++--------- .../react-native/templates/package.json | 2 +- .../react-native/templates/package.json.ejs | 1 + 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/generators/react-native/resources/expo/package.json b/generators/react-native/resources/expo/package.json index 2885f97cd..d6c6ab90e 100644 --- a/generators/react-native/resources/expo/package.json +++ b/generators/react-native/resources/expo/package.json @@ -7,35 +7,36 @@ "update-dependencies": "npm install && npx expo install --fix && rm -rf package-lock.json node_modules" }, "dependencies": { - "@expo/vector-icons": "^13.0.0", - "@react-native-async-storage/async-storage": "1.18.2", - "@react-native-community/datetimepicker": "7.2.0", - "@react-native-masked-view/masked-view": "0.2.9", - "@react-native-picker/picker": "2.4.10", + "@expo/metro-runtime": "~3.2.1", + "@expo/vector-icons": "^14.0.0", + "@react-native-async-storage/async-storage": "1.23.1", + "@react-native-community/datetimepicker": "8.0.1", + "@react-native-masked-view/masked-view": "0.3.1", + "@react-native-picker/picker": "2.7.5", "@react-navigation/devtools": "6.0.26", - "expo": "49.0.21", - "expo-auth-session": "~5.0.2", - "expo-constants": "~14.4.2", - "expo-image-picker": "~14.3.2", - "expo-linking": "~5.0.2", - "expo-random": "~13.2.0", - "expo-splash-screen": "~0.20.5", - "expo-status-bar": "~1.6.0", - "expo-web-browser": "~12.3.2", + "expo": "51.0.10", + "expo-auth-session": "~5.5.2", + "expo-constants": "~16.0.2", + "expo-image-picker": "~15.0.5", + "expo-linking": "~6.3.1", + "expo-random": "~14.0.1", + "expo-splash-screen": "~0.27.4", + "expo-status-bar": "~1.12.1", + "expo-web-browser": "~13.0.3", "react": "18.2.0", "react-dom": "18.2.0", - "react-native": "0.72.10", - "react-native-gesture-handler": "~2.12.0", - "react-native-reanimated": "~3.3.0", - "react-native-safe-area-context": "4.6.3", - "react-native-screens": "~3.22.0", + "react-native": "0.74.1", + "react-native-gesture-handler": "~2.16.1", + "react-native-reanimated": "~3.10.1", + "react-native-safe-area-context": "4.10.1", + "react-native-screens": "3.31.1", "react-native-web": "~0.19.12" }, "devDependencies": { "@babel/core": "^7.24.7", "@react-native-community/cli-server-api": "13.6.6", "@types/react": "~18.2.65", - "jest-expo": "^49.0.0", - "typescript": "^5.4.5" + "jest-expo": "~51.0.1", + "typescript": "~5.3.3" } } diff --git a/generators/react-native/templates/package.json b/generators/react-native/templates/package.json index ed56fa638..d6d13d10d 100644 --- a/generators/react-native/templates/package.json +++ b/generators/react-native/templates/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@babel/runtime": "7.24.7", - "@config-plugins/detox": "6.0.0", + "@config-plugins/detox": "8.0.0", "@react-native-community/eslint-config": "3.2.0", "@redux-devtools/extension": "3.3.0", "@storybook/addons": "7.6.13", diff --git a/generators/react-native/templates/package.json.ejs b/generators/react-native/templates/package.json.ejs index 53e155f9c..53da94d84 100644 --- a/generators/react-native/templates/package.json.ejs +++ b/generators/react-native/templates/package.json.ejs @@ -27,6 +27,7 @@ }, "dependencies": { "@expo/vector-icons": "EXPO_REPLACE_WITH_VERSION", + "@expo/metro-runtime": "EXPO_REPLACE_WITH_VERSION", "@react-native-async-storage/async-storage": "EXPO_REPLACE_WITH_VERSION", "@react-native-community/datetimepicker": "EXPO_REPLACE_WITH_VERSION", "@react-native-masked-view/masked-view": "EXPO_REPLACE_WITH_VERSION", From d1b767bf60f2aebda5bb5bf7a165d838fb7abf06 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 6 Jun 2024 00:21:07 -0300 Subject: [PATCH 03/21] adjusts --- .github/workflows/app.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index 7f5508d8e..8f785abf5 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -71,6 +71,7 @@ jobs: name: 'SETUP: copy the JDL file for the backend and app' - run: $SCRIPT_DIR/generate-react-native-app.sh name: 'GENERATING: generate react-native app' + - run: npx expo-doctor@latest - run: $SCRIPT_DIR/run-react-native-tests.sh name: 'TESTING: npm run test' applications-result: From 8672cd935b13c93f53047ced7744432a356e6296 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 6 Jun 2024 09:58:42 -0300 Subject: [PATCH 04/21] load package.json --- generators/react-native/generator.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/generators/react-native/generator.mjs b/generators/react-native/generator.mjs index 43a4e8e8e..a39a6c12b 100644 --- a/generators/react-native/generator.mjs +++ b/generators/react-native/generator.mjs @@ -165,6 +165,9 @@ export default class extends BaseApplicationGenerator { get [BaseApplicationGenerator.PREPARING]() { return this.asPreparingTaskGroup({ + dependencies({ application }) { + this.loadNodeDependenciesFromPackageJson(application.nodeDependencies, this.templatePath('../resources/expo/package.json')); + }, preparingPatchInFile() { this.patchInFile = patchInFile.bind(this); }, From 5dbbd1b4efc3e4e238983616342d52ad50508931 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 6 Jun 2024 16:05:26 -0300 Subject: [PATCH 05/21] use registerRootComponent --- generators/react-native/templates/App.js.ejs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/generators/react-native/templates/App.js.ejs b/generators/react-native/templates/App.js.ejs index c20d36276..cfc24e3ba 100644 --- a/generators/react-native/templates/App.js.ejs +++ b/generators/react-native/templates/App.js.ejs @@ -1,5 +1,6 @@ import * as React from 'react'; import { Provider } from 'react-redux'; +import { registerRootComponent } from 'expo'; import createStore from './app/shared/reducers'; import * as SplashScreen from 'expo-splash-screen'; @@ -7,7 +8,7 @@ import NavContainer from './app/navigation/nav-container'; const store = createStore(); -export default function App() { +function App() { // prevent the splashscreen from disappearing until the redux store is completely ready (hidden in nav-container.js) const [displayApp, setDisplayApp] = React.useState(false); React.useEffect(() => { @@ -24,3 +25,5 @@ export default function App() { ) : null; } + +export default registerRootComponent(App); From 876dad0e8f1fcf41d0ab221fe732f6234ed24039 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 6 Jun 2024 16:53:48 -0300 Subject: [PATCH 06/21] Update utils.js.ejs --- generators/react-native/templates/e2e/utils.js.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/react-native/templates/e2e/utils.js.ejs b/generators/react-native/templates/e2e/utils.js.ejs index 1b7c0fedd..93f09def0 100644 --- a/generators/react-native/templates/e2e/utils.js.ejs +++ b/generators/react-native/templates/e2e/utils.js.ejs @@ -143,7 +143,7 @@ const reloadApp = async (bailOnFailure) => { url: expoPublishedUrl, newInstance: true, launchArgs: { - detoxEnableSynchronization: false, + // detoxEnableSynchronization: false, // Don't show developer menu. EXKernelDisableNuxDefaultsKey: true, }, From d9e8e2040efef8551b27b61e7959a0187bf08152 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 6 Jun 2024 17:02:04 -0300 Subject: [PATCH 07/21] Update package.json --- generators/react-native/resources/expo/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generators/react-native/resources/expo/package.json b/generators/react-native/resources/expo/package.json index d6c6ab90e..1f63c28d3 100644 --- a/generators/react-native/resources/expo/package.json +++ b/generators/react-native/resources/expo/package.json @@ -14,18 +14,18 @@ "@react-native-masked-view/masked-view": "0.3.1", "@react-native-picker/picker": "2.7.5", "@react-navigation/devtools": "6.0.26", - "expo": "51.0.10", + "expo": "51.0.11", "expo-auth-session": "~5.5.2", "expo-constants": "~16.0.2", "expo-image-picker": "~15.0.5", "expo-linking": "~6.3.1", "expo-random": "~14.0.1", - "expo-splash-screen": "~0.27.4", + "expo-splash-screen": "~0.27.5", "expo-status-bar": "~1.12.1", "expo-web-browser": "~13.0.3", "react": "18.2.0", "react-dom": "18.2.0", - "react-native": "0.74.1", + "react-native": "0.74.2", "react-native-gesture-handler": "~2.16.1", "react-native-reanimated": "~3.10.1", "react-native-safe-area-context": "4.10.1", From 21876ac43b3f8bdc9e4e543856ab8ff8393e06c2 Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Sat, 8 Jun 2024 09:07:55 -0600 Subject: [PATCH 08/21] Remove npx expo-doctor --- .github/workflows/app.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index 8f785abf5..7f5508d8e 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -71,7 +71,6 @@ jobs: name: 'SETUP: copy the JDL file for the backend and app' - run: $SCRIPT_DIR/generate-react-native-app.sh name: 'GENERATING: generate react-native app' - - run: npx expo-doctor@latest - run: $SCRIPT_DIR/run-react-native-tests.sh name: 'TESTING: npm run test' applications-result: From 99fe17592ea8817f517232952cba935195820f80 Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Sat, 8 Jun 2024 11:44:42 -0600 Subject: [PATCH 09/21] Use 51.0.0 which uses expoVersion: "~51.0.11" --- .../react-native/templates/e2e/scripts/download-expo.sh.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/react-native/templates/e2e/scripts/download-expo.sh.ejs b/generators/react-native/templates/e2e/scripts/download-expo.sh.ejs index 33a55b30c..699b27b34 100755 --- a/generators/react-native/templates/e2e/scripts/download-expo.sh.ejs +++ b/generators/react-native/templates/e2e/scripts/download-expo.sh.ejs @@ -17,7 +17,7 @@ if [ ! -d $APP_PATH ]; then mkdir $APP_PATH # query expo.io to find most recent ipaUrl - IPA_URL=$(curl --silent --show-error https://expo.io/--/api/v2/versions | jq -r '.sdkVersions."50.0.0".iosClientUrl') + IPA_URL=$(curl --silent --show-error https://expo.io/--/api/v2/versions | jq -r '.sdkVersions."51.0.0".iosClientUrl') # download tar.gz TMP_PATH=./exponent.tar.gz From f8a81bcd24b37483666b2d8fba0cfae98ce07413 Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Sat, 8 Jun 2024 12:55:53 -0600 Subject: [PATCH 10/21] Fix Cannot read properties of undefined (reading 'displayName') --- generators/react-native/templates/App.js.ejs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/generators/react-native/templates/App.js.ejs b/generators/react-native/templates/App.js.ejs index cfc24e3ba..1b65f090a 100644 --- a/generators/react-native/templates/App.js.ejs +++ b/generators/react-native/templates/App.js.ejs @@ -1,14 +1,14 @@ import * as React from 'react'; import { Provider } from 'react-redux'; -import { registerRootComponent } from 'expo'; import createStore from './app/shared/reducers'; import * as SplashScreen from 'expo-splash-screen'; +import 'setimmediate'; import NavContainer from './app/navigation/nav-container'; const store = createStore(); -function App() { +export default function App() { // prevent the splashscreen from disappearing until the redux store is completely ready (hidden in nav-container.js) const [displayApp, setDisplayApp] = React.useState(false); React.useEffect(() => { @@ -25,5 +25,3 @@ function App() { ) : null; } - -export default registerRootComponent(App); From 796489917aa5b352c5ae39eceeb42708f4911dcf Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Sat, 8 Jun 2024 12:56:37 -0600 Subject: [PATCH 11/21] Change Linking.makeURL to Linking.createURI --- .../react-native/templates/app/navigation/nav-container.js.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/react-native/templates/app/navigation/nav-container.js.ejs b/generators/react-native/templates/app/navigation/nav-container.js.ejs index 241873157..bd4f11541 100644 --- a/generators/react-native/templates/app/navigation/nav-container.js.ejs +++ b/generators/react-native/templates/app/navigation/nav-container.js.ejs @@ -108,7 +108,7 @@ export const getDrawerRoutes = () => { }; const linking = { - prefixes: ['rnapp://', Linking.makeUrl('/')], + prefixes: ['rnapp://', Linking.createURL('/')], config: { initialRouteName: 'Home', screens: { From e4e5c7c6f349b7977079b37fa868e208e809b605 Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Sat, 8 Jun 2024 12:57:06 -0600 Subject: [PATCH 12/21] Fix setImmediate is not defined --- generators/react-native/templates/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/generators/react-native/templates/package.json b/generators/react-native/templates/package.json index c890257f6..2f872e565 100644 --- a/generators/react-native/templates/package.json +++ b/generators/react-native/templates/package.json @@ -29,6 +29,7 @@ "seamless-immutable": "7.1.4", "sockjs-client": "1.6.1", "webstomp-client": "1.2.6", + "setimmediate": "1.0.5", "yup": "1.4.0" }, "devDependencies": { From 0eadd25f11dc3c376131593b9a9640a6f279076e Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Sat, 8 Jun 2024 12:57:27 -0600 Subject: [PATCH 13/21] Change Ionicons to remove md- prefix --- .../templates/app/modules/home/home-screen.js.ejs | 4 ++-- .../react-native/templates/app/navigation/modal-screen.js.ejs | 4 ++-- .../app/shared/components/search-bar/search-bar.js.ejs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/generators/react-native/templates/app/modules/home/home-screen.js.ejs b/generators/react-native/templates/app/modules/home/home-screen.js.ejs index cabca4487..fca63b28c 100644 --- a/generators/react-native/templates/app/modules/home/home-screen.js.ejs +++ b/generators/react-native/templates/app/modules/home/home-screen.js.ejs @@ -20,13 +20,13 @@ function HomeScreen(props) { {account && account.login ? ( - You are signed in as {account.login} + You are signed in as {account.login} ) : ( - You are not signed in. + You are not signed in. )} diff --git a/generators/react-native/templates/app/navigation/modal-screen.js.ejs b/generators/react-native/templates/app/navigation/modal-screen.js.ejs index 4f647ce9f..388d367c0 100644 --- a/generators/react-native/templates/app/navigation/modal-screen.js.ejs +++ b/generators/react-native/templates/app/navigation/modal-screen.js.ejs @@ -18,9 +18,9 @@ export function ModalScreen({ route, navigation, isError = false }) { {isError ? ( - + ) : ( - + )}{' '} {route.params.title || ''} diff --git a/generators/react-native/templates/app/shared/components/search-bar/search-bar.js.ejs b/generators/react-native/templates/app/shared/components/search-bar/search-bar.js.ejs index 2afd8420f..255315b3d 100644 --- a/generators/react-native/templates/app/shared/components/search-bar/search-bar.js.ejs +++ b/generators/react-native/templates/app/shared/components/search-bar/search-bar.js.ejs @@ -15,7 +15,7 @@ export default function SearchBar(props) { const dimensions = useWindowDimensions(); return ( - + Date: Sat, 8 Jun 2024 13:14:20 -0600 Subject: [PATCH 14/21] Fix icon positioning --- .../templates/app/modules/home/home-screen.js.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/react-native/templates/app/modules/home/home-screen.js.ejs b/generators/react-native/templates/app/modules/home/home-screen.js.ejs index fca63b28c..9ed6da15a 100644 --- a/generators/react-native/templates/app/modules/home/home-screen.js.ejs +++ b/generators/react-native/templates/app/modules/home/home-screen.js.ejs @@ -20,13 +20,13 @@ function HomeScreen(props) { {account && account.login ? ( - You are signed in as {account.login} + You are signed in as {account.login} ) : ( - You are not signed in. + You are not signed in. )} From b701fb9f77fea590b860beb12e0fee2daea99e39 Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Sun, 9 Jun 2024 09:41:10 -0600 Subject: [PATCH 15/21] Rename icon --- lib/patch-navigation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/patch-navigation.js b/lib/patch-navigation.js index 4371782c9..c1475b2cd 100644 --- a/lib/patch-navigation.js +++ b/lib/patch-navigation.js @@ -20,7 +20,7 @@ function patchNavigationForEntity(entity) { }); // import entity screens to navigation - const navigationDeclaration = `{ name: '${entity.entityNameCapitalized}', route: '${entity.entityFileName}', component: ${entity.entityNameCapitalized}Screen, options: { title: '${entity.entityNamePlural}', headerLeft: () => navigate('Entities')} />, headerRight: () => navigate('${entity.entityNameCapitalized}Edit', { id: undefined })} backImage={(props) => } /> },},`; + const navigationDeclaration = `{ name: '${entity.entityNameCapitalized}', route: '${entity.entityFileName}', component: ${entity.entityNameCapitalized}Screen, options: { title: '${entity.entityNamePlural}', headerLeft: () => navigate('Entities')} />, headerRight: () => navigate('${entity.entityNameCapitalized}Edit', { id: undefined })} backImage={(props) => } /> },},`; this.patchInFile(entityStackPath, { before: 'jhipster-react-native-navigation-declaration-needle', insert: navigationDeclaration, From 769e9c41e26c0ea55955bb697bcbfd4af977d874 Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Sun, 9 Jun 2024 21:16:03 -0600 Subject: [PATCH 16/21] Remove prettier as recommended by npx expo-doctor@latest --- generators/react-native/templates/package.json.ejs | 1 - 1 file changed, 1 deletion(-) diff --git a/generators/react-native/templates/package.json.ejs b/generators/react-native/templates/package.json.ejs index 53da94d84..b0939534c 100644 --- a/generators/react-native/templates/package.json.ejs +++ b/generators/react-native/templates/package.json.ejs @@ -21,7 +21,6 @@ "precommit": "lint-staged", <%_ } _%> "postinstall": "patch-package", - "prettier": "prettier --write \"{,.,**/,.jhipster/**/}*.{md,json,yml,js,ts,tsx}\"", "start": "expo start", "web": "expo start --web" }, From 41267445b7ba1b6cabe351830e56614dfd259283 Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Sun, 9 Jun 2024 21:16:31 -0600 Subject: [PATCH 17/21] Migrate from deprecated method: AppState.removeEventListener --- .../templates/app/navigation/nav-container.js.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/react-native/templates/app/navigation/nav-container.js.ejs b/generators/react-native/templates/app/navigation/nav-container.js.ejs index bd4f11541..af73c1a0e 100644 --- a/generators/react-native/templates/app/navigation/nav-container.js.ejs +++ b/generators/react-native/templates/app/navigation/nav-container.js.ejs @@ -169,8 +169,8 @@ function NavContainer(props) { getAccount(); } }; - AppState.addEventListener('change', handleChange); - return () => AppState.removeEventListener('change', handleChange); + const sub = AppState.addEventListener('change', handleChange); + return () => sub.remove(); }, [getAccount]); useReduxDevToolsExtension(navigationRef); From 941c0401f770e4242b56e5030ed687ada99a1bd5 Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Sun, 9 Jun 2024 21:16:53 -0600 Subject: [PATCH 18/21] Move fetch constant above effect that calls it --- .../entities/_entityFolder_/_entityFile_-screen.js.ejs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/generators/react-native/templates/app/modules/entities/_entityFolder_/_entityFile_-screen.js.ejs b/generators/react-native/templates/app/modules/entities/_entityFolder_/_entityFile_-screen.js.ejs index 3d282be78..1fe6d8682 100644 --- a/generators/react-native/templates/app/modules/entities/_entityFolder_/_entityFile_-screen.js.ejs +++ b/generators/react-native/templates/app/modules/entities/_entityFolder_/_entityFile_-screen.js.ejs @@ -18,6 +18,9 @@ function <%= entityNameCapitalized %>Screen(props) { <%_ } _%> const { <%= entityInstance %>, <%= entityInstance %>List, getAll<%= entityNamePlural %>, fetching } = props; + const fetch<%= entityNamePlural %> = React.useCallback(() => { + getAll<%= entityNamePlural %>({ page: page - 1, sort, size }); + }, [getAll<%= entityNamePlural %>, page, sort, size]); useFocusEffect( React.useCallback(() => { @@ -69,10 +72,6 @@ function <%= entityNameCapitalized %>Screen(props) { props.performSearch(query) } <%_ } _%> - const fetch<%= entityNamePlural %> = React.useCallback(() => { - getAll<%= entityNamePlural %>({ page: page - 1, sort, size }); - }, [getAll<%= entityNamePlural %>, page, sort, size]); - const handleLoadMore = () => { <%_ if (pagination === 'no') { _%> From ffc8d7650b2269080041505db29c1a5d60100bec Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Sun, 9 Jun 2024 21:57:20 -0600 Subject: [PATCH 19/21] Don't downgrade TypeScript --- generators/react-native/resources/expo/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/react-native/resources/expo/package.json b/generators/react-native/resources/expo/package.json index 866ddbf14..06056f54b 100644 --- a/generators/react-native/resources/expo/package.json +++ b/generators/react-native/resources/expo/package.json @@ -37,6 +37,6 @@ "@react-native-community/cli-server-api": "13.6.9", "@types/react": "~18.2.65", "jest-expo": "~51.0.1", - "typescript": "~5.3.3" + "typescript": "^5.4.5" } } From 3f3d55f9153020e622db3e0d1742970e00b176aa Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Sun, 9 Jun 2024 21:57:49 -0600 Subject: [PATCH 20/21] Bump jest-expo to 51.0.2 --- generators/react-native/resources/expo/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/react-native/resources/expo/package.json b/generators/react-native/resources/expo/package.json index 06056f54b..9da82254f 100644 --- a/generators/react-native/resources/expo/package.json +++ b/generators/react-native/resources/expo/package.json @@ -36,7 +36,7 @@ "@babel/core": "^7.24.7", "@react-native-community/cli-server-api": "13.6.9", "@types/react": "~18.2.65", - "jest-expo": "~51.0.1", + "jest-expo": "~51.0.2", "typescript": "^5.4.5" } } From aa57c229d8847778283db5129747b28d26477a53 Mon Sep 17 00:00:00 2001 From: Matt Raible Date: Sun, 9 Jun 2024 22:06:04 -0600 Subject: [PATCH 21/21] Update patch versions and match expo --- generators/react-native/resources/expo/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generators/react-native/resources/expo/package.json b/generators/react-native/resources/expo/package.json index 9da82254f..1130aa818 100644 --- a/generators/react-native/resources/expo/package.json +++ b/generators/react-native/resources/expo/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "@expo/metro-runtime": "~3.2.1", - "@expo/vector-icons": "^14.0.0", + "@expo/vector-icons": "^14.0.2", "@react-native-async-storage/async-storage": "1.23.1", "@react-native-community/datetimepicker": "8.0.1", "@react-native-masked-view/masked-view": "0.3.1", @@ -26,7 +26,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-native": "0.74.2", - "react-native-gesture-handler": "~2.16.1", + "react-native-gesture-handler": "~2.16.2", "react-native-reanimated": "~3.10.1", "react-native-safe-area-context": "4.10.1", "react-native-screens": "3.31.1", @@ -35,8 +35,8 @@ "devDependencies": { "@babel/core": "^7.24.7", "@react-native-community/cli-server-api": "13.6.9", - "@types/react": "~18.2.65", + "@types/react": "~18.2.79", "jest-expo": "~51.0.2", - "typescript": "^5.4.5" + "typescript": "~5.3.3" } }