appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

chore: diffing unevalTrees using microdiff to improve performance

Open vsvamsi1 opened this issue 1 year ago • 1 comments

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"

:mag: Cypress test results

[!CAUTION] 🔴 🔴 🔴 Some tests have failed. Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9700619925 Commit: e0a8913ddf6f0edc15595ec7f20039c759f220c1 Cypress dashboard. Tags: `` The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ClientSide/MobileResponsiveTests/AutoDimension_2_spec.ts
  2. cypress/e2e/Regression/ClientSide/MobileResponsiveTests/AutoHeight_Container_spec.ts
  3. cypress/e2e/Regression/ClientSide/MobileResponsiveTests/AutoHeight_Form_spec.ts
  4. cypress/e2e/Regression/ClientSide/MobileResponsiveTests/AutoHeight_Modal_spec.ts
  5. cypress/e2e/Regression/ClientSide/MobileResponsiveTests/AutoHeight_Tabs_spec.ts
  6. cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column_query_change_spec.js
List of identified flaky tests.

Communication

Should the DevRel and Marketing teams inform users about this change?

  • [ ] Yes
  • [ ] No

Summary by CodeRabbit

  • Bug Fixes
    • Improved the accuracy of data difference computation to enhance performance and reliability when handling changes in the data tree.

vsvamsi1 avatar Jun 27 '24 11:06 vsvamsi1

Walkthrough

A significant modification has been made to the DataTreeEvaluator class in the index.ts file. The diff function from the "deep-diff" library has been replaced with a custom wrapper function, convertMicroDiffToDeepDiff, which utilizes microDiff. This change affects how differences are computed and managed within the class.

Changes

Files Change Summary
app/client/src/workers/common/.../index.ts Replaced the diff function from "deep-diff" with convertMicroDiffToDeepDiff that wraps microDiff.
app/client/src/workers/common/.../index.ts Altered exports and imports, replacing diff with applyChange from "deep-diff".

Poem

A change in the code, swift and wise,
Diff replaced with micro from its rise,
DataTreeEvaluator gets a new glance,
With convertMicroDiffToDeepDiff's dance.
In the garden of updates, changes bloom,
Rabbits leap, embracing room.


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Jun 27 '24 11:06 coderabbitai[bot]

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

github-actions[bot] avatar Jul 05 '24 16:07 github-actions[bot]

This PR has been closed because of inactivity.

github-actions[bot] avatar Jul 12 '24 16:07 github-actions[bot]