PromucFlow_constructor/app/client/src/workers/Evaluation/evalTreeWithChanges.ts

104 lines
3.3 KiB
TypeScript
Raw Normal View History

feat: JSObject variable as a state (JSObject variable mutation) (#19926) Fixes #19653 Fixes #14568 Fixes #17199 Fixes #14989 In this PR, we introduce a new feature in JSObject where the `variables` are now state and widgets are reactive to the change in the variable value. - It means that `JSObject.myVar1 = "Hello world"` would show `Hello world` where ever a binding `{{JSObject.myVar1}}` is used. Further changes - JSObject run functionality, executes all the functions in async evaluation. - `executeSyncJS` flow is removed - `resolvedFunctions` state is moved to JSCollection class. - unEval JSObject value i.e., currentJSCollectionState is moved to JSCollection class. - `evalTreeWithChanges` is introduced - A new flow to trigger evaluation from the worker and send the updated dataTree to mainThread. - This would open up a new possibility of features in evaluation mentioned [here](https://www.notion.so/appsmith/RFC-Dependent-Property-in-Widgets-f3b29ad652b549dd8c49189f48dbbc4b) - Introduction of `updateDataTreeHandler` to accept new dataTree from the worker. ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Jest Test - `Mutation.test.ts` - `JSVariableProxy.test.ts` - `removeProxy.test.ts` ### Cypress test - Mutation with - numbers - array - object - map - set ### Test Plan - https://github.com/appsmithorg/TestSmith/issues/2186 ### Issues raised during DP testing - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1453275688 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1478975487 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1482929425 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1486611858 Co-authored-by: Rimil Dey <rimildeyjsr@gmail.com> Co-authored-by: Rimil Dey <rimil@appsmith.com> Co-authored-by: arunvjn <32433245+arunvjn@users.noreply.github.com>
2023-04-07 07:41:36 +00:00
import type {
ConfigTree,
DataTree,
UnEvalTree,
} from "entities/DataTree/dataTreeFactory";
import { dataTreeEvaluator } from "./handlers/evalTree";
import type { DataTreeDiff } from "@appsmith/workers/Evaluation/evaluationUtils";
import type { EvalMetaUpdates } from "@appsmith/workers/common/DataTreeEvaluator/types";
import type { DependencyMap, EvalError } from "utils/DynamicBindingUtils";
import { makeEntityConfigsAsObjProperties } from "@appsmith/workers/Evaluation/dataTreeUtils";
import type { EvalTreeResponseData } from "./types";
import { MessageType, sendMessage } from "utils/MessageUtil";
import { MAIN_THREAD_ACTION } from "@appsmith/workers/Evaluation/evalWorkerActions";
import type { UpdateDataTreeMessageData } from "sagas/EvalWorkerActionSagas";
import type { JSUpdate } from "utils/JSPaneUtils";
fix: API.run undefined error (#23518) ## Description After evaluating the variable mutation changes set the evalContext to async evaluation so that API or query could execute as expected. #### PR fixes following issue(s) Fixes https://github.com/appsmithorg/appsmith/issues/23519 #### Type of change - Bug fix (non-breaking change which fixes an issue) ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] Jest - [ ] Cypress > > #### 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: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-05-22 06:10:59 +00:00
import { setEvalContext } from "./evaluate";
feat: JSObject variable as a state (JSObject variable mutation) (#19926) Fixes #19653 Fixes #14568 Fixes #17199 Fixes #14989 In this PR, we introduce a new feature in JSObject where the `variables` are now state and widgets are reactive to the change in the variable value. - It means that `JSObject.myVar1 = "Hello world"` would show `Hello world` where ever a binding `{{JSObject.myVar1}}` is used. Further changes - JSObject run functionality, executes all the functions in async evaluation. - `executeSyncJS` flow is removed - `resolvedFunctions` state is moved to JSCollection class. - unEval JSObject value i.e., currentJSCollectionState is moved to JSCollection class. - `evalTreeWithChanges` is introduced - A new flow to trigger evaluation from the worker and send the updated dataTree to mainThread. - This would open up a new possibility of features in evaluation mentioned [here](https://www.notion.so/appsmith/RFC-Dependent-Property-in-Widgets-f3b29ad652b549dd8c49189f48dbbc4b) - Introduction of `updateDataTreeHandler` to accept new dataTree from the worker. ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Jest Test - `Mutation.test.ts` - `JSVariableProxy.test.ts` - `removeProxy.test.ts` ### Cypress test - Mutation with - numbers - array - object - map - set ### Test Plan - https://github.com/appsmithorg/TestSmith/issues/2186 ### Issues raised during DP testing - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1453275688 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1478975487 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1482929425 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1486611858 Co-authored-by: Rimil Dey <rimildeyjsr@gmail.com> Co-authored-by: Rimil Dey <rimil@appsmith.com> Co-authored-by: arunvjn <32433245+arunvjn@users.noreply.github.com>
2023-04-07 07:41:36 +00:00
feat: widget property setters (#23441) ## Description - This PR adds setter methods to update widget property programmatically. Example:- `Input1.setText("setter methods are cool!");` Docs link : https://docs.appsmith.com/reference/widgets For any selected widget check the `Methods` section #### PR fixes following issue(s) Fixes #### Type of change - New feature (non-breaking change which adds functionality) ## Testing > #### How Has This Been Tested? - [x] Manual - [x] Jest - [x] Cypress > > #### Test Plan https://github.com/appsmithorg/TestSmith/issues/2409 #### Issues raised during DP testing - [x] [Errors are not logged in the debugger](https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1564017346) separate GitHub issue https://github.com/appsmithorg/appsmith/issues/24609 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1564155545 ( `setVisibility("false")` ) - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1580525843 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1576582825 - Blocker for testing - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1577956441 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1577930108 - Not a issue (lint error query) - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1593471791 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1591440488 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1586747864 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1596738201 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1598541537 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1611413076 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1612621567 - [ ] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1619654507 - [ ] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1621256722 > > ## 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: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [x] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [x] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed --------- Co-authored-by: Rishabh Rathod <rishabh.rathod@appsmith.com>
2023-07-08 14:07:26 +00:00
export function evalTreeWithChanges(
updatedValuePaths: string[][],
metaUpdates: EvalMetaUpdates = [],
) {
feat: JSObject variable as a state (JSObject variable mutation) (#19926) Fixes #19653 Fixes #14568 Fixes #17199 Fixes #14989 In this PR, we introduce a new feature in JSObject where the `variables` are now state and widgets are reactive to the change in the variable value. - It means that `JSObject.myVar1 = "Hello world"` would show `Hello world` where ever a binding `{{JSObject.myVar1}}` is used. Further changes - JSObject run functionality, executes all the functions in async evaluation. - `executeSyncJS` flow is removed - `resolvedFunctions` state is moved to JSCollection class. - unEval JSObject value i.e., currentJSCollectionState is moved to JSCollection class. - `evalTreeWithChanges` is introduced - A new flow to trigger evaluation from the worker and send the updated dataTree to mainThread. - This would open up a new possibility of features in evaluation mentioned [here](https://www.notion.so/appsmith/RFC-Dependent-Property-in-Widgets-f3b29ad652b549dd8c49189f48dbbc4b) - Introduction of `updateDataTreeHandler` to accept new dataTree from the worker. ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Jest Test - `Mutation.test.ts` - `JSVariableProxy.test.ts` - `removeProxy.test.ts` ### Cypress test - Mutation with - numbers - array - object - map - set ### Test Plan - https://github.com/appsmithorg/TestSmith/issues/2186 ### Issues raised during DP testing - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1453275688 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1478975487 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1482929425 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1486611858 Co-authored-by: Rimil Dey <rimildeyjsr@gmail.com> Co-authored-by: Rimil Dey <rimil@appsmith.com> Co-authored-by: arunvjn <32433245+arunvjn@users.noreply.github.com>
2023-04-07 07:41:36 +00:00
let evalOrder: string[] = [];
let jsUpdates: Record<string, JSUpdate> = {};
let unEvalUpdates: DataTreeDiff[] = [];
let nonDynamicFieldValidationOrder: string[] = [];
const isCreateFirstTree = false;
let dataTree: DataTree = {};
const errors: EvalError[] = [];
const logs: any[] = [];
const dependencies: DependencyMap = {};
feat: widget property setters (#23441) ## Description - This PR adds setter methods to update widget property programmatically. Example:- `Input1.setText("setter methods are cool!");` Docs link : https://docs.appsmith.com/reference/widgets For any selected widget check the `Methods` section #### PR fixes following issue(s) Fixes #### Type of change - New feature (non-breaking change which adds functionality) ## Testing > #### How Has This Been Tested? - [x] Manual - [x] Jest - [x] Cypress > > #### Test Plan https://github.com/appsmithorg/TestSmith/issues/2409 #### Issues raised during DP testing - [x] [Errors are not logged in the debugger](https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1564017346) separate GitHub issue https://github.com/appsmithorg/appsmith/issues/24609 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1564155545 ( `setVisibility("false")` ) - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1580525843 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1576582825 - Blocker for testing - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1577956441 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1577930108 - Not a issue (lint error query) - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1593471791 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1591440488 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1586747864 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1596738201 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1598541537 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1611413076 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1612621567 - [ ] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1619654507 - [ ] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1621256722 > > ## 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: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [x] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [x] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed --------- Co-authored-by: Rishabh Rathod <rishabh.rathod@appsmith.com>
2023-07-08 14:07:26 +00:00
let evalMetaUpdates: EvalMetaUpdates = metaUpdates;
feat: JSObject variable as a state (JSObject variable mutation) (#19926) Fixes #19653 Fixes #14568 Fixes #17199 Fixes #14989 In this PR, we introduce a new feature in JSObject where the `variables` are now state and widgets are reactive to the change in the variable value. - It means that `JSObject.myVar1 = "Hello world"` would show `Hello world` where ever a binding `{{JSObject.myVar1}}` is used. Further changes - JSObject run functionality, executes all the functions in async evaluation. - `executeSyncJS` flow is removed - `resolvedFunctions` state is moved to JSCollection class. - unEval JSObject value i.e., currentJSCollectionState is moved to JSCollection class. - `evalTreeWithChanges` is introduced - A new flow to trigger evaluation from the worker and send the updated dataTree to mainThread. - This would open up a new possibility of features in evaluation mentioned [here](https://www.notion.so/appsmith/RFC-Dependent-Property-in-Widgets-f3b29ad652b549dd8c49189f48dbbc4b) - Introduction of `updateDataTreeHandler` to accept new dataTree from the worker. ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Jest Test - `Mutation.test.ts` - `JSVariableProxy.test.ts` - `removeProxy.test.ts` ### Cypress test - Mutation with - numbers - array - object - map - set ### Test Plan - https://github.com/appsmithorg/TestSmith/issues/2186 ### Issues raised during DP testing - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1453275688 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1478975487 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1482929425 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1486611858 Co-authored-by: Rimil Dey <rimildeyjsr@gmail.com> Co-authored-by: Rimil Dey <rimil@appsmith.com> Co-authored-by: arunvjn <32433245+arunvjn@users.noreply.github.com>
2023-04-07 07:41:36 +00:00
let staleMetaIds: string[] = [];
const pathsToClearErrorsFor: any[] = [];
fix: Prevent evalTree and configTree from being undefined (#23374) ## Description This PR prevents evalTree and configTree from being undefined values. #### PR fixes following issue(s) Fixes #23283 #### Type of change - Bug fix (non-breaking change which fixes an issue) ## Testing Nil #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] Jest - [ ] Cypress > > #### 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: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-05-22 06:17:23 +00:00
let unevalTree: UnEvalTree = {};
let configTree: ConfigTree = {};
feat: JSObject variable as a state (JSObject variable mutation) (#19926) Fixes #19653 Fixes #14568 Fixes #17199 Fixes #14989 In this PR, we introduce a new feature in JSObject where the `variables` are now state and widgets are reactive to the change in the variable value. - It means that `JSObject.myVar1 = "Hello world"` would show `Hello world` where ever a binding `{{JSObject.myVar1}}` is used. Further changes - JSObject run functionality, executes all the functions in async evaluation. - `executeSyncJS` flow is removed - `resolvedFunctions` state is moved to JSCollection class. - unEval JSObject value i.e., currentJSCollectionState is moved to JSCollection class. - `evalTreeWithChanges` is introduced - A new flow to trigger evaluation from the worker and send the updated dataTree to mainThread. - This would open up a new possibility of features in evaluation mentioned [here](https://www.notion.so/appsmith/RFC-Dependent-Property-in-Widgets-f3b29ad652b549dd8c49189f48dbbc4b) - Introduction of `updateDataTreeHandler` to accept new dataTree from the worker. ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Jest Test - `Mutation.test.ts` - `JSVariableProxy.test.ts` - `removeProxy.test.ts` ### Cypress test - Mutation with - numbers - array - object - map - set ### Test Plan - https://github.com/appsmithorg/TestSmith/issues/2186 ### Issues raised during DP testing - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1453275688 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1478975487 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1482929425 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1486611858 Co-authored-by: Rimil Dey <rimildeyjsr@gmail.com> Co-authored-by: Rimil Dey <rimil@appsmith.com> Co-authored-by: arunvjn <32433245+arunvjn@users.noreply.github.com>
2023-04-07 07:41:36 +00:00
if (dataTreeEvaluator) {
const setupUpdateTreeResponse =
dataTreeEvaluator.setupUpdateTreeWithDifferences(updatedValuePaths);
evalOrder = setupUpdateTreeResponse.evalOrder;
unEvalUpdates = setupUpdateTreeResponse.unEvalUpdates;
jsUpdates = setupUpdateTreeResponse.jsUpdates;
nonDynamicFieldValidationOrder =
setupUpdateTreeResponse.nonDynamicFieldValidationOrder;
const updateResponse = dataTreeEvaluator.evalAndValidateSubTree(
evalOrder,
nonDynamicFieldValidationOrder,
dataTreeEvaluator.oldConfigTree,
unEvalUpdates,
);
fix: API.run undefined error (#23518) ## Description After evaluating the variable mutation changes set the evalContext to async evaluation so that API or query could execute as expected. #### PR fixes following issue(s) Fixes https://github.com/appsmithorg/appsmith/issues/23519 #### Type of change - Bug fix (non-breaking change which fixes an issue) ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] Jest - [ ] Cypress > > #### 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: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-05-22 06:10:59 +00:00
setEvalContext({
feat: widget property setters (#23441) ## Description - This PR adds setter methods to update widget property programmatically. Example:- `Input1.setText("setter methods are cool!");` Docs link : https://docs.appsmith.com/reference/widgets For any selected widget check the `Methods` section #### PR fixes following issue(s) Fixes #### Type of change - New feature (non-breaking change which adds functionality) ## Testing > #### How Has This Been Tested? - [x] Manual - [x] Jest - [x] Cypress > > #### Test Plan https://github.com/appsmithorg/TestSmith/issues/2409 #### Issues raised during DP testing - [x] [Errors are not logged in the debugger](https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1564017346) separate GitHub issue https://github.com/appsmithorg/appsmith/issues/24609 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1564155545 ( `setVisibility("false")` ) - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1580525843 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1576582825 - Blocker for testing - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1577956441 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1577930108 - Not a issue (lint error query) - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1593471791 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1591440488 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1586747864 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1596738201 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1598541537 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1611413076 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1612621567 - [ ] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1619654507 - [ ] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1621256722 > > ## 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: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [x] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [x] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed --------- Co-authored-by: Rishabh Rathod <rishabh.rathod@appsmith.com>
2023-07-08 14:07:26 +00:00
dataTree: dataTreeEvaluator.getEvalTree(),
configTree: dataTreeEvaluator.getConfigTree(),
fix: API.run undefined error (#23518) ## Description After evaluating the variable mutation changes set the evalContext to async evaluation so that API or query could execute as expected. #### PR fixes following issue(s) Fixes https://github.com/appsmithorg/appsmith/issues/23519 #### Type of change - Bug fix (non-breaking change which fixes an issue) ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] Jest - [ ] Cypress > > #### 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: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-05-22 06:10:59 +00:00
isDataField: false,
isTriggerBased: true,
});
feat: JSObject variable as a state (JSObject variable mutation) (#19926) Fixes #19653 Fixes #14568 Fixes #17199 Fixes #14989 In this PR, we introduce a new feature in JSObject where the `variables` are now state and widgets are reactive to the change in the variable value. - It means that `JSObject.myVar1 = "Hello world"` would show `Hello world` where ever a binding `{{JSObject.myVar1}}` is used. Further changes - JSObject run functionality, executes all the functions in async evaluation. - `executeSyncJS` flow is removed - `resolvedFunctions` state is moved to JSCollection class. - unEval JSObject value i.e., currentJSCollectionState is moved to JSCollection class. - `evalTreeWithChanges` is introduced - A new flow to trigger evaluation from the worker and send the updated dataTree to mainThread. - This would open up a new possibility of features in evaluation mentioned [here](https://www.notion.so/appsmith/RFC-Dependent-Property-in-Widgets-f3b29ad652b549dd8c49189f48dbbc4b) - Introduction of `updateDataTreeHandler` to accept new dataTree from the worker. ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Jest Test - `Mutation.test.ts` - `JSVariableProxy.test.ts` - `removeProxy.test.ts` ### Cypress test - Mutation with - numbers - array - object - map - set ### Test Plan - https://github.com/appsmithorg/TestSmith/issues/2186 ### Issues raised during DP testing - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1453275688 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1478975487 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1482929425 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1486611858 Co-authored-by: Rimil Dey <rimildeyjsr@gmail.com> Co-authored-by: Rimil Dey <rimil@appsmith.com> Co-authored-by: arunvjn <32433245+arunvjn@users.noreply.github.com>
2023-04-07 07:41:36 +00:00
dataTree = makeEntityConfigsAsObjProperties(dataTreeEvaluator.evalTree, {
evalProps: dataTreeEvaluator.evalProps,
});
feat: widget property setters (#23441) ## Description - This PR adds setter methods to update widget property programmatically. Example:- `Input1.setText("setter methods are cool!");` Docs link : https://docs.appsmith.com/reference/widgets For any selected widget check the `Methods` section #### PR fixes following issue(s) Fixes #### Type of change - New feature (non-breaking change which adds functionality) ## Testing > #### How Has This Been Tested? - [x] Manual - [x] Jest - [x] Cypress > > #### Test Plan https://github.com/appsmithorg/TestSmith/issues/2409 #### Issues raised during DP testing - [x] [Errors are not logged in the debugger](https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1564017346) separate GitHub issue https://github.com/appsmithorg/appsmith/issues/24609 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1564155545 ( `setVisibility("false")` ) - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1580525843 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1576582825 - Blocker for testing - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1577956441 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1577930108 - Not a issue (lint error query) - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1593471791 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1591440488 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1586747864 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1596738201 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1598541537 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1611413076 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1612621567 - [ ] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1619654507 - [ ] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1621256722 > > ## 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: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [x] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [x] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed --------- Co-authored-by: Rishabh Rathod <rishabh.rathod@appsmith.com>
2023-07-08 14:07:26 +00:00
feat: JSObject variable as a state (JSObject variable mutation) (#19926) Fixes #19653 Fixes #14568 Fixes #17199 Fixes #14989 In this PR, we introduce a new feature in JSObject where the `variables` are now state and widgets are reactive to the change in the variable value. - It means that `JSObject.myVar1 = "Hello world"` would show `Hello world` where ever a binding `{{JSObject.myVar1}}` is used. Further changes - JSObject run functionality, executes all the functions in async evaluation. - `executeSyncJS` flow is removed - `resolvedFunctions` state is moved to JSCollection class. - unEval JSObject value i.e., currentJSCollectionState is moved to JSCollection class. - `evalTreeWithChanges` is introduced - A new flow to trigger evaluation from the worker and send the updated dataTree to mainThread. - This would open up a new possibility of features in evaluation mentioned [here](https://www.notion.so/appsmith/RFC-Dependent-Property-in-Widgets-f3b29ad652b549dd8c49189f48dbbc4b) - Introduction of `updateDataTreeHandler` to accept new dataTree from the worker. ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Jest Test - `Mutation.test.ts` - `JSVariableProxy.test.ts` - `removeProxy.test.ts` ### Cypress test - Mutation with - numbers - array - object - map - set ### Test Plan - https://github.com/appsmithorg/TestSmith/issues/2186 ### Issues raised during DP testing - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1453275688 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1478975487 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1482929425 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1486611858 Co-authored-by: Rimil Dey <rimildeyjsr@gmail.com> Co-authored-by: Rimil Dey <rimil@appsmith.com> Co-authored-by: arunvjn <32433245+arunvjn@users.noreply.github.com>
2023-04-07 07:41:36 +00:00
evalMetaUpdates = JSON.parse(
JSON.stringify(updateResponse.evalMetaUpdates),
);
staleMetaIds = updateResponse.staleMetaIds;
fix: Prevent evalTree and configTree from being undefined (#23374) ## Description This PR prevents evalTree and configTree from being undefined values. #### PR fixes following issue(s) Fixes #23283 #### Type of change - Bug fix (non-breaking change which fixes an issue) ## Testing Nil #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] Jest - [ ] Cypress > > #### 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: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-05-22 06:17:23 +00:00
unevalTree = dataTreeEvaluator.getOldUnevalTree();
configTree = dataTreeEvaluator.oldConfigTree;
feat: JSObject variable as a state (JSObject variable mutation) (#19926) Fixes #19653 Fixes #14568 Fixes #17199 Fixes #14989 In this PR, we introduce a new feature in JSObject where the `variables` are now state and widgets are reactive to the change in the variable value. - It means that `JSObject.myVar1 = "Hello world"` would show `Hello world` where ever a binding `{{JSObject.myVar1}}` is used. Further changes - JSObject run functionality, executes all the functions in async evaluation. - `executeSyncJS` flow is removed - `resolvedFunctions` state is moved to JSCollection class. - unEval JSObject value i.e., currentJSCollectionState is moved to JSCollection class. - `evalTreeWithChanges` is introduced - A new flow to trigger evaluation from the worker and send the updated dataTree to mainThread. - This would open up a new possibility of features in evaluation mentioned [here](https://www.notion.so/appsmith/RFC-Dependent-Property-in-Widgets-f3b29ad652b549dd8c49189f48dbbc4b) - Introduction of `updateDataTreeHandler` to accept new dataTree from the worker. ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Jest Test - `Mutation.test.ts` - `JSVariableProxy.test.ts` - `removeProxy.test.ts` ### Cypress test - Mutation with - numbers - array - object - map - set ### Test Plan - https://github.com/appsmithorg/TestSmith/issues/2186 ### Issues raised during DP testing - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1453275688 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1478975487 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1482929425 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1486611858 Co-authored-by: Rimil Dey <rimildeyjsr@gmail.com> Co-authored-by: Rimil Dey <rimil@appsmith.com> Co-authored-by: arunvjn <32433245+arunvjn@users.noreply.github.com>
2023-04-07 07:41:36 +00:00
}
const evalTreeResponse: EvalTreeResponseData = {
dataTree,
dependencies,
errors,
evalMetaUpdates,
evaluationOrder: evalOrder,
jsUpdates,
logs,
unEvalUpdates,
isCreateFirstTree,
fix: Prevent evalTree and configTree from being undefined (#23374) ## Description This PR prevents evalTree and configTree from being undefined values. #### PR fixes following issue(s) Fixes #23283 #### Type of change - Bug fix (non-breaking change which fixes an issue) ## Testing Nil #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] Jest - [ ] Cypress > > #### 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: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-05-22 06:17:23 +00:00
configTree,
feat: JSObject variable as a state (JSObject variable mutation) (#19926) Fixes #19653 Fixes #14568 Fixes #17199 Fixes #14989 In this PR, we introduce a new feature in JSObject where the `variables` are now state and widgets are reactive to the change in the variable value. - It means that `JSObject.myVar1 = "Hello world"` would show `Hello world` where ever a binding `{{JSObject.myVar1}}` is used. Further changes - JSObject run functionality, executes all the functions in async evaluation. - `executeSyncJS` flow is removed - `resolvedFunctions` state is moved to JSCollection class. - unEval JSObject value i.e., currentJSCollectionState is moved to JSCollection class. - `evalTreeWithChanges` is introduced - A new flow to trigger evaluation from the worker and send the updated dataTree to mainThread. - This would open up a new possibility of features in evaluation mentioned [here](https://www.notion.so/appsmith/RFC-Dependent-Property-in-Widgets-f3b29ad652b549dd8c49189f48dbbc4b) - Introduction of `updateDataTreeHandler` to accept new dataTree from the worker. ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Jest Test - `Mutation.test.ts` - `JSVariableProxy.test.ts` - `removeProxy.test.ts` ### Cypress test - Mutation with - numbers - array - object - map - set ### Test Plan - https://github.com/appsmithorg/TestSmith/issues/2186 ### Issues raised during DP testing - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1453275688 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1478975487 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1482929425 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1486611858 Co-authored-by: Rimil Dey <rimildeyjsr@gmail.com> Co-authored-by: Rimil Dey <rimil@appsmith.com> Co-authored-by: arunvjn <32433245+arunvjn@users.noreply.github.com>
2023-04-07 07:41:36 +00:00
staleMetaIds,
pathsToClearErrorsFor,
isNewWidgetAdded: false,
feat: Passing another param isUndefined to BINDING_SUCCESS event (#23112) ## Description Passing another param isUndefined that captures if the evaluatedValue of a new binding is undefined and is sent in the BINDING_SUCCESS event. Fixes #22909 #### Type of change - New feature (non-breaking change which adds functionality) ## Testing #### How Has This Been Tested? - [x] Validated binding for table , select multi select text and button ## 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: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-05-16 10:46:40 +00:00
undefinedEvalValuesMap: dataTreeEvaluator?.undefinedEvalValuesMap || {},
chore: Add analytics for JSObject variable (#24740) ## Description Add analytics for JSObject variable creation and mutation event. #### PR fixes following issue(s) Fixes #24038 #### Type of change - Bug fix (non-breaking change which fixes an issue) ## Testing #### How Has This Been Tested? #### Test Plan #### Issues raised during DP testing ## 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: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-06-23 10:42:27 +00:00
jsVarsCreatedEvent: [],
feat: JSObject variable as a state (JSObject variable mutation) (#19926) Fixes #19653 Fixes #14568 Fixes #17199 Fixes #14989 In this PR, we introduce a new feature in JSObject where the `variables` are now state and widgets are reactive to the change in the variable value. - It means that `JSObject.myVar1 = "Hello world"` would show `Hello world` where ever a binding `{{JSObject.myVar1}}` is used. Further changes - JSObject run functionality, executes all the functions in async evaluation. - `executeSyncJS` flow is removed - `resolvedFunctions` state is moved to JSCollection class. - unEval JSObject value i.e., currentJSCollectionState is moved to JSCollection class. - `evalTreeWithChanges` is introduced - A new flow to trigger evaluation from the worker and send the updated dataTree to mainThread. - This would open up a new possibility of features in evaluation mentioned [here](https://www.notion.so/appsmith/RFC-Dependent-Property-in-Widgets-f3b29ad652b549dd8c49189f48dbbc4b) - Introduction of `updateDataTreeHandler` to accept new dataTree from the worker. ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Jest Test - `Mutation.test.ts` - `JSVariableProxy.test.ts` - `removeProxy.test.ts` ### Cypress test - Mutation with - numbers - array - object - map - set ### Test Plan - https://github.com/appsmithorg/TestSmith/issues/2186 ### Issues raised during DP testing - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1453275688 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1478975487 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1482929425 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1486611858 Co-authored-by: Rimil Dey <rimildeyjsr@gmail.com> Co-authored-by: Rimil Dey <rimil@appsmith.com> Co-authored-by: arunvjn <32433245+arunvjn@users.noreply.github.com>
2023-04-07 07:41:36 +00:00
};
const data: UpdateDataTreeMessageData = {
workerResponse: evalTreeResponse,
fix: Prevent evalTree and configTree from being undefined (#23374) ## Description This PR prevents evalTree and configTree from being undefined values. #### PR fixes following issue(s) Fixes #23283 #### Type of change - Bug fix (non-breaking change which fixes an issue) ## Testing Nil #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [ ] Manual - [ ] Jest - [ ] Cypress > > #### 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: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-05-22 06:17:23 +00:00
unevalTree,
feat: JSObject variable as a state (JSObject variable mutation) (#19926) Fixes #19653 Fixes #14568 Fixes #17199 Fixes #14989 In this PR, we introduce a new feature in JSObject where the `variables` are now state and widgets are reactive to the change in the variable value. - It means that `JSObject.myVar1 = "Hello world"` would show `Hello world` where ever a binding `{{JSObject.myVar1}}` is used. Further changes - JSObject run functionality, executes all the functions in async evaluation. - `executeSyncJS` flow is removed - `resolvedFunctions` state is moved to JSCollection class. - unEval JSObject value i.e., currentJSCollectionState is moved to JSCollection class. - `evalTreeWithChanges` is introduced - A new flow to trigger evaluation from the worker and send the updated dataTree to mainThread. - This would open up a new possibility of features in evaluation mentioned [here](https://www.notion.so/appsmith/RFC-Dependent-Property-in-Widgets-f3b29ad652b549dd8c49189f48dbbc4b) - Introduction of `updateDataTreeHandler` to accept new dataTree from the worker. ## Type of change - New feature (non-breaking change which adds functionality) ## How Has This Been Tested? ### Jest Test - `Mutation.test.ts` - `JSVariableProxy.test.ts` - `removeProxy.test.ts` ### Cypress test - Mutation with - numbers - array - object - map - set ### Test Plan - https://github.com/appsmithorg/TestSmith/issues/2186 ### Issues raised during DP testing - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1453275688 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1478975487 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1482929425 - https://github.com/appsmithorg/appsmith/pull/19926#issuecomment-1486611858 Co-authored-by: Rimil Dey <rimildeyjsr@gmail.com> Co-authored-by: Rimil Dey <rimil@appsmith.com> Co-authored-by: arunvjn <32433245+arunvjn@users.noreply.github.com>
2023-04-07 07:41:36 +00:00
};
sendMessage.call(self, {
messageType: MessageType.DEFAULT,
body: {
data,
method: MAIN_THREAD_ACTION.UPDATE_DATATREE,
},
});
}