-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix: Adds a set transformation before returning the dynamicbindingpathlist to ensure that dulplicates don't go through #36613
Conversation
… to ensure that dulplicates don't go through
WalkthroughThe changes introduce modifications to the Changes
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11104949416. |
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: 0
🧹 Outside diff range and nitpick comments (1)
app/client/src/utils/DynamicBindingUtils.ts (1)
196-196
: Well done, class! Let's review this change.The modification to use
Array.from(new Set(...))
is a clever way to remove duplicates from the dynamic binding path list. This addresses our lesson objective of ensuring unique entries. However, we can make it even better!Consider this slight optimization:
- return [...Array.from(new Set(entity.dynamicBindingPathList))]; + return Array.from(new Set(entity.dynamicBindingPathList));By removing the spread operator, we avoid an unnecessary array creation. Remember,
Array.from()
already returns a new array, so spreading it again is redundant. This small change will make our code more efficient. Who can tell me why efficiency is important in programming?
Deploy-Preview-URL: https://ce-36613.dp.appsmith.com |
@@ -193,7 +193,7 @@ export const getEntityDynamicBindingPathList = ( | |||
entity.dynamicBindingPathList && | |||
Array.isArray(entity.dynamicBindingPathList) | |||
) { | |||
return [...entity.dynamicBindingPathList]; | |||
return [...Array.from(new Set(entity.dynamicBindingPathList))]; |
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.
Could we skip using Array.from
here? A set can be spread directly to an array like [...set]
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.
Done.
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected. |
closing as no longer required. |
Description
Tip
Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).
Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.
Fixes #
Issue Number
or
Fixes
Issue URL
Warning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Caution
🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11105992104
Commit: 9a88d59
Cypress dashboard.
Tags: @tag.All
Spec:
The following are new failures, please fix them before merging the PR:
Mon, 30 Sep 2024 13:38:14 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Bug Fixes