diff --git a/app/client/build.sh b/app/client/build.sh index 146c6d355f0c..2c1917a54370 100755 --- a/app/client/build.sh +++ b/app/client/build.sh @@ -18,6 +18,6 @@ export REACT_APP_SENTRY_RELEASE=$GIT_SHA export REACT_APP_CLIENT_LOG_LEVEL=ERROR # Disable CRA built-in ESLint checks since we have our own config and a separate step for this export DISABLE_ESLINT_PLUGIN=true -craco --max-old-space-size=7168 build --config craco.build.config.js +CI=false craco --max-old-space-size=7168 build --config craco.build.config.js echo "build finished" diff --git a/app/client/craco.common.config.js b/app/client/craco.common.config.js index e1c4c6cf99b0..eb43c8256238 100644 --- a/app/client/craco.common.config.js +++ b/app/client/craco.common.config.js @@ -72,7 +72,9 @@ module.exports = { }, ], }, + devtool: "source-map", optimization: { + minimize: false, splitChunks: { cacheGroups: { icons: { diff --git a/app/client/src/ce/workers/Evaluation/dataTreeUtils.ts b/app/client/src/ce/workers/Evaluation/dataTreeUtils.ts index 86ee6dfd807a..68b55bd48c52 100644 --- a/app/client/src/ce/workers/Evaluation/dataTreeUtils.ts +++ b/app/client/src/ce/workers/Evaluation/dataTreeUtils.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import type { DataTree } from "entities/DataTree/dataTreeTypes"; import { isObject, set } from "lodash"; import { klona } from "klona/json"; @@ -7,6 +8,14 @@ import type { EvalProps } from "workers/common/DataTreeEvaluator"; * This method loops through each entity object of dataTree and sets the entity config from prototype as object properties. * This is done to send back dataTree in the format expected by mainThread. */ + +const klona16 = (data: any) => { + return klona(data); +}; +const klona17 = (data: any) => { + return klona(data); +}; + export function makeEntityConfigsAsObjProperties( dataTree: DataTree, option = {} as { @@ -25,7 +34,9 @@ export function makeEntityConfigsAsObjProperties( : entity; } - const dataTreeToReturn = sanitizeDataTree ? klona(newDataTree) : newDataTree; + const dataTreeToReturn = sanitizeDataTree + ? klona16(newDataTree) + : newDataTree; if (!evalProps) return dataTreeToReturn; @@ -35,7 +46,7 @@ export function makeEntityConfigsAsObjProperties( set( dataTreeToReturn[entityName], "__evaluation__", - klona({ errors: entityEvalProps.__evaluation__.errors }), + klona17({ errors: entityEvalProps.__evaluation__.errors }), ); } diff --git a/app/client/src/workers/Evaluation/JSObject/Collection.ts b/app/client/src/workers/Evaluation/JSObject/Collection.ts index 180402cde360..6d8a08dc3b10 100644 --- a/app/client/src/workers/Evaluation/JSObject/Collection.ts +++ b/app/client/src/workers/Evaluation/JSObject/Collection.ts @@ -94,7 +94,13 @@ export default class JSObjectCollection { // TODO: Fix this the next time the file is edited // eslint-disable-next-line @typescript-eslint/no-explicit-any ): VariableState | Record { - if (!JSObjectName || !this.variableState) return klona(this.variableState); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const klona14 = (data: any) => { + return klona(data); + }; + + if (!JSObjectName || !this.variableState) + return klona14(this.variableState); return this.variableState[JSObjectName]; } diff --git a/app/client/src/workers/Evaluation/evaluate.ts b/app/client/src/workers/Evaluation/evaluate.ts index 96a851e89870..372df35280e3 100644 --- a/app/client/src/workers/Evaluation/evaluate.ts +++ b/app/client/src/workers/Evaluation/evaluate.ts @@ -224,6 +224,10 @@ export interface createEvaluationContextArgs { * the particular entities only. This avoid unnecessary cloning of every entity and further multiple times. * */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const klona10 = (data: any) => { + return klona(data); +}; const overrideEvalContext = ( EVAL_CONTEXT: EvalContext, overrideContext?: Record, @@ -236,7 +240,7 @@ const overrideEvalContext = ( if (entityName in EVAL_CONTEXT && !entitiesClonedSoFar.has(entityName)) { entitiesClonedSoFar.add(entityName); - EVAL_CONTEXT[entityName] = klona(EVAL_CONTEXT[entityName]); + EVAL_CONTEXT[entityName] = klona10(EVAL_CONTEXT[entityName]); } }); diff --git a/app/client/src/workers/Evaluation/fns/overrides/console.ts b/app/client/src/workers/Evaluation/fns/overrides/console.ts index 44379be028ec..6ee2092f4f9e 100644 --- a/app/client/src/workers/Evaluation/fns/overrides/console.ts +++ b/app/client/src/workers/Evaluation/fns/overrides/console.ts @@ -157,14 +157,17 @@ class UserLog { return { method, id, - data: this.sanitizeData(klona(output)), + data: this.sanitizeData(klona12(output)), timestamp, severity, source: this.getSource(triggerMeta), }; } } - +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const klona12 = (data: any) => { + return klona(data); +}; const userLogs = new UserLog(); export default userLogs; diff --git a/app/client/src/workers/Evaluation/fns/resetWidget.ts b/app/client/src/workers/Evaluation/fns/resetWidget.ts index ffa8cfb3a0e9..360c5504db5e 100644 --- a/app/client/src/workers/Evaluation/fns/resetWidget.ts +++ b/app/client/src/workers/Evaluation/fns/resetWidget.ts @@ -61,6 +61,11 @@ async function resetWidget( ); } +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const klona11 = (data: any) => { + return klona(data); +}; + function resetWidgetMetaProperty( widgetName: string, resetChildren = true, @@ -123,9 +128,9 @@ function resetWidgetMetaProperty( configTree, ); - finalValue = klona(result); + finalValue = klona11(result); } else { - finalValue = klona(expressionToEvaluate); + finalValue = klona11(expressionToEvaluate); } // Switch back to async evaluation once done with sync tasks. diff --git a/app/client/src/workers/Evaluation/handlers/evalExpression.ts b/app/client/src/workers/Evaluation/handlers/evalExpression.ts index f5546ea38971..16618a5043d4 100644 --- a/app/client/src/workers/Evaluation/handlers/evalExpression.ts +++ b/app/client/src/workers/Evaluation/handlers/evalExpression.ts @@ -2,6 +2,10 @@ import { klona } from "klona/full"; import { evaluateAsync } from "../evaluate"; import type { EvalWorkerASyncRequest } from "../types"; import { dataTreeEvaluator } from "./evalTree"; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const klona13 = (data: any) => { + return klona(data); +}; export default function (request: EvalWorkerASyncRequest) { const { data } = request; @@ -11,5 +15,11 @@ export default function (request: EvalWorkerASyncRequest) { if (!evalTree || !configTree) return {}; - return evaluateAsync(expression, klona(evalTree), configTree, {}, undefined); + return evaluateAsync( + expression, + klona13(evalTree), + configTree, + {}, + undefined, + ); } diff --git a/app/client/src/workers/common/DataTreeEvaluator/index.ts b/app/client/src/workers/common/DataTreeEvaluator/index.ts index d874741e483b..ba93c2c3bea8 100644 --- a/app/client/src/workers/common/DataTreeEvaluator/index.ts +++ b/app/client/src/workers/common/DataTreeEvaluator/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import type { DataTreeEvaluationProps, EvalError as TEvalError, @@ -241,6 +242,15 @@ export default class DataTreeEvaluator { * Method to create all data required for linting and * evaluation of the first tree */ + klona1(data: any) { + return klona(data); + } + klona2(data: any) { + return klona(data); + } + klona3(data: any) { + return klona(data); + } async setupFirstTree( // TODO: Fix this the next time the file is edited // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -254,7 +264,7 @@ export default class DataTreeEvaluator { const totalFirstTreeSetupStartTime = performance.now(); // cloneDeep will make sure not to omit key which has value as undefined. const firstCloneStartTime = performance.now(); - let localUnEvalTree = klona(unEvalTree); + let localUnEvalTree = this.klona1(unEvalTree); const firstCloneEndTime = performance.now(); let jsUpdates: Record = {}; @@ -326,7 +336,7 @@ export default class DataTreeEvaluator { const secondCloneStartTime = performance.now(); - this.oldUnEvalTree = klona(localUnEvalTree); + this.oldUnEvalTree = this.klona2(localUnEvalTree); this.oldConfigTree = configTree; const secondCloneEndTime = performance.now(); @@ -834,7 +844,7 @@ export default class DataTreeEvaluator { // TODO: For some reason we are passing some reference which are getting mutated. // Need to check why big api responses are getting split between two eval runs - this.oldUnEvalTree = klona(updatedUnEvalTree); + this.oldUnEvalTree = this.klona3(updatedUnEvalTree); this.oldConfigTree = Object.assign({}, this.getConfigTree()); const cloneEndTime = performance.now(); @@ -1040,6 +1050,27 @@ export default class DataTreeEvaluator { return privateWidgets; } + klona4(data: any) { + return klona(data); + } + klona5(data: any) { + return klona(data); + } + klona6(data: any) { + return klona(data); + } + klona7(data: any) { + return klona(data); + } + klona8(data: any) { + return klona(data); + } + klona9(data: any) { + return klona(data); + } + klona15(data: any) { + return klonaJSON(data); + } evaluateTree( unEvalTree: DataTree, evaluationOrder: Array, @@ -1059,9 +1090,9 @@ export default class DataTreeEvaluator { staleMetaIds: string[]; contextTree: DataTree; } { - const safeTree = klona(unEvalTree); + const safeTree = this.klona4(unEvalTree); const dataStore = DataStore.getDataStore(); - const dataStoreClone = klonaJSON(dataStore); + const dataStoreClone = this.klona15(dataStore); updateTreeWithData(safeTree, dataStoreClone); updateTreeWithData(unEvalTree, dataStore); @@ -1207,7 +1238,7 @@ export default class DataTreeEvaluator { ); set(contextTree, fullPropertyPath, parsedValue); - set(safeTree, fullPropertyPath, klona(parsedValue)); + set(safeTree, fullPropertyPath, this.klona5(parsedValue)); staleMetaIds = staleMetaIds.concat( getStaleMetaStateIds({ @@ -1253,7 +1284,7 @@ export default class DataTreeEvaluator { if (!requiresEval) continue; set(contextTree, fullPropertyPath, evalPropertyValue); - set(safeTree, fullPropertyPath, klona(evalPropertyValue)); + set(safeTree, fullPropertyPath, this.klona6(evalPropertyValue)); break; } case ENTITY_TYPE.JSACTION: { @@ -1290,7 +1321,7 @@ export default class DataTreeEvaluator { * Their evaluated values need to be reset only when the variable is modified by the user. * When uneval value of a js variable hasn't changed, it means that the previously evaluated values are in both trees already */ if (!skipVariableValueAssignment) { - const valueForSafeTree = klona(evalValue); + const valueForSafeTree = this.klona7(evalValue); set(contextTree, fullPropertyPath, evalValue); set(safeTree, fullPropertyPath, valueForSafeTree); @@ -1305,7 +1336,7 @@ export default class DataTreeEvaluator { } default: set(contextTree, fullPropertyPath, evalPropertyValue); - set(safeTree, fullPropertyPath, klona(evalPropertyValue)); + set(safeTree, fullPropertyPath, this.klona8(evalPropertyValue)); } } } catch (error) { @@ -1793,7 +1824,7 @@ export default class DataTreeEvaluator { bindings: string[], executionParams?: Record | string, ) { - const dataTree = klona(this.evalTree); + const dataTree = this.klona9(this.evalTree); // We might get execution params as an object or as a string. // If the user has added a proper object (valid case) it will be an object // If they have not added any execution params or not an object