Skip to content
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

Upgrade to Expo SDK 44 #1220

Merged
merged 11 commits into from
May 12, 2022
Merged

Upgrade to Expo SDK 44 #1220

merged 11 commits into from
May 12, 2022

Conversation

larixer
Copy link
Member

@larixer larixer commented Jan 28, 2022

What's the problem this PR addresses?

Fixes: #1219

How did you fix it?

Updated to Expo SDK 44, updated to newer react-native-navigation as well.

@larixer larixer mentioned this pull request Jan 28, 2022
1 task
@larixer
Copy link
Member Author

larixer commented Jan 28, 2022

Update. The kit compiles successfully but it seems some libraries and the code that uses them need to be upgraded in order to work with React Native 0.64.3, specifically react-native-navigation

packages/mobile/package.json Outdated Show resolved Hide resolved
packages/mobile/package.json Outdated Show resolved Hide resolved
@larixer larixer marked this pull request as ready for review May 12, 2022 19:03
@larixer larixer merged commit f4ca062 into master May 12, 2022
@larixer larixer deleted the larixer/expo-44 branch May 12, 2022 19:04
@qroac
Copy link
Contributor

qroac commented May 12, 2022

Some learnings I had in meantime with expos new build system EAS:

It does not respect the module-setting in package/mobile/package.json.
In order to build with EAS you need to add package/mobile/index.js with

/*
Entrypoint for building with expo EAS
sadly doesn't respect main-field from package.json
 */
import './src/index';

EAS does not recognize the setting for the yarn lockfile. Building my project worked after I removed the old yarn.lock and changed the lockfile for yarn3 to yarn.lock.


After adding eas-cli to packages/mobile/package.json and configuring it in packages/mobile/eas.json, you can start a build from the projects main directory with yarn workspace mobile eas build
In CI you could use the command like this yarn workspace mobile eas build --profile development --platform android --non-interactive, the profile depends on the profile names as given in eas.json.
If you further add --auto-submit and added credentials for the appstores in your expo profile, the app is automatically uploaded to internal test tracks in the appstore.


Environment variables previously set in mobile build config and required for building the app must be set in the eas.json config.
This is now the place for example to set the URLs for the different deployment stages. The sub-keys of "build" are the profiles that are used in the build command.

Btw. I added process.env.APP_STAGE to modify the app name, package name and bundleIdentifier in app.config.js (alternative format to app.json)
This way I can have a develpment, preview and production version installed with different names on the same device.

{
  "cli": {
    "version": ">= 0.46.0"
  },
  "build": {
    "base": {
      "node": "16.13.2"
    },
    "base-internal": {
      "node": "16.13.2",
      "distribution": "internal"
    },
    "development": {
      "extends": "base-internal",
      "releaseChannel": "develop",
      "env": {
        "API_URL": "...",
        "WEBSITE_URL": "...",
        "APP_STAGE": "development"
      }
    },
    "preview": {
      "extends": "base-internal",
      "releaseChannel": "preview",
      "env": {
        "API_URL": "...",
        "WEBSITE_URL": "...",
        "APP_STAGE": "preview"
      }
    },
    "production": {
      "extends": "base",
      "env": {
        "API_URL": "...",
        "WEBSITE_URL": "...",
        "APP_STAGE": "production"
      }
    }
  },
  "submit": {
    "production": {}
  }
}


Drawbacks I found so far:

Current Expo CLI with --android or --ios requires this device to be connected or to be present in simulator.
If you want to develop using the Expo Go app, expo fails to start.
So I changed the start command just to "watch:mobile" without selection of a platform.

EAS does not yield something like expo publish, and I could not get expo publish to work with the yarn3 symlink structure.
If you have a solution for this, that would be great for developers that still need to publish to expo.
Just a warning in advance that it might cause problems.

That is why I further removed all exp/expo commands related with login, build and publish from my package.jsons.
Expo asks me to login if I not already am. And for CI I use the new Robot Auth Tokens as CI env variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade expo to latest SDK
2 participants