Repository navigation
Add <CodePushProvider> - #107
Merged
Merged
Conversation
A component for the app root that starts CodePush on mount: it runs sync() with its props, or only notifyAppReady() with checkFrequency MANUAL. It can check again on each resume, and reports every failure to onError. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ofalvai
force-pushed
the
add-code-push-provider
branch
from
November 6, 2026 07:33
ab1a3fd to
e893f23
Compare
There was a problem hiding this comment.
🟡 Changes recommended
A failed status-report fetch can cause native acknowledgement to be retried, clearing a not-yet-running update’s pending marker and rollback protection.
2 open issues
What changed in this PR
Adds CodePushProvider as the recommended app-root integration for CodePush, building on #106’s retryable readiness notification to manage startup, resume checks, and error reporting.
Changes:
- Adds a typed React provider backed by a React-free lifecycle controller and unit tests.
- Integrates provider exports, preserves sync defaults for undefined options, and moves logging into TypeScript.
- Documents provider usage and updates the readiness E2E scenario to use it.
| File | Description |
|---|---|
typings/react-native-code-push.d.ts |
Declares the provider and its public props. |
tsconfig.json |
Enables TSX compilation and JSX typing. |
test/template/scenarios/updateNotifyApplicationReady.js |
Uses the provider to acknowledge updates. |
test/template/index.js |
Allows scenarios to wrap the test app. |
src/react/code-push-provider.tsx |
Implements the thin React lifecycle wrapper. |
src/logging.ts |
Moves shared logging utilities into TypeScript. |
src/app-lifecycle/app-lifecycle.ts |
Controls startup, resume checks, and error callbacks. |
src/app-lifecycle/__tests__/app-lifecycle.test.ts |
Tests lifecycle modes, retries, cleanup, and prop changes. |
src/acquisition-sdk/acquisition-sdk.ts |
Adopts the shared logger. |
package.json |
Adds React dependencies and TSX lint coverage. |
package-lock.json |
Records dependency changes. |
eslint.config.mjs |
Includes TSX source files in linting. |
docs/api-js.md |
Documents the provider as the recommended integration. |
CodePush.js |
Exports the provider, preserves option defaults, and logs readiness failures. |
Review effort: Balanced
gsanta
approved these changes
Nov 6, 2026
This was referenced Nov 6, 2026
Merged
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.


Background
Today an app integrates CodePush by wrapping its root in the
codePush()HOC, or by callingsync()from auseEffect. Both leave the user to get things right on its own:notifyAppReady()has to run for every launch of a new bundle. If it doesn't, native code rolls the update back on the next start.Change
Adds
<CodePushProvider>, a component that owns both for the app. On mount, it runssync()with its props, or onlynotifyAppReady()withcheckFrequency={MANUAL}. It can check again each time the app resumes, and it hands every failure to anonErrorprop instead of rejecting.Example use:
The logic is a React-free controller in
src/app-lifecyclewith unit tests. The component itself is a thin wrapper.Decisions
onErrorcall.notifyAppReady(). This is the use of the retry from Retry a failed notifyAppReady() on the next call #106.Smaller changes pulled in
reactas a peer dependency (should have been done already)logging.jsmoves tosrc/logging.ts, so the acquisition SDK can use the shared logger instead ofconsole.sync()ignores options set toundefined, so<CodePushProvider installMode={undefined}>doesn't override the defaults.notifyAppReady()logs its failure before rethrowing.updateNotifyApplicationReadyE2E scenario keeps its update through the new component instead of a directnotifyAppReady()call.🤖 Generated with Claude Code