-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: cleanup and add tests #82
Conversation
WalkthroughThis update introduces a series of enhancements and refinements across the React application and its utility packages, focusing on event handling, component props, error handling, and testing improvements. The changes aim to improve code readability, maintainability, and the overall structure of event and space management within the application, aligning with best practices and facilitating easier future development. Changes
Possibly related issues
Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Additional comments not posted (2)
TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple nits!
Thanks @carlbrugger! |
Co-authored-by: Carl Brugger <[email protected]>
Co-authored-by: Carl Brugger <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
@@ -78,7 +78,7 @@ export const useFlatfile: () => { | |||
|
|||
const closePortal = () => { | |||
setOpen(false) | |||
// TODO: Do we want to do any cleanup / remove the iFrame from the DOM? | |||
// TODO: Do we want to do any cleanup / remove the iFrame/listener from the DOM? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify the cleanup strategy in closePortal
.
The TODO comment suggests a need for cleanup, specifically removing the iFrame/listener from the DOM. It's important to address this to prevent potential memory leaks or unintended behavior. If you need assistance with implementing a cleanup strategy, I can help draft a solution or open an issue to track this task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make a GH issue for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bangarang, I've created a GitHub issue to address the cleanup strategy in closePortal
as requested. You can find it here: GitHub Issue #83. This issue outlines the need for a cleanup strategy, specifically for removing the iFrame/listener from the DOM, to prevent potential memory leaks or unintended behavior.
Analysis chain
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Create a GitHub issue for the cleanup strategy in `closePortal`.
gh issue create \
--title "Implement cleanup strategy for \`closePortal\` in \`useFlatfile\` hook" \
--body "There's a TODO comment in the `useFlatfile` hook within `packages/react/src/hooks/useFlatfile.ts` suggesting the need for a cleanup strategy, specifically for removing the iFrame/listener from the DOM. This is important to prevent potential memory leaks or unintended behavior.
Context: The TODO was highlighted during a review of PR https://github.com/FlatFilers/flatfile-core-libraries/pull/82, specifically in the discussion https://github.com/FlatFilers/flatfile-core-libraries/pull/82#discussion_r1560169026.
The issue involves deciding on and implementing a strategy to ensure that resources are properly cleaned up when the `closePortal` function is called. This may include removing iFrames and detaching event listeners that were added during the portal's operation.
This task is crucial for maintaining the integrity and performance of the application, preventing memory leaks, and ensuring that event listeners do not persist beyond their intended lifecycle.
Requested by: @bangarang" \
--repo FlatFilers/flatfile-core-libraries
Length of output: 1485
useEvent
hook