-
Notifications
You must be signed in to change notification settings - Fork 0
fix: resolve vimeo player memory leak and unnecessary re-subscriptions #28
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
- Extract throttleMs from callbackOrThrottle to optimize useEffect dependencies - Add controller.off() cleanup logic when last listener is removed - Prevent memory leaks on component unmount
🦋 Changeset detectedLatest commit: ab9d4cb The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis update addresses memory leak issues and event listener cleanup in the Changes
Sequence Diagram(s)sequenceDiagram
participant Component
participant useVimeoEvent
participant VimeoPlayer
participant Controller
Component->>useVimeoEvent: Mounts and subscribes to event
useVimeoEvent->>VimeoPlayer: subscribe(event, callback)
VimeoPlayer->>Controller: on(event, callback)
Component-->>useVimeoEvent: Unmounts or unsubscribes
useVimeoEvent->>VimeoPlayer: unsubscribe(event, callback)
VimeoPlayer->>Controller: off(event)
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (6)
🧰 Additional context used🧬 Code Graph Analysis (2)src/module/WebVimeoPlayerController.ts (1)
src/module/WebviewVimeoPlayerController.ts (1)
🔇 Additional comments (11)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Deploying react-native-vimeo-bridge-example with
|
Latest commit: |
ab9d4cb
|
Status: | ✅ Deploy successful! |
Preview URL: | https://4988d6dc.react-native-vimeo-bridge-example.pages.dev |
Branch Preview URL: | https://fix-vimeo-player-memory-leak.react-native-vimeo-bridge-example.pages.dev |
throttleMs
fromcallbackOrThrottle
to optimizeuseEffect
dependenciescontroller.off()
cleanup logic when last listener is removedSummary by CodeRabbit
Bug Fixes
New Features
Refactor