Fix #5211: make calculateNow synchronous (#5304)

* Fix #5211: make calculateNow synchronous

* Bound and cache calculation execution

* fix(engine): invalidate field calculation cache

* perf(js): build calculation scripts lazily

* Refresh calculation cache after page insertion

* Load calculations for document script helpers

* Assert imported calculation result

* Initialize formatted field-change state

* Update formatted calculation test expectations

* Include the referenced field in calculation test

---------

Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
This commit is contained in:
Harrison BoothandFredApps authored and GitHub committed 2026-11-10 22:48:50 +01:00
1 parent 1be1cfa6ed
commit c73a53705b
16 files changed
+651 -43

No files matched your search

+2 -2
View File
@@ -5375,8 +5375,8 @@ milestone = "M6"
status = "shipped"
commands = ["tools.js_console"]
tools = ["js_run"]
evidence = ["crates/ui-egui/tests/it/javascript.rs::console_runs_scripts_against_the_document", "crates/automation/tests/it/automation.rs::javascript_through_tools"]
notes = "\u2318J: run JavaScript against the document, with console output, results and errors."
evidence = ["crates/ui-egui/tests/it/javascript.rs::console_runs_scripts_against_the_document", "crates/automation/tests/it/automation.rs::javascript_through_tools", "crates/engine/src/tests.rs::calculate_now_updates_live_fields_in_one_undo_step"]
notes = "\u2318J: run JavaScript against the document, with console output, results and errors. calculateNow() runs calculated fields synchronously in /CO order against writes already made by the script."
[[feature]]
id = "form.js-debugger"