-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
⚛️ Enable experimental support for Expo Web #1169
base: master
Are you sure you want to change the base?
Commits on Aug 27, 2024
-
Instead of a fetch() call to get the startup config, let's load the JSON file using ES import syntax. (Rename the file to startupConfig.default.json in the process, get rid of the .sample) While here, we can tidy this code with async/await instead of promises. I also noticed that this function doesn't return the consent status; returning it simplifies every place where this is invoked.
Configuration menu - View commit details
-
Copy full SHA for ab31400 - Browse repository at this point
Copy the full SHA ab31400View commit details -
import label-options.default.json
instead of using fetch() we can use ES import here. Need to rename to *.json, so calling it label-options.default.json
Configuration menu - View commit details
-
Copy full SHA for c53d090 - Browse repository at this point
Copy the full SHA c53d090View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5232c84 - Browse repository at this point
Copy the full SHA 5232c84View commit details -
use directly imported JSON files for local demo surveys
Two versions of the demographics surveys are kept locally in e-mission-phone import them using ES import syntax instead of using fetch()
Configuration menu - View commit details
-
Copy full SHA for 714da6c - Browse repository at this point
Copy the full SHA 714da6cView commit details -
New configuration for the repo– when using package.expo.json, we can serve the code as an expo web app I created a setup_expo script, similar to the other setup_* scripts to enable package.expo.json. Since the 'expo' configuration does not have a config.xml file, I modified configure_xml_and_json.js to ignore the xml file if it is not present
Configuration menu - View commit details
-
Copy full SHA for 06a3692 - Browse repository at this point
Copy the full SHA 06a3692View commit details -
add metro.config.js to ignore libxslt
Metro is like the React Rative ecosystem's version of webpack. Just like we tell webpack to ignore libxslt in webpack.config.js, we must also tell Metro to ignore it in metro.config.js
Configuration menu - View commit details
-
Copy full SHA for d806962 - Browse repository at this point
Copy the full SHA d806962View commit details -
add expo/cordova compatibility layer
The entry point for the Cordova app is index.js, which uses react-native-web to createRoot on the #appRoot element of index.html The entry point for an Expo app will be App.tsx (defined in app.json) As such, a few things need to be moved around – index.js should have nothing except the createRoot business, and App.tsx should contain everything needed for the app including Providers, SafeAreaView wrapper, etc. To account for Cordova plugins not being available, we can leverage the mocks we have been using for testing; they are basically just minimal JS versions of the plugins (ie using localStorage instead of native DB storage, fetch instead of the ServerCommunication plugin, etc). We'll apply these mocks (in expoCompat.ts) if we detect that we are running in Expo web
Configuration menu - View commit details
-
Copy full SHA for 407f31b - Browse repository at this point
Copy the full SHA 407f31bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 08e39b2 - Browse repository at this point
Copy the full SHA 08e39b2View commit details -
useAppConfig cordova has a 'deviceready' event that we listen for before we can retrieve the config. Expo does not have this event, so we need to check IS_EXPO and only await if IS_EXPO is false usePermissionStatus We will not be needing any permission-enabled functionality on the Expo web version. We can add a usePermissionStatus.web.ts that will automatically be used in place of usePermissionStatus.ts for Expo web, and it has an empty `checkList` so no permissions will be requested. pushNotifySettings Similarly, we do not need push notifications on the web version, so we will export a function that does nothing from pushNotifySettings.web.ts
Configuration menu - View commit details
-
Copy full SHA for cc56592 - Browse repository at this point
Copy the full SHA cc56592View commit details -
add the MaterialCommunityIcons font back to index.js
Expo includes this font by default, but we do still need to include it in index.js for the Cordova configuration or the icons become blank
Configuration menu - View commit details
-
Copy full SHA for 6edac7f - Browse repository at this point
Copy the full SHA 6edac7fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f463ed - Browse repository at this point
Copy the full SHA 3f463edView commit details
Commits on Aug 28, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8f4e30d - Browse repository at this point
Copy the full SHA 8f4e30dView commit details -
Configuration menu - View commit details
-
Copy full SHA for a5f6ce0 - Browse repository at this point
Copy the full SHA a5f6ce0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2939428 - Browse repository at this point
Copy the full SHA 2939428View commit details