Skip to content

Commit

Permalink
[build-properties] enable network inspector by default (expo#22994)
Browse files Browse the repository at this point in the history
# Why

for sdk 49, let's enable network inspector by default

# How

- rename `unstable_networkInspector` to `networkInspector`
- enable the property by default
- update generated doc

# Test Plan

- ci passed
- tested prebuild on real project
  • Loading branch information
Kudo authored Jun 21, 2023
1 parent 043caf8 commit faf0cf8
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 44 deletions.

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions packages/expo-build-properties/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### 🛠 Breaking changes

- Replaced `unstable_networkInspector` as `networkInspector` and enabled the feature by default. ([#22994](https://github.com/expo/expo/pull/22994) by [@kudo](https://github.com/kudo))

### 🎉 New features

- Added `android.extraMavenRepos` and `ios.extraPods` support. ([#22785](https://github.com/expo/expo/pull/22785) by [@kudo](https://github.com/kudo))
Expand Down
2 changes: 1 addition & 1 deletion packages/expo-build-properties/build/android.js

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

2 changes: 1 addition & 1 deletion packages/expo-build-properties/build/ios.js

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

14 changes: 8 additions & 6 deletions packages/expo-build-properties/build/pluginConfig.d.ts

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

4 changes: 2 additions & 2 deletions packages/expo-build-properties/build/pluginConfig.js

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

12 changes: 5 additions & 7 deletions packages/expo-build-properties/src/__tests__/android-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,10 @@ describe(withAndroidFlipper, () => {
modResults: [{ type: 'property', key: 'android.flipper', value: '0.999.0' }],
}
);
expect(androidModResults).toEqual([
{
type: 'property',
key: 'android.flipper',
value: '0.999.0',
},
]);
expect(androidModResults).toContainEqual({
type: 'property',
key: 'android.flipper',
value: '0.999.0',
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,11 @@ describe(withBuildProperties, () => {
modResults: [{ type: 'property', key: 'android.compileSdkVersion', value: '30' }],
}
);
expect(androidModResults).toEqual([
{
type: 'property',
key: 'android.compileSdkVersion',
value: '31',
},
]);
expect(androidModResults).toContainEqual({
type: 'property',
key: 'android.compileSdkVersion',
value: '31',
});

const { modResults: iosModResults } = await compileMockModWithResultsAsync(
{},
Expand All @@ -104,7 +102,7 @@ describe(withBuildProperties, () => {
modResults: { 'ios.useFrameworks': 'dynamic' } as Record<string, string>,
}
);
expect(iosModResults).toEqual({
expect(iosModResults).toMatchObject({
'ios.useFrameworks': 'static',
});
});
Expand All @@ -121,13 +119,11 @@ describe(withBuildProperties, () => {
modResults: [{ type: 'property', key: 'android.compileSdkVersion', value: '30' }],
}
);
expect(androidModResults).toEqual([
{
type: 'property',
key: 'android.compileSdkVersion',
value: '30',
},
]);
expect(androidModResults).toContainEqual({
type: 'property',
key: 'android.compileSdkVersion',
value: '30',
});

const { modResults: iosModResults } = await compileMockModWithResultsAsync(
{},
Expand All @@ -138,7 +134,7 @@ describe(withBuildProperties, () => {
modResults: { 'ios.useFrameworks': 'dynamic' } as Record<string, string>,
}
);
expect(iosModResults).toEqual({
expect(iosModResults).toMatchObject({
'ios.useFrameworks': 'dynamic',
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/expo-build-properties/src/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const withAndroidBuildProperties = createBuildGradlePropsConfigPlugin<Plu
},
{
propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR',
propValueGetter: (config) => config.android?.unstable_networkInspector?.toString(),
propValueGetter: (config) => (config.android?.networkInspector ?? true).toString(),
},
],
'withAndroidBuildProperties'
Expand Down
2 changes: 1 addition & 1 deletion packages/expo-build-properties/src/ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const withIosBuildProperties = createBuildPodfilePropsConfigPlugin<Plugin
},
{
propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR',
propValueGetter: (config) => config.ios?.unstable_networkInspector?.toString(),
propValueGetter: (config) => (config.ios?.networkInspector ?? true).toString(),
},
],
'withIosBuildProperties'
Expand Down
18 changes: 10 additions & 8 deletions packages/expo-build-properties/src/pluginConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ export interface PluginConfigTypeAndroid {
flipper?: string;

/**
* Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/).
* SDK 49+ is required.
* Enable the Network Inspector.
*
* @default true
*/
unstable_networkInspector?: boolean;
networkInspector?: boolean;

/**
* Add extra maven repositories to all gradle projects.
Expand Down Expand Up @@ -152,10 +153,11 @@ export interface PluginConfigTypeIos {
flipper?: boolean | string;

/**
* Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/).
* SDK 49+ is required.
* Enable the Network Inspector.
*
* @default true
*/
unstable_networkInspector?: boolean;
networkInspector?: boolean;

/**
* Add extra CocoaPods dependencies for all targets.
Expand Down Expand Up @@ -302,7 +304,7 @@ const schema: JSONSchemaType<PluginConfigType> = {
nullable: true,
},

unstable_networkInspector: { type: 'boolean', nullable: true },
networkInspector: { type: 'boolean', nullable: true },

extraMavenRepos: { type: 'array', items: { type: 'string' }, nullable: true },
},
Expand All @@ -320,7 +322,7 @@ const schema: JSONSchemaType<PluginConfigType> = {
nullable: true,
},

unstable_networkInspector: { type: 'boolean', nullable: true },
networkInspector: { type: 'boolean', nullable: true },

extraPods: {
type: 'array',
Expand Down

0 comments on commit faf0cf8

Please sign in to comment.