Skip to content

Commit 24e3f53

Browse files
Upgrade to SDK 46 (expo#385)
* chore: run expo upgrade on all projects * update with-yarn-workspaces to use latest monorepo doc * update with-gatsby dependencies to fix errors * fix 'require not defined' error on with-electron * with-three updated, now working * with-react-three-fiber other deps updated, working * update with-splash-screen for clarity * upgrade all examples to react-native 0.69.4 * clean up with-moti * cleaned up react-navigation examples * cleaned up refs to potentially missing NPM scripts * renamed upgrade script for clarity * fix missed update to react-native 0.69.4 * Fix inaccurate script output * remove inaccurate warning * remove refs to global CLI/ ejecting * Update blank/README.md Co-authored-by: Kim Brandwijk <[email protected]> * Update blank/README.md Co-authored-by: Kim Brandwijk <[email protected]> * Update with-maps/README.md Co-authored-by: Kim Brandwijk <[email protected]> * Update with-maps/README.md Co-authored-by: Kim Brandwijk <[email protected]> * Update with-moti/README.md Co-authored-by: Kim Brandwijk <[email protected]> * Update with-yarn-workspaces/README.md Co-authored-by: Kim Brandwijk <[email protected]> * Update with-electron/README.md Co-authored-by: Kim Brandwijk <[email protected]> * Update with-moti/README.md Co-authored-by: Kim Brandwijk <[email protected]> * consistent directions for starting projects, rm cli refs Co-authored-by: Kim Brandwijk <[email protected]>
1 parent fca8ce1 commit 24e3f53

File tree

106 files changed

+650
-551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+650
-551
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@ with-nextjs/out
2727
*/backend/.env
2828

2929
.DS_Store
30-
report.html
30+
report.html
31+
32+
# Maintenance logs
33+
.sdk-upgrade-logs

blank/README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,17 @@
1919

2020
- Install packages with `yarn` or `npm install`.
2121
- If you have native iOS code run `npx pod-install`
22-
- Run `yarn start` to start the bundler.
22+
- Run `yarn start` or `npm run start` to start the bundler.
2323
- Open the project in a React runtime to try it:
2424
- iOS: [Client iOS](https://itunes.apple.com/app/apple-store/id982107779)
2525
- Android: [Client Android](https://play.google.com/store/apps/details?id=host.exp.exponent&referrer=blankexample)
2626
- Web: Any web browser
2727

28-
## Adding Native Code
28+
## Running/Modifying Native Code
2929

30-
This project can be run from a web browser or the Expo client app. You may find that you want to add more native code later on. You can do this by ejecting the project and rebuilding it yourself.
30+
You can generate native iOS and Android projects from your Expo config file (**app.json**/ **app.config.js**) by runnning `npx expo prebuild`. These native projects can then be compiled and run via XCode and Android Studio.
3131

32-
- Run `yarn eject` to create the native projects.
33-
- You can still run your project in the web browser or Expo client, you just won't be able to access any new native modules you add.
32+
> 💡 Learn more about [native code in Expo](https://docs.expo.dev/workflow/customizing/)
3433
3534
## Publishing
3635

blank/app.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"expo": {
3+
"name": "blank",
4+
"slug": "blank",
5+
"version": "1.0.0",
6+
"platforms": [
7+
"ios",
8+
"android",
9+
"web"
10+
]
11+
}
12+
}

blank/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"dependencies": {
3-
"expo": "^45.0.0",
4-
"react": "17.0.2",
5-
"react-dom": "17.0.2",
6-
"react-native": "0.68.2",
7-
"react-native-web": "0.17.7"
3+
"expo": "^46.0.0",
4+
"react": "18.0.0",
5+
"react-dom": "18.0.0",
6+
"react-native": "0.69.4",
7+
"react-native-web": "~0.18.7"
88
},
99
"devDependencies": {
10-
"@babel/core": "^7.12.9"
10+
"@babel/core": "^7.18.6"
1111
}
1212
}

navigation/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
## 🚀 How to use
1919

2020
- Install packages with `yarn` or `npm install`.
21-
- Run `yarn start` to start the bundler.
21+
- Run `yarn start` or `npm run start` to start the bundler.
2222
- Open the project in a React runtime to try it:
2323
- iOS: [Client iOS](https://itunes.apple.com/app/apple-store/id982107779)
2424
- Android: [Client Android](https://play.google.com/store/apps/details?id=host.exp.exponent&referrer=blankexample)

navigation/package.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
"@react-navigation/bottom-tabs": "~6.0.9",
66
"@react-navigation/native": "~6.0.6",
77
"@react-navigation/stack": "~6.0.11",
8-
"expo": "^45.0.0",
9-
"expo-asset": "~8.5.0",
10-
"expo-constants": "~13.1.1",
11-
"expo-font": "~10.1.0",
12-
"expo-linking": "~3.1.0",
13-
"expo-splash-screen": "~0.15.1",
14-
"expo-status-bar": "~1.3.0",
15-
"expo-web-browser": "~10.2.0",
16-
"react": "17.0.2",
17-
"react-dom": "17.0.2",
18-
"react-native": "0.68.2",
19-
"react-native-gesture-handler": "~2.2.1",
20-
"react-native-reanimated": "~2.8.0",
21-
"react-native-safe-area-context": "4.2.4",
22-
"react-native-screens": "~3.11.1",
23-
"react-native-web": "0.17.7"
8+
"expo": "^46.0.0",
9+
"expo-asset": "~8.6.1",
10+
"expo-constants": "~13.2.3",
11+
"expo-font": "~10.2.0",
12+
"expo-linking": "~3.2.2",
13+
"expo-splash-screen": "~0.16.1",
14+
"expo-status-bar": "~1.4.0",
15+
"expo-web-browser": "~11.0.0",
16+
"react": "18.0.0",
17+
"react-dom": "18.0.0",
18+
"react-native": "0.69.4",
19+
"react-native-gesture-handler": "~2.5.0",
20+
"react-native-reanimated": "~2.9.1",
21+
"react-native-safe-area-context": "4.3.1",
22+
"react-native-screens": "~3.15.0",
23+
"react-native-web": "~0.18.7"
2424
},
2525
"devDependencies": {
26-
"@babel/core": "^7.12.9"
26+
"@babel/core": "^7.18.6"
2727
}
2828
}

upgrade-dependencies.sh

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env bash
2+
3+
if [ "$1" == "" ] || [ "$1" == "--help" ]; then
4+
echo "Available flags:"
5+
echo "--help"
6+
echo "--run-expo-upgrade - run yarn and expo-cli upgrade to update to latest SDK on all examples"
7+
echo "--run-fix-dependencies - run npx expo install --fix on all repos"
8+
exit 0
9+
fi
10+
11+
if [ "$1" == "--run-expo-upgrade" ]; then
12+
echo "Upgrading all projects to the latest SDK..."
13+
echo "For each example, this will run `yarn` and then run `expo-cli upgrade`, accepting all defaults."
14+
echo "Upgrade logs will be written to .sdk-upgrade-logs."
15+
16+
mkdir ./.sdk-upgrade-logs
17+
for d in */ ; do
18+
DIRNAME=${d%/}
19+
echo "Upgrading $DIRNAME..."
20+
echo "• Run yarn"
21+
(cd $DIRNAME && yarn --silent) # If yarn fails spectacularly, we'll see evidence in the logs for expo upgrade
22+
echo "• Run expo upgrade"
23+
(cd $DIRNAME && echo y | expo-cli upgrade > ../.sdk-upgrade-logs/$DIRNAME.txt)
24+
done
25+
26+
# yarn workspaces has example(s) inside of app folder
27+
echo "• Run expo upgrade on apps inside with-yarn-workspaces"
28+
mkdir ./.sdk-upgrade-logs/with-yarn-workspaces
29+
for d in with-yarn-workspaces/apps/*/ ; do
30+
(cd $DIRNAME && echo y | expo-cli upgrade > ../.sdk-upgrade-logs/$DIRNAME.txt)
31+
done
32+
33+
echo "Upgrades complete! Check .sdk-upgrade-logs for results. Be sure to correct any errors or warnings."
34+
exit 0
35+
fi
36+
37+
if [ "$1" == "--run-fix-dependencies" ]; then
38+
echo "Fixing dependencies on all examples..."
39+
40+
mkdir ./.sdk-upgrade-logs
41+
for d in */ ; do
42+
DIRNAME=${d%/}
43+
echo "Fixing dependencies on $DIRNAME..."
44+
(cd $DIRNAME && npx expo install --fix)
45+
done
46+
47+
echo "Fixing dependencies on apps inside with-yarn-workspaces..."
48+
mkdir ./.sdk-upgrade-logs/with-yarn-workspaces
49+
for d in with-yarn-workspaces/apps/*/ ; do
50+
(cd $DIRNAME && npx expo install --fix)
51+
done
52+
53+
echo "Dependency fixes complete!"
54+
exit 0
55+
fi
56+
57+
echo "Error: flag not recognized"

with-apollo/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
## 🚀 How to use
1313

1414
- Install with `yarn` or `npm install`.
15-
- Run `expo start` to try it out.
15+
- Run `yarn start` or `npm run start` to try it out.
1616

1717
## 📝 Notes
1818

with-apollo/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"dependencies": {
33
"@apollo/client": "^3.4.16",
44
"@apollo/link-context": "^2.0.0-beta.3",
5-
"@react-native-picker/picker": "2.4.0",
6-
"expo": "^45.0.0",
5+
"@react-native-picker/picker": "2.4.2",
6+
"expo": "^46.0.0",
77
"graphql": "^15.0.0",
8-
"react": "17.0.2",
9-
"react-dom": "17.0.2",
10-
"react-native": "0.68.2",
11-
"react-native-web": "0.17.7"
8+
"react": "18.0.0",
9+
"react-dom": "18.0.0",
10+
"react-native": "0.69.4",
11+
"react-native-web": "~0.18.7"
1212
},
1313
"devDependencies": {
14-
"@babel/core": "^7.12.9"
14+
"@babel/core": "^7.18.6"
1515
}
1616
}

with-auth0/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
- Create your own app on [Auth0](https://auth0.com).
1616
- Add the `AuthSession` auth URL to `Allowed Callback URLs` on Auth0.
1717
- Open `App.js` and replace `auth0ClientId` and `auth0Domain` with your app settings.
18-
- Run [`expo start`](https://docs.expo.dev/versions/latest/workflow/expo-cli/), try it out.
18+
- Run `yarn start` or `npm run start` to try it out.
1919

2020
#### AuthSession callback URL
2121

with-auth0/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"dependencies": {
3-
"expo": "^45.0.0",
4-
"expo-auth-session": "~3.6.0",
5-
"expo-random": "~12.2.0",
3+
"expo": "^46.0.0",
4+
"expo-auth-session": "~3.7.1",
5+
"expo-random": "~12.3.0",
66
"jwt-decode": "2.2.0",
7-
"react": "17.0.2",
8-
"react-dom": "17.0.2",
9-
"react-native": "0.68.2",
10-
"react-native-web": "0.17.7"
7+
"react": "18.0.0",
8+
"react-dom": "18.0.0",
9+
"react-native": "0.69.4",
10+
"react-native-web": "~0.18.7"
1111
},
1212
"devDependencies": {
13-
"@babel/core": "^7.12.9"
13+
"@babel/core": "^7.18.6"
1414
}
1515
}

with-aws-storage-upload/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ Try it at https://exp.host/@ykbryan/aws-storage-upload
1818
### Running the app
1919

2020
- Run `yarn` or `npm install`
21-
- Run [`expo start`](https://docs.expo.dev/versions/latest/workflow/expo-cli/), try it out.
21+
- Run `yarn start` or `npm run start` to try it out.

with-aws-storage-upload/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
"@aws-amplify/core": "^4.3.3",
55
"@aws-amplify/storage": "^4.4.4",
66
"@react-native-async-storage/async-storage": "~1.17.3",
7-
"@react-native-community/netinfo": "8.2.0",
7+
"@react-native-community/netinfo": "9.3.0",
88
"aws-amplify": "^4.3.3",
9-
"expo": "^45.0.0",
10-
"expo-clipboard": "~3.0.1",
11-
"expo-constants": "~13.1.1",
12-
"expo-image-picker": "~13.1.1",
13-
"react": "17.0.2",
14-
"react-dom": "17.0.2",
15-
"react-native": "0.68.2",
16-
"react-native-web": "0.17.7"
9+
"expo": "^46.0.0",
10+
"expo-clipboard": "~3.1.0",
11+
"expo-constants": "~13.2.3",
12+
"expo-image-picker": "~13.3.1",
13+
"react": "18.0.0",
14+
"react-dom": "18.0.0",
15+
"react-native": "0.69.4",
16+
"react-native-web": "~0.18.7"
1717
},
1818
"devDependencies": {
19-
"@babel/core": "^7.12.9"
19+
"@babel/core": "^7.18.6"
2020
}
2121
}

with-camera/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This example shows how to take a picture and display it.
2121

2222
- Install packages with `yarn` or `npm install`.
2323
- If you have native iOS code run `npx pod-install`
24-
- Run `yarn start` to start the bundler.
24+
- Run `yarn start` or `npm run start` to start the bundler.
2525
- Open the project in a React runtime to try it:
2626
- iOS: [Client iOS](https://itunes.apple.com/app/apple-store/id982107779)
2727
- Android: [Client Android](https://play.google.com/store/apps/details?id=host.exp.exponent&referrer=blankexample)

with-camera/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"dependencies": {
3-
"expo": "^45.0.0",
4-
"expo-camera": "~12.2.0",
5-
"react": "17.0.2",
6-
"react-dom": "17.0.2",
7-
"react-native": "0.68.2",
8-
"react-native-web": "0.17.7"
3+
"expo": "^46.0.0",
4+
"expo-camera": "~12.3.0",
5+
"react": "18.0.0",
6+
"react-dom": "18.0.0",
7+
"react-native": "0.69.4",
8+
"react-native-web": "~0.18.7"
99
},
1010
"devDependencies": {
11-
"@babel/core": "^7.12.9"
11+
"@babel/core": "^7.18.6"
1212
}
1313
}

with-custom-font/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"dependencies": {
3-
"expo": "^45.0.0",
4-
"expo-font": "~10.1.0",
5-
"expo-splash-screen": "~0.15.1",
6-
"react": "17.0.2",
7-
"react-dom": "17.0.2",
8-
"react-native": "0.68.2",
9-
"react-native-web": "0.17.7"
3+
"expo": "^46.0.0",
4+
"expo-font": "~10.2.0",
5+
"expo-splash-screen": "~0.16.1",
6+
"react": "18.0.0",
7+
"react-dom": "18.0.0",
8+
"react-native": "0.69.4",
9+
"react-native-web": "~0.18.7"
1010
},
1111
"devDependencies": {
12-
"@babel/core": "^7.12.9"
12+
"@babel/core": "^7.18.6"
1313
}
1414
}

with-dev-client/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Experiment with Development Client in SDK 40.
1313

1414
> `npx create-react-native-app my-app -t with-dev-client`
1515
16-
- Run `expo start --dev-client`, try it out.
16+
- Run `expo start --dev-client` to try it out.
1717

1818
## 🏗 Build with EAS
1919

with-dev-client/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
"web": "expo start --web"
77
},
88
"dependencies": {
9-
"expo": "^45.0.0",
10-
"expo-dev-client": "~0.9.5",
11-
"expo-splash-screen": "~0.15.1",
12-
"expo-status-bar": "~1.3.0",
13-
"expo-updates": "~0.13.1",
14-
"react": "17.0.2",
15-
"react-dom": "17.0.2",
16-
"react-native": "0.68.2",
17-
"react-native-web": "0.17.7"
9+
"expo": "^46.0.0",
10+
"expo-dev-client": "~1.1.1",
11+
"expo-splash-screen": "~0.16.1",
12+
"expo-status-bar": "~1.4.0",
13+
"expo-updates": "~0.14.3",
14+
"react": "18.0.0",
15+
"react-dom": "18.0.0",
16+
"react-native": "0.69.4",
17+
"react-native-web": "~0.18.7"
1818
},
1919
"devDependencies": {
20-
"@babel/core": "^7.12.9"
20+
"@babel/core": "^7.18.6"
2121
},
2222
"name": "with-dev-client",
2323
"version": "1.0.0"

with-drawer-navigation/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
## 🚀 How to use
1313

1414
- Install with `yarn` or `npm install`.
15-
- Run `expo start` to try it out.
15+
- Run `yarn start` or `npm run start` to try it out.
1616

1717
## 📝 Notes
1818

1919
- This is a very basic example from the [react navigation](https://reactnavigation.org/) docs.
2020
- [Drawer navigation documentation](https://reactnavigation.org/docs/drawer-based-navigation).
21+
- [Reanimated Babel plugin may be required](https://github.com/software-mansion/react-native-reanimated/issues/3410)

with-drawer-navigation/babel.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ module.exports = function(api) {
22
api.cache(true);
33
return {
44
presets: ['babel-preset-expo'],
5+
plugins: ['react-native-reanimated/plugin']
56
};
67
};

0 commit comments

Comments
 (0)