Migrate demo apps to public npm SDK v3 and current prompt API - #2
Open
piavillalbam wants to merge 1 commit into
Open
Migrate demo apps to public npm SDK v3 and current prompt API#2piavillalbam wants to merge 1 commit into
piavillalbam wants to merge 1 commit into
Conversation
The @recurly/engage-react-native and @recurly/engage-core packages have moved from the private, GitHub Packages-hosted @redfast scope (requiring an auth token) to the public npm registry under @recurly/engage-* at version 3.0.0. As part of that migration the old displayPrompt(showModal, pathItem, callback) function and the RedfastInline component were removed upstream in favor of a PromptProvider / PromptOverlay / usePrompt / RecurlyInline pattern. This commit updates both demo apps (example-mobile, example-tv) to match: - package.json: replace @redfast/react-native-redfast and @redfast/redfast-core with @recurly/engage-react-native@^3.0.0 and @recurly/engage-core@^3.0.0. No .npmrc/registry override existed or is needed - both packages resolve from plain public npm. - app.tsx / App.tsx: wrap the app root in <PromptProvider> and render <PromptOverlay> at the bottom of the tree instead of manually constructing a PromptManager and dispatching PromptAction_Init. - home.tsx / detail.tsx: replace displayPrompt(...) + local showModal/pathItem state with promptMgr.screenChanged(...) and promptMgr.buttonClicked(...), and rename RedfastInline to RecurlyInline. Movie list, detail screen, and all other business logic are unchanged. - Rebrand remaining @redfast references in README.md and SKILL.md to @recurly/engage naming and the current API. - tsconfig.json (both apps): set moduleResolution to "bundler" so TypeScript can resolve the published package's conditional "exports" type declarations under expo/tsconfig.base's default "node" resolution. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
The Recurly Engage React Native SDK moved from a private, GitHub Packages-hosted
@redfastscope (requiring an auth token) to the public npm registry as@recurly/engage-react-nativeand@recurly/engage-coreat version3.0.0. This repo's demo apps (example-mobile/,example-tv/) were frozen on the old@redfast/react-native-redfast@^1.0.16/@redfast/redfast-core@^1.0.18packages and the olddisplayPrompt(showModal, pathItem, callback)API, which no longer exists upstream.This PR updates both demo apps to consume the new public package and the current integration pattern.
Changes
package.json(both apps): replaced@redfast/react-native-redfast/@redfast/redfast-corewith@recurly/engage-react-native@^3.0.0/@recurly/engage-core@^3.0.0. There was no.npmrcor registry override in this repo, and none is added — both packages resolve from plain public npm.app.tsx(mobile) /App.tsx(tv): replaced manualPromptManagerconstruction +PromptAction_Initdispatch with<PromptProvider appId="..." userId="...">wrapping the app root, and added<PromptOverlay onEvent={...} />at the bottom of the render tree (renders modal/banner/interstitial/video prompts automatically).home.tsx/detail.tsx(both apps): replaceddisplayPrompt(showModal, pathItem, callback)+ localshowModal/pathItemstate withpromptMgr.screenChanged('home' | 'detail')andpromptMgr.buttonClicked('clickId'). RenamedRedfastInline→RecurlyInline. Movie list, detail screen, and all other business logic are unchanged — only prompt wiring changed.README.md/SKILL.md: updated remaining@redfastreferences and code samples to@recurly/engage-*naming and the current API.tsconfig.json(both apps): set"moduleResolution": "bundler". The published package'spackage.jsononly declares types via a conditionalexportsmap, which TypeScript's default"node"resolution (inherited fromexpo/tsconfig.base) cannot see —"bundler"resolves it correctly without affecting Metro's own runtime module resolution.Impact
.npmrcanywhere in the repo;@recurly/engage-react-native@3.0.0and@recurly/engage-core@3.0.0both resolved fromhttps://registry.npmjs.orgwith no credentials.displayPrompt()no longer exists in the SDK. Apps now use<PromptProvider>+<PromptOverlay>(global, dispatched via context) instead of manually holdingshowModal/pathItemstate and renderingdisplayPrompt(...)inline in JSX.RedfastInlineis renamed toRecurlyInline.npm install/yarn install(matching each app's existing lockfile type) completed successfully for both apps, confirmed resolving@recurly/engage-*@3.0.0from public npm with no auth.npx tsc --noEmitpasses cleanly forexample-mobile.npx tsc --noEmitforexample-tvhas one pre-existing, unrelated error (Property 'id' is missing... required in type '{ id: string; }'onStack.Navigator) — confirmed viagit stashthat this error already existed in the old@redfast-based code before this migration; it's a@react-navigationv7 typing quirk unrelated to the SDK change and left as-is (not introduced or fixed by this PR).expo start(mobile) andexpo prebuild+expo run:ios/expo run:android(tv) against a real PulseappId/userIdto confirm prompts, inline banners, and navigation still work end-to-end before treating this as fully verified.Follow-up for reviewers
example-tvpre-existingStack.Navigator"id" TS error is worth fixing in a separate PR (unrelated to this migration).🤖 Generated with Claude Code