Skip to content

Commit c1790e0

Browse files
Merge pull request #224 from objectstack-ai/copilot/fix-action-step-error-again
2 parents b1cbb63 + 40f3f2e commit c1790e0

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

packages/core/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export * from './types';
99
export * from './registry/Registry';
1010
export * from './validation/schema-validator';
1111
export * from './builder/schema-builder';
12-
export * from './adapters';
1312
export * from './utils/filter-converter';
13+
export * from './evaluator';
14+
export * from './actions';
1415
// export * from './data-scope'; // TODO
15-
// export * from './evaluator'; // TODO
1616
// export * from './validators'; // TODO

packages/layout/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"dependencies": {
2020
"@object-ui/components": "workspace:*",
2121
"@object-ui/core": "workspace:*",
22+
"@object-ui/react": "workspace:*",
2223
"@object-ui/types": "workspace:*",
2324
"clsx": "^2.1.0",
2425
"lucide-react": "^0.563.0",

packages/react/src/hooks/useExpression.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ export function useExpression(
2222
expression: string | boolean | number | null | undefined,
2323
context: Record<string, any> = {}
2424
): any {
25-
const evaluator = useMemo(
26-
() => new ExpressionEvaluator(context),
27-
[JSON.stringify(context)]
28-
);
29-
25+
// We evaluate directly without caching the evaluator to avoid issues with context changes
3026
return useMemo(
31-
() => evaluator.evaluate(expression),
32-
[evaluator, expression]
27+
() => {
28+
const evaluator = new ExpressionEvaluator(context);
29+
return evaluator.evaluate(expression);
30+
},
31+
[expression, context]
3332
);
3433
}
3534

@@ -46,13 +45,12 @@ export function useCondition(
4645
condition: string | boolean | undefined,
4746
context: Record<string, any> = {}
4847
): boolean {
49-
const evaluator = useMemo(
50-
() => new ExpressionEvaluator(context),
51-
[JSON.stringify(context)]
52-
);
53-
48+
// We evaluate directly without caching the evaluator to avoid issues with context changes
5449
return useMemo(
55-
() => evaluator.evaluateCondition(condition),
56-
[evaluator, condition]
50+
() => {
51+
const evaluator = new ExpressionEvaluator(context);
52+
return evaluator.evaluateCondition(condition);
53+
},
54+
[condition, context]
5755
);
5856
}

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)