-
Notifications
You must be signed in to change notification settings - Fork 0
feat(android): add preload #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe changes introduce URL parsing utilities and a preload caching system, then implement a new preload workflow in ExpofpModule that validates URLs, derives parameters, caches preloaded plan information, and provides error handling. ExpofpViewManager is refactored to use these shared utilities and support retrieval of preloaded presenters from cache with fallback to standard creation. Changes
Sequence DiagramssequenceDiagram
participant Client as React Native Client
participant Module as ExpofpModule
participant Utils as ExpofpUrlUtils
participant Plan as ExpoFpPlan
participant Cache as ExpofpPreloadCache
participant Promise as Promise
Client->>Module: preload(url)
Module->>Utils: getExpoKeyFromUrl(url)
Utils-->>Module: expoKey
Module->>Utils: extractAdditionalParamsFromUrl(url)
Utils-->>Module: additionalParams
rect rgb(220, 240, 250)
Note over Module: Async Initialization
Module->>Plan: Initialize ExpoFpPlan
Plan-->>Module: Ready
Module->>Plan: preloader.preloadPlan(ExpoKey(expoKey), additionalParams)
Plan-->>Module: ExpoFpPreloadedPlanInfo
end
Module->>Cache: put(expoKey, preloadedInfo)
Cache-->>Module: Cached
Module->>Promise: resolve({expoKey, url})
Promise-->>Client: Success
rect rgb(255, 240, 240)
Note over Module,Promise: On Error
Module->>Promise: reject(PRELOAD_FAILED)
Promise-->>Client: Error
end
sequenceDiagram
participant ViewManager as ExpofpViewManager
participant Utils as ExpofpUrlUtils
participant Cache as ExpofpPreloadCache
participant Plan as ExpoFpPlan
participant Presenter as PlanPresenter
ViewManager->>Utils: getExpoKeyFromUrl(url)
Utils-->>ViewManager: expoKey
ViewManager->>Utils: extractAdditionalParamsFromUrl(url)
Utils-->>ViewManager: additionalParams
ViewManager->>Cache: get(expoKey)
alt Preloaded Info Found
rect rgb(240, 255, 240)
Note over ViewManager,Plan: Preloaded Path
Cache-->>ViewManager: preloadedInfo
ViewManager->>Plan: preloader.getPreloadedPlanPresenter(preloadedInfo)
Plan-->>ViewManager: preloadedPresenter
end
else No Preloaded Info
rect rgb(255, 250, 240)
Note over ViewManager,Presenter: Standard Creation Path
Cache-->>ViewManager: null
ViewManager->>Plan: Create presenter with ExpoKey(expoKey), additionalParams
Plan-->>ViewManager: newPresenter
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
Comment |
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.