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

[expo-dev-launcher][expo-dev-menu] gate config plugin mods by SDK version #16495

Merged
merged 2 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/expo-dev-launcher/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Add the crash report screen. ([#16341](https://github.com/expo/expo/pull/16341) by [@lukmccall](https://github.com/lukmccall))
- Add expo-modules automatic setup on Android. ([#16441](https://github.com/expo/expo/pull/16441) by [@esamelson](https://github.com/esamelson))
- Add support for auto-setup with updates integration on Android. ([#16442](https://github.com/expo/expo/pull/16442) by [@esamelson](https://github.com/esamelson))
- Remove regex-based config plugin mods in SDK 45+ projects. ([#16495](https://github.com/expo/expo/pull/16495) by [@esamelson](https://github.com/esamelson))

### 🐛 Bug fixes

Expand Down
12 changes: 8 additions & 4 deletions packages/expo-dev-launcher/plugin/build/withDevLauncher.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions packages/expo-dev-launcher/plugin/src/withDevLauncher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,14 @@ const withErrorHandling: ConfigPlugin = (config) => {
};

const withDevLauncher = (config: ExpoConfig) => {
config = withDevLauncherActivity(config);
config = withDevLauncherApplication(config);
config = withDevLauncherPodfile(config);
config = withDevLauncherAppDelegate(config);
// projects using SDKs before 45 need the old regex-based integration
// TODO: remove these once we drop support for SDK 44
if (config.sdkVersion && semver.lt(config.sdkVersion, '45.0.0')) {
config = withDevLauncherActivity(config);
config = withDevLauncherApplication(config);
config = withDevLauncherPodfile(config);
config = withDevLauncherAppDelegate(config);
}
config = withErrorHandling(config);
return config;
};
Expand Down
1 change: 0 additions & 1 deletion packages/expo-dev-menu/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ __mocks__
__tests__

/babel.config.js
/metro.config.js
/android/src/androidTest/
/android/src/test/
1 change: 1 addition & 0 deletions packages/expo-dev-menu/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

- Add unit tests for react app. ([#16005](https://github.com/expo/expo/pull/16005) by [@ajsmth](https://github.com/ajsmth))
- Add expo-modules automatic setup on Android. ([#16441](https://github.com/expo/expo/pull/16441) by [@esamelson](https://github.com/esamelson))
- Remove regex-based config plugin mods in SDK 45+ projects. ([#16495](https://github.com/expo/expo/pull/16495) by [@esamelson](https://github.com/esamelson))

### 🐛 Bug fixes

Expand Down
3 changes: 2 additions & 1 deletion packages/expo-dev-menu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
},
"dependencies": {
"@expo/config-plugins": "^4.0.14",
"expo-dev-menu-interface": "0.5.1"
"expo-dev-menu-interface": "0.5.1",
"semver": "^7.3.5"
},
"devDependencies": {
"@apollo/client": "^3.4.10",
Expand Down
11 changes: 8 additions & 3 deletions packages/expo-dev-menu/plugin/build/withDevMenu.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions packages/expo-dev-menu/plugin/src/withDevMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import { ExpoConfig } from '@expo/config-types';
import fs from 'fs';
import path from 'path';
import semver from 'semver';

import { InstallationPage } from './constants';
import { withDevMenuAppDelegate } from './withDevMenuAppDelegate';
Expand Down Expand Up @@ -118,9 +119,13 @@ const withDevMenuPodfile: ConfigPlugin = (config) => {
};

const withDevMenu = (config: ExpoConfig) => {
config = withDevMenuActivity(config);
config = withDevMenuPodfile(config);
config = withDevMenuAppDelegate(config);
// projects using SDKs before 45 need the old regex-based integration
// TODO: remove this config plugin once we drop support for SDK 44
if (config.sdkVersion && semver.lt(config.sdkVersion, '45.0.0')) {
config = withDevMenuActivity(config);
config = withDevMenuPodfile(config);
config = withDevMenuAppDelegate(config);
}
return config;
};

Expand Down