Skip to content

fix(util): implement diff helper#3462

Merged
proggeramlug merged 4 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-util-diff
May 31, 2026
Merged

fix(util): implement diff helper#3462
proggeramlug merged 4 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-util-diff

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Closes #3433

Summary

  • Implement util.diff(actual, expected) for string inputs, arrays of strings, and mixed string/string-array inputs.
  • Return Node-shaped edit tuples using LCS ordering, including the identical-string [] behavior and common tuple output for identical string arrays.
  • Add Node-compatible ERR_INVALID_ARG_TYPE validation for unsupported inputs and non-string array elements.
  • Wire the helper through util/sys manifest entries, native namespace enumeration, native dispatch, codegen declarations, and parity gap docs.

Tests

  • PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module util --filter diff
  • PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module util (72/73 passed; existing node-suite/util/get-system-error mismatch remains)
  • RUSTC_WRAPPER= cargo check -p perry-runtime -p perry-codegen -p perry-api-manifest -p perry-hir -p perry
  • cargo fmt --all -- --check
  • git diff --check
  • jq empty test-parity/known_failures.json
  • ./scripts/check_file_size.sh

@andrewtdiz
Copy link
Copy Markdown
Contributor Author

Fixed the API docs drift on this branch.

  • Regenerated docs/src/api/reference.md and docs/api/perry.d.ts from the branch-local release binary.
  • The refreshed manifest now includes util.diff / sys.diff alongside the current mainline styleText entries.
  • Local checks passed: cargo fmt --all -- --check, git diff --check, ./scripts/check_file_size.sh, CARGO_TARGET_DIR=/root/perry/target cargo test -p perry-api-manifest sys_alias_mirrors_util_manifest, RUST_TEST_THREADS=1 CARGO_TARGET_DIR=/root/perry/target cargo test -p perry-runtime util_diff, and CARGO_TARGET_DIR=/root/perry/target cargo test -p perry-hir stable_hash::tests::expr_variant_stable_hash_tags_are_unique.

@andrewtdiz andrewtdiz force-pushed the codex/node-compat-util-diff branch from eed1026 to 289c784 Compare May 30, 2026 21:45
@andrewtdiz andrewtdiz force-pushed the codex/node-compat-util-diff branch from 289c784 to 0c1d09f Compare May 30, 2026 21:47
Ralph Küpper added 2 commits May 31, 2026 09:09
@proggeramlug proggeramlug merged commit 3617c33 into PerryTS:main May 31, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

node:util: implement diff edit tuple helper

2 participants