Skip to content

Commit 668b6f3

Browse files
committed
Use Expo SDK 31 instead, enable offline with assetBundlePatterns, disable autoupdates for apps via CDN
1 parent 5db7e0c commit 668b6f3

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

apps/src/templates/export/expo/CustomAsset.exported_js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,25 @@ export default class CustomAsset {
3333
// Ignore this because it throws if the dir already exists on Android
3434
}
3535
}
36-
({ md5 } = await FileSystem.downloadAsync(this.asset.uri, localUri, {
36+
if (this.asset.localUri) {
37+
await FileSystem.copyAsync({
38+
from: this.asset.localUri,
39+
to: localUri,
40+
});
41+
({ md5 } = await FileSystem.getInfoAsync(localUri, {
3742
cache: true,
3843
md5: true,
39-
}));
44+
}));
45+
} else {
46+
({ md5 } = await FileSystem.downloadAsync(this.asset.uri, localUri, {
47+
cache: true,
48+
md5: true,
49+
}));
50+
}
4051
if (md5 !== this.asset.hash) {
4152
throw new Error(
4253
`Downloaded file for asset '${this.fileName} ` +
43-
`Located at ${this.asset.localUri} ` +
54+
`Located at ${localUri} ` +
4455
`failed MD5 integrity check`
4556
);
4657
}

apps/src/templates/export/expo/app.json.ejs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "<%- appName %> from Code.org Code Studio.",
55
"slug": "<%- appName.replace(/([^a-zA-Z0-9_\-]+)/gi, '-') %>",
66
"privacy": "public",
7-
"sdkVersion": "32.0.0",
7+
"sdkVersion": "31.0.0",
88
"platforms": ["ios", "android"],
99
"version": "1.0.0",
1010
"orientation": "portrait",
@@ -15,8 +15,12 @@
1515
"backgroundColor": "#ffffff"
1616
},
1717
"updates": {
18+
"enabled": false,
1819
"fallbackToCacheTimeout": 0
1920
},
21+
"assetBundlePatterns": [
22+
"**/*"
23+
],
2024
"packagerOpts": {
2125
"assetExts": [
2226
"html",

apps/src/templates/export/expo/package.exported_json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
"eject": "expo eject"
99
},
1010
"dependencies": {
11-
"expo": "^32.0.0",
11+
"expo": "^31.0.4",
1212
"expo-cli": "^2.6.14",
1313
"react": "16.5.0",
14-
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz"
14+
"react-native": "https://github.com/expo/react-native/archive/sdk-31.0.1.tar.gz"
1515
}
1616
}

0 commit comments

Comments
 (0)