Skip to content
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: All property control renders when JS toggle button is clicked #18905

Merged
merged 14 commits into from Dec 19, 2022

Conversation

aswathkk
Copy link
Contributor

@aswathkk aswathkk commented Dec 13, 2022

Description

TL;DR: Fix the performance issue that happens when we click the JS toggle button in property pane.

Each property controls were getting rendered whenever we click the JS toggle button. This is since one of the selector used in PropertyControl was returning dynamicPropertyPathList which will always change when we click JS toggle button anywhere. Now, instead of returning dynamicPropertyPathList from that selector, we are returning a derived boolean value that is specific for the PropertyControl which calls this selector.
Similar behaviour was noticed with dynamicTriggerPathList as well. That is also resolved in a similar manner.

While working on this, I noticed the ActionCreator was also rendering since we aren't using proper selectors. That is also fixed.

Introduced proxy-momoize library which is an alternative to reselect's createSelector. This makes use of ES6 proxies to do an efficient memoization.

Fixes #11040

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Manual

Issues raised during DP testing

Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR)

Checklist:

Dev activity

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • PR is being merged under a feature flag

QA activity:

  • Test plan has been approved by relevant developers
  • Test plan has been peer reviewed by QA
  • Cypress test cases have been added and approved by either SDET or manual QA
  • Organized project review call with relevant stakeholders after Round 1/2 of QA
  • Added Test Plan Approved label after reveiwing all Cypress test

@vercel
Copy link

vercel bot commented Dec 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
appsmith ✅ Ready (Inspect) Visit Preview Dec 19, 2022 at 2:53AM (UTC)

@github-actions github-actions bot added High This issue blocks a user from building or impacts a lot of users Performance Pod All things related to Appsmith performance Property Pane Issues related to the behaviour of the property pane Task A simple Todo UI Builders Pod Issues that UI Builders face using appsmith UI Performance Issues related to UI performance Bug Something isn't working labels Dec 13, 2022
@appsmithorg appsmithorg deleted a comment from github-actions bot Dec 14, 2022
SatishGandham
SatishGandham previously approved these changes Dec 14, 2022
Copy link
Contributor

@SatishGandham SatishGandham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except that one minor change requested.

Good job with the PR description :)

import { EVALUATION_PATH } from "utils/DynamicBindingUtils";
import {
EVALUATION_PATH,
isPathADynamicProperty,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT. I don't think we need articles here. isPathDynamicProperty should be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SatishGandham
isPathADynamicTrigger and isPathADynamicProperty is being used in multiple places. Should I change it in this PR?

@SatishGandham
Copy link
Contributor

@aswathkk , any performance numbers?

@aswathkk
Copy link
Contributor Author

@SatishGandham I found the scripting time reduced from ~50ms to ~25ms after clicking on the JS toggle.

@aswathkk aswathkk removed the request for review from rahulramesha December 15, 2022 05:33
@aswathkk
Copy link
Contributor Author

/ok-to-test sha=ab2b231

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3701831117.
Workflow: Appsmith External Integration Test Workflow.
Commit: ab2b231.
PR: 18905.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18905&runId=3701831117_1

@aswathkk
Copy link
Contributor Author

/ok-to-test sha=ab2b231

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3705900418.
Workflow: Appsmith External Integration Test Workflow.
Commit: ab2b231.
PR: 18905.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18905&runId=3705900418_1

@aswathkk
Copy link
Contributor Author

/perf-test sha=ab2b231

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3708015282.
Workflow: Performance Tests Workflow.
Commit: ab2b231.
PR: 18905.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18905&runId=3708015282_1

@aswathkk
Copy link
Contributor Author

/ok-to-test sha=824cdd1

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3727945159.
Workflow: Appsmith External Integration Test Workflow.
Commit: 824cdd1.
PR: 18905.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18905&runId=3727945159_1

@aswathkk
Copy link
Contributor Author

/perf-test sha=ab2b231

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3728841549.
Workflow: Performance Tests Workflow.
Commit: ab2b231.
PR: 18905.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18905&runId=3728841549_1

@aswathkk
Copy link
Contributor Author

/perf-test sha=ab2b231

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3729221059.
Workflow: Performance Tests Workflow.
Commit: ab2b231.
PR: 18905.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18905&runId=3729221059_1

@sharat87 sharat87 merged commit f9e17f6 into release Dec 19, 2022
@sharat87 sharat87 deleted the fix/pp-rendering branch December 19, 2022 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working High This issue blocks a user from building or impacts a lot of users Performance Pod All things related to Appsmith performance Property Pane Issues related to the behaviour of the property pane Task A simple Todo UI Builders Pod Issues that UI Builders face using appsmith UI Performance Issues related to UI performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Type]-[18352]:All the Property pane controls re-renders when we press js toggle
3 participants