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: Parse js actions for view mode changes #18357

Merged
merged 19 commits into from
Dec 12, 2022

Conversation

ApekshaBhosale
Copy link
Contributor

@ApekshaBhosale ApekshaBhosale commented Nov 22, 2022

Description

Each time we load an application in view/edit mode, we parse each js object body to get the functions and variables to be executed. After parsing, we convert each js object function from string to function format.

As part of performance improvement, we realized we don't need to parse each js object body to get functions and variables in view mode because we don't update js objects in view if any discrepancies are detected on the client and server-side.

As a result of that, we can completely rely on the state of the js object we get from the backend. Each js object has an actions property and each action has js function saved in the body in string format which can be converted into function format to be executed which makes view mode faster because we will avoid parsing .

Fixes #18291

Type of change

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

How Has This Been Tested?

Test Plan

Add Testsmith test cases links that relate to this PR

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 Nov 22, 2022

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

Name Status Preview Updated
appsmith ✅ Ready (Inspect) Visit Preview Dec 12, 2022 at 10:48AM (UTC)

@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

@ApekshaBhosale
Copy link
Contributor Author

/ok-to-test sha=dd1dbf7

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3530231300.
Workflow: Appsmith External Integration Test Workflow.
Commit: dd1dbf7.
PR: 18357.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-63465d4789020c7ac296d08d?pr=18357&runId=3530231300_1

@ApekshaBhosale
Copy link
Contributor Author

/ok-to-test sha=846e7d1

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3531716068.
Workflow: Appsmith External Integration Test Workflow.
Commit: 846e7d1.
PR: 18357.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-63465d4789020c7ac296d08d?pr=18357&runId=3531716068_1

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3531884132.
Workflow: Appsmith External Integration Test Workflow.
Commit: 846e7d1.
PR: 18357.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-63465d4789020c7ac296d08d?pr=18357&runId=3531884132_1

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3531898511.
Workflow: Appsmith External Integration Test Workflow.
Commit: 846e7d1.
PR: 18357.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-63465d4789020c7ac296d08d?pr=18357&runId=3531898511_1

@ApekshaBhosale
Copy link
Contributor Author

/ok-to-test sha=a4aa226

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3532804329.
Workflow: Appsmith External Integration Test Workflow.
Commit: a4aa226.
PR: 18357.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-63465d4789020c7ac296d08d?pr=18357&runId=3532804329_1

@ApekshaBhosale ApekshaBhosale changed the title [WIP] parse js actions for view mode changes fix: Parse js actions for view mode changes Nov 24, 2022
@github-actions github-actions bot added the Bug Something isn't working label Nov 24, 2022
@ApekshaBhosale
Copy link
Contributor Author

/ok-to-test sha=80bb50a

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3546691853.
Workflow: Appsmith External Integration Test Workflow.
Commit: 80bb50a.
PR: 18357.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-63465d4789020c7ac296d08d?pr=18357&runId=3546691853_1

@rimildeyjsr
Copy link
Contributor

/ok-to-test sha=80e7b11

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3570650277.
Workflow: Appsmith External Integration Test Workflow.
Commit: 80e7b11.
PR: 18357.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-63465d4789020c7ac296d08d?pr=18357&runId=3570650277_1

delete dataTreeEvalRef.currentJSCollectionState[`${entityName}`];
const jsActions = entity.meta;
//think about adding variables as currentJSCollectionState
Object.keys(jsActions).forEach((jsAction: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

We would have the functions inside resolvedFunctions already. Could you please check ?

@github-actions
Copy link

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

@arunvjn
Copy link
Contributor

arunvjn commented Dec 10, 2022

/perf-test

@github-actions
Copy link

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

@rimildeyjsr
Copy link
Contributor

/ok-to-test sha=ff924b6

@github-actions
Copy link

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

@AnandiKulkarni AnandiKulkarni added the Test Plan Approved Manual/Cypress tests covers changes made on the PR. Else, add skip-testPlan label if not applicable label Dec 12, 2022
@rimildeyjsr
Copy link
Contributor

/ok-to-test sha=575964e

@github-actions
Copy link

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

@rimildeyjsr rimildeyjsr merged commit efa8b68 into release Dec 12, 2022
@rimildeyjsr rimildeyjsr deleted the view-mode-parsejsactions-changes branch December 12, 2022 14:15
@github-actions github-actions bot added FE Coders Pod Issues related to users writing javascript in appsmith High This issue blocks a user from building or impacts a lot of users JS Evaluation Issues related to JS evaluation on the platform Performance Pod All things related to Appsmith performance QA Needs QA attention Task A simple Todo labels Dec 13, 2022
rimildeyjsr added a commit that referenced this pull request Dec 20, 2022
mohanarpit pushed a commit that referenced this pull request Dec 21, 2022
Revert "fix: Parse js actions for view mode changes (#18357)"

This reverts commit efa8b68.
rimildeyjsr added a commit that referenced this pull request Dec 21, 2022
Revert "fix: Parse js actions for view mode changes (#18357)"

This reverts commit efa8b68.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working FE Coders Pod Issues related to users writing javascript in appsmith High This issue blocks a user from building or impacts a lot of users JS Evaluation Issues related to JS evaluation on the platform Performance Pod All things related to Appsmith performance QA Needs QA attention Task A simple Todo Test Plan Approved Manual/Cypress tests covers changes made on the PR. Else, add skip-testPlan label if not applicable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Remove parse JS Actions from View mode
5 participants