Skip to content

Commit a301cd3

Browse files
authored
[widgets][plugin] Add enableAndroid option to temporary disable android config plugin (expo#46463)
# Why Android widgets are still in development, but part of that is already cherry-picked to SDK 56. # How Add a temporary `enableAndroid` flag to `expo-widgets` so Android config plugin wiring only runs when explicitly enabled. # Test Plan Create a project with expo-widgets and do not set `enableAndroid: true` # Checklist - [x] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
1 parent 34b3be7 commit a301cd3

4 files changed

Lines changed: 19 additions & 9 deletions

File tree

‎packages/expo-widgets/CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
### 💡 Others
1212

13+
- Temporarily make the Android config plugin opt-in with `enableAndroid`. ([#46463](https://github.com/expo/expo/pull/46463) by [@jakex7](https://github.com/jakex7))
14+
1315
## 56.0.15 — 2026-05-26
1416

1517
### 🎉 New features

‎packages/expo-widgets/plugin/build/withWidgets.d.ts‎

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/expo-widgets/plugin/build/withWidgets.js‎

Lines changed: 3 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/expo-widgets/plugin/src/withWidgets.ts‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ConfigPlugin, createRunOncePlugin, withPlugins } from 'expo/config-plugins';
1+
import { ConfigPlugin, createRunOncePlugin } from 'expo/config-plugins';
22

33
import withAndroidWidgets from './android/withAndroidWidgets';
44
import withIosWidgets from './ios/withIosWidgets';
@@ -15,16 +15,20 @@ export type ExpoWidgetsConfigPluginProps = {
1515
enablePushNotifications?: boolean;
1616
// Enable frequent updates for widgets. Defaults to false.
1717
frequentUpdates?: boolean;
18+
/**
19+
* Enable the Android config plugin. Defaults to false.
20+
* This option will be removed and Android widget will be enabled by default in the future.
21+
*/
22+
enableAndroid?: boolean;
1823
widgets?: WidgetConfig[];
1924
};
2025

2126
const withWidgets: ConfigPlugin<ExpoWidgetsConfigPluginProps | undefined> = (config, props) => {
27+
const enableAndroid = props?.enableAndroid ?? false;
2228
const widgets = props?.widgets ?? [];
2329

24-
return withPlugins(config, [
25-
[withAndroidWidgets, { widgets }],
26-
[withIosWidgets, { ...(props ?? {}), widgets }],
27-
]);
30+
const nextConfig = enableAndroid ? withAndroidWidgets(config, { widgets }) : config;
31+
return withIosWidgets(nextConfig, { ...props, widgets });
2832
};
2933

3034
export default createRunOncePlugin(withWidgets, pkg.name, pkg.version);

0 commit comments

Comments
 (0)