refactor(plugin): replace global config state with explicit internal config passing#16
Merged
konodioda727 merged 3 commits intokonodioda727:mainfrom Mar 27, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the Expo config plugin internals to eliminate module-level mutable config state by resolving plugin props once and passing a normalized config object through iOS/Android modification layers. This also corrects Android vendor “enabled” gating for Huawei/FCM and adds regression tests to prevent cross-instance config leakage.
Changes:
- Removed the global
utils/configstate and introducedResolvedJPushPluginProps+resolveProps()for normalized internal config passing. - Updated iOS/Android mod entrypoints to accept resolved props explicitly (and fixed Huawei/FCM injection to require
enabled === true). - Added regression tests for per-instance config isolation and for “disabled vendor” behavior (Huawei/FCM).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| plugin/src/utils/config.ts | Deletes global mutable config getters/setters to remove hidden state. |
| plugin/src/types.ts | Adds ResolvedJPushPluginProps and resolveProps() for internal normalization. |
| plugin/src/index.ts | Resolves props once and passes them into iOS/Android layers instead of setting global state. |
| plugin/src/ios/infoPlist.ts | Writes Info.plist values from explicitly passed resolved props (no global getters). |
| plugin/src/ios/index.ts | Threads resolved props through iOS config application. |
| plugin/src/android/index.ts | Threads resolved props through Android config application. |
| plugin/src/android/projectBuildGradle.ts | Gates Huawei/FCM classpaths and Huawei repo injection on enabled === true. |
| plugin/src/android/gradleProperties.ts | Gates Huawei Gradle 8 compatibility property on enabled === true. |
| plugin/src/android/appBuildGradle.ts | Gates Huawei/FCM dependencies + apply-plugins on enabled === true; uses explicit packageName. |
| plugin/tests/nativeIosMods.test.ts | Adds regression test ensuring Info.plist values don’t leak across plugin instances. |
| plugin/tests/nativeAndroidMods.test.ts | Adds regression tests for config isolation and for Huawei/FCM disabled-vendor behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
JPushPluginPropsAPI unchanged while removing hidden cross-module dependenciesenabled: falseTesting
eslintis not installed innode_modules)