Skip to content

Commit af49f71

Browse files
authored
Merge pull request #41128 from appsmithorg/release
23/07 Daily Promotion
2 parents 4eaae6b + b4efa72 commit af49f71

File tree

38 files changed

+986
-272
lines changed

38 files changed

+986
-272
lines changed

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ ENV APPSMITH_SEGMENT_CE_KEY=${APPSMITH_SEGMENT_CE_KEY}
1111

1212
COPY deploy/docker/fs /
1313

14-
# Install git
1514
RUN apt-get update && \
16-
apt-get install -y git && \
15+
apt-get install -y software-properties-common && \
16+
add-apt-repository -y ppa:git-core/ppa && \
17+
apt-get update && \
18+
apt-get install -y git tar zstd openssh-client && \
1719
apt-get clean && \
1820
rm -rf /var/lib/apt/lists/*
1921

@@ -35,6 +37,9 @@ COPY ./app/client/build editor/
3537
# Add RTS - Application Layer
3638
COPY ./app/client/packages/rts/dist rts/
3739

40+
# Create the git-storage directory with group writeable permissions so non-root users can write to it.
41+
RUN mkdir --mode 775 "/dev/shm/git-storage"
42+
3843
ENV PATH /opt/bin:/opt/java/bin:/opt/node/bin:$PATH
3944

4045
RUN <<END

app/client/packages/ast/src/index.ts

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -403,29 +403,45 @@ export interface IdentifierInfo {
403403
variables: string[];
404404
isError: boolean;
405405
}
406+
407+
// Extracted function to sanitize, wrap, parse code, and call ancestorWalk, now with caching
408+
const sanitizedWrappedAncestorWalkCache = new Map<string, NodeList>();
409+
410+
function getSanitizedWrappedAncestorWalk(
411+
code: string,
412+
evaluationVersion: number,
413+
): NodeList {
414+
const cacheKey = `${evaluationVersion}::${code}`;
415+
416+
if (sanitizedWrappedAncestorWalkCache.has(cacheKey)) {
417+
return sanitizedWrappedAncestorWalkCache.get(cacheKey)!;
418+
}
419+
420+
const sanitizedScript = sanitizeScript(code, evaluationVersion);
421+
// We sanitize and wrap the code because all code/script gets wrapped with a function during evaluation.
422+
// Some syntax won't be valid unless they're at the RHS of a statement.
423+
// Since we're assigning all code/script to RHS during evaluation, we do the same here.
424+
// So that during ast parse, those errors are neglected.
425+
// e.g. IIFE without braces:
426+
// function() { return 123; }() -> is invalid
427+
// let result = function() { return 123; }() -> is valid
428+
const wrappedCode = wrapCode(sanitizedScript);
429+
const ast = getAST(wrappedCode);
430+
const result = ancestorWalk(ast);
431+
432+
sanitizedWrappedAncestorWalkCache.set(cacheKey, result);
433+
434+
return result;
435+
}
436+
406437
export const extractIdentifierInfoFromCode = (
407438
code: string,
408439
evaluationVersion: number,
409440
invalidIdentifiers?: Record<string, unknown>,
410441
): IdentifierInfo => {
411-
let ast: Node = { end: 0, start: 0, type: "" };
412-
413442
try {
414-
const sanitizedScript = sanitizeScript(code, evaluationVersion);
415-
/* wrapCode - Wrapping code in a function, since all code/script get wrapped with a function during evaluation.
416-
Some syntax won't be valid unless they're at the RHS of a statement.
417-
Since we're assigning all code/script to RHS during evaluation, we do the same here.
418-
So that during ast parse, those errors are neglected.
419-
*/
420-
/* e.g. IIFE without braces
421-
function() { return 123; }() -> is invalid
422-
let result = function() { return 123; }() -> is valid
423-
*/
424-
const wrappedCode = wrapCode(sanitizedScript);
425-
426-
ast = getAST(wrappedCode);
427443
const { functionalParams, references, variableDeclarations }: NodeList =
428-
ancestorWalk(ast);
444+
getSanitizedWrappedAncestorWalk(code, evaluationVersion);
429445
const referencesArr = Array.from(references).filter((reference) => {
430446
// To remove references derived from declared variables and function params,
431447
// We extract the topLevelIdentifier Eg. Api1.name => Api1

app/client/src/ce/entities/FeatureFlag.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export const FEATURE_FLAG = {
6464
"release_jsobjects_onpageunloadactions_enabled",
6565
configure_block_event_tracking_for_anonymous_users:
6666
"configure_block_event_tracking_for_anonymous_users",
67-
release_paid_features_tagging: "release_paid_features_tagging",
6867
} as const;
6968

7069
export type FeatureFlag = keyof typeof FEATURE_FLAG;
@@ -117,7 +116,6 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = {
117116
license_ai_agent_instance_enabled: false,
118117
release_jsobjects_onpageunloadactions_enabled: false,
119118
configure_block_event_tracking_for_anonymous_users: false,
120-
release_paid_features_tagging: false,
121119
};
122120

123121
export const AB_TESTING_EVENT_KEYS = {

app/client/src/entities/DependencyMap/DependencyMapUtils.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,26 @@ export class DependencyMapUtils {
9696
) {
9797
const dependencies = dependencyMap.rawDependencies;
9898

99+
// We don't want to process the same node multiple times
100+
// STEP 1: Collect all unique nodes that need processing
101+
const nodesToProcess = new Set<string>();
102+
99103
for (const [node, deps] of dependencies.entries()) {
100104
if (affectedSet.has(node)) {
101-
DependencyMapUtils.makeParentsDependOnChild(dependencyMap, node);
105+
nodesToProcess.add(node); // Just add to set, don't call function yet
102106
}
103107

104-
deps.forEach((dep) => {
108+
for (const dep of deps) {
105109
if (affectedSet.has(dep)) {
106-
DependencyMapUtils.makeParentsDependOnChild(dependencyMap, dep);
110+
nodesToProcess.add(dep); // Just add to set, don't call function yet
107111
}
108-
});
112+
}
109113
}
110114

111-
return dependencyMap;
115+
// STEP 2: Process each unique node exactly once
116+
for (const nodeToProcess of nodesToProcess) {
117+
DependencyMapUtils.makeParentsDependOnChild(dependencyMap, nodeToProcess);
118+
}
112119
}
113120

114121
static makeParentsDependOnChild = (

app/client/src/entities/DependencyMap/index.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { difference } from "lodash";
2-
import { isChildPropertyPath } from "utils/DynamicBindingUtils";
1+
import { isChildPropertyPath, getDifferences } from "utils/DynamicBindingUtils";
32

43
export type TDependencies = Map<string, Set<string>>;
54
export default class DependencyMap {
@@ -107,9 +106,9 @@ export default class DependencyMap {
107106
const newNodeDependencies = validDependencies;
108107

109108
// dependencies removed from path
110-
const removedNodeDependencies = difference(
111-
Array.from(previousNodeDependencies),
112-
Array.from(newNodeDependencies),
109+
const removedNodeDependencies = getDifferences(
110+
previousNodeDependencies,
111+
newNodeDependencies,
113112
);
114113

115114
// Remove node from the inverseDependencies of removed deps
@@ -122,9 +121,9 @@ export default class DependencyMap {
122121
const newNodeInvalidDependencies = invalidDependencies;
123122

124123
// invalid dependencies removed from path
125-
const removedNodeInvalidDependencies = difference(
126-
Array.from(previousNodeInvalidDependencies),
127-
Array.from(newNodeInvalidDependencies),
124+
const removedNodeInvalidDependencies = getDifferences(
125+
previousNodeInvalidDependencies,
126+
newNodeInvalidDependencies,
128127
);
129128

130129
// Remove node from the inverseDependencies of removed invalidDeps

app/client/src/pages/AppIDE/layouts/components/Header/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import { AppsmithLink } from "pages/Editor/AppsmithLink";
6565
import DeployButton from "./DeployButton";
6666
import { GitApplicationContextProvider } from "git-artifact-helpers/application/components";
6767
import ChevronMenu from "./ChevronMenu";
68+
import { ShowUpgradeMenuItem } from "ee/utils/licenseHelpers";
6869

6970
const StyledDivider = styled(Divider)`
7071
height: 50%;
@@ -194,6 +195,7 @@ const Header = () => {
194195
)}
195196
</IDEHeader.Center>
196197
<IDEHeader.Right>
198+
<ShowUpgradeMenuItem />
197199
<HelpBar />
198200
<StyledDivider orientation={"vertical"} />
199201
<ToggleModeButton />

app/client/src/pages/Editor/DataSidePane/DataSidePane.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ export const DataSidePane = (props: DataSidePaneProps) => {
8383
);
8484

8585
const isFeatureEnabled = useFeatureFlag(FEATURE_FLAG.license_gac_enabled);
86-
const isPaidFeaturesTaggingEnabled = useFeatureFlag(
87-
FEATURE_FLAG.release_paid_features_tagging,
88-
);
8986

9087
const canCreateDatasource = getHasCreateDatasourcePermission(
9188
isFeatureEnabled,
@@ -113,8 +110,6 @@ export const DataSidePane = (props: DataSidePaneProps) => {
113110

114111
const shouldShowPremiumTag = useCallback(
115112
(datasource: Datasource) => {
116-
if (!isPaidFeaturesTaggingEnabled) return false;
117-
118113
const plugin = plugins.find((p) => p.id === datasource.pluginId);
119114

120115
if (!plugin) return false;
@@ -128,7 +123,7 @@ export const DataSidePane = (props: DataSidePaneProps) => {
128123

129124
return false;
130125
},
131-
[plugins, isIntegrationsEnabledForPaid, isPaidFeaturesTaggingEnabled],
126+
[plugins, isIntegrationsEnabledForPaid],
132127
);
133128

134129
return (

app/client/src/utils/DynamicBindingUtils.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,3 +640,13 @@ export function getEntityName(
640640

641641
if (isJSAction(entity)) return entityConfig.name;
642642
}
643+
644+
export function getDifferences<T>(a: Set<T>, b: Set<T>): T[] {
645+
const diff: T[] = [];
646+
647+
for (const val of a) {
648+
if (!b.has(val)) diff.push(val);
649+
}
650+
651+
return diff;
652+
}

app/client/src/workers/common/DataTreeEvaluator/index.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ import {
7777
isObject,
7878
isUndefined,
7979
set,
80-
union,
8180
unset,
8281
} from "lodash";
8382

@@ -1008,30 +1007,30 @@ export default class DataTreeEvaluator {
10081007
changes: Array<string>,
10091008
inverseMap: Record<string, string[]>,
10101009
): Array<string> {
1011-
let finalSortOrder: Array<string> = [];
10121010
let computeSortOrder = true;
10131011
// Initialize parents with the current sent of property paths that need to be evaluated
10141012
let parents = changes;
10151013
let subSortOrderArray: Array<string>;
1016-
let visitedNodes: string[] = [];
1014+
const visitedNodesSet = new Set<string>();
1015+
// Remove duplicates from this list. Since we explicitly walk down the tree and implicitly (by fetching parents) walk
1016+
// up the tree, there are bound to be many duplicates.
1017+
const uniqueKeysInSortOrder = new Set<string>();
10171018

10181019
while (computeSortOrder) {
10191020
// Get all the nodes that would be impacted by the evaluation of the nodes in parents array in sorted order
10201021
subSortOrderArray = this.getEvaluationSortOrder(parents, inverseMap);
1021-
visitedNodes = union(visitedNodes, parents);
1022-
// Add all the sorted nodes in the final list
1023-
finalSortOrder = union(finalSortOrder, subSortOrderArray);
1022+
1023+
// Add all parents and subSortOrderArray nodes to their respective sets
1024+
for (const node of parents) visitedNodesSet.add(node);
1025+
1026+
for (const node of subSortOrderArray) uniqueKeysInSortOrder.add(node);
10241027

10251028
parents = getImmediateParentsOfPropertyPaths(subSortOrderArray);
10261029
// If we find parents of the property paths in the sorted array, we should continue finding all the nodes dependent
10271030
// on the parents
1028-
computeSortOrder = difference(parents, visitedNodes).length > 0;
1031+
computeSortOrder = parents.some((parent) => !visitedNodesSet.has(parent));
10291032
}
10301033

1031-
// Remove duplicates from this list. Since we explicitly walk down the tree and implicitly (by fetching parents) walk
1032-
// up the tree, there are bound to be many duplicates.
1033-
const uniqueKeysInSortOrder = new Set(finalSortOrder);
1034-
10351034
// if a property path evaluation gets triggered by diff top order changes
10361035
// this could lead to incorrect sort order in spite of the bfs traversal
10371036
const sortOrderPropertyPaths: string[] = [];

app/server/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ node_modules
1212
**/.project
1313
**/.factorypath
1414
container-volumes
15-
*.env
15+
*.env*
1616
dependency-reduced-pom.xml
1717
appsmith-server/failedServerTests.txt

0 commit comments

Comments
 (0)