Skip to content

Fixed an issue where named expressions added on engine initialization were not updated on changes #1521

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

Merged
merged 7 commits into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Fixed `Edge does not exist` error when a named expression is used twice in the same formula. [#1102](https://github.com/handsontable/hyperformula/issues/1102)
- Fixed typos in the built-in functions guide. [#1517](https://github.com/handsontable/hyperformula/issues/1517)
- Fixed an issue where named expressions added on engine initialization were not updated on changes. [#1501](https://github.com/handsontable/hyperformula/issues/1501)

## [3.0.0] - 2025-01-14

Expand Down
9 changes: 5 additions & 4 deletions src/BuildEngineFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ export class BuildEngineFactory {
lazilyTransformingAstService.undoRedo = undoRedo
const clipboardOperations = new ClipboardOperations(config, dependencyGraph, operations)
const crudOperations = new CrudOperations(config, operations, undoRedo, clipboardOperations, dependencyGraph, columnSearch, parser, cellContentParser, lazilyTransformingAstService, namedExpressions)
inputNamedExpressions.forEach((entry: SerializedNamedExpression) => {
crudOperations.ensureItIsPossibleToAddNamedExpression(entry.name, entry.expression, entry.scope)
crudOperations.operations.addNamedExpression(entry.name, entry.expression, entry.scope, entry.options)
})

const exporter = new Exporter(config, namedExpressions, sheetMapping.fetchDisplayName, lazilyTransformingAstService)
const serialization = new Serialization(dependencyGraph, unparser, exporter)
Expand All @@ -120,6 +116,11 @@ export class BuildEngineFactory {
graphBuilder.buildGraph(sheets, stats)
})

inputNamedExpressions.forEach((entry: SerializedNamedExpression) => {
crudOperations.ensureItIsPossibleToAddNamedExpression(entry.name, entry.expression, entry.scope)
crudOperations.operations.addNamedExpression(entry.name, entry.expression, entry.scope, entry.options)
})

const evaluator = new Evaluator(config, stats, interpreter, lazilyTransformingAstService, dependencyGraph, columnSearch)
evaluator.run()

Expand Down
Loading
Loading