Skip to content

Replace custom deepEqual with dequal/lite#64

Draft
Pearce-Ropion wants to merge 3 commits into
mainfrom
claude/nifty-archimedes-Jf8pc
Draft

Replace custom deepEqual with dequal/lite#64
Pearce-Ropion wants to merge 3 commits into
mainfrom
claude/nifty-archimedes-Jf8pc

Conversation

@Pearce-Ropion
Copy link
Copy Markdown
Collaborator

Summary

  • Replace the hand-rolled deepEqual utility with dequal/lite. The library is tiny (~300B) and correctly handles cases the custom implementation didn't (e.g. Date, RegExp, NaN, array length mismatches).
  • Configure tsdown so dequal is external in the ESM and CJS outputs (consumers dedupe via their bundler) but bundled into the UMD build so the script-tag distribution stays self-contained.
  • Drop the now-obsolete deepEqual.ts and its test file.

Implementation notes

  • dequal is added to dependencies of @sigmacomputing/plugin, which makes tsdown externalize it by default in every format.
  • packages/plugin-sdk/tsdown.config.ts overrides this for the UMD format via format.umd.deps.alwaysBundle, forcing dequal and dequal/lite to be inlined into the UMD bundle.

Verification

  • yarn types passes.
  • yarn build produces:
    • dist/esm/index.jsimport { dequal } from "dequal/lite";
    • dist/cjs/index.cjsrequire("dequal/lite")
    • dist/umd/sigmacomputing-plugin.umd.js → dequal inlined (no require('dequal'))

Test plan

  • yarn install
  • yarn build — inspect dist/esm/index.js, dist/cjs/index.cjs, and dist/umd/sigmacomputing-plugin.umd.js to confirm externalization vs. inlining.
  • yarn test (browser tests via Playwright) — confirm useEditorPanelConfig still avoids re-configuring on equal inputs.
  • yarn types

Generated by Claude Code

claude added 3 commits May 22, 2026 00:54
Drop the hand-rolled deep equality utility in favor of dequal/lite,
which is well-tested and handles cases the custom one didn't (Date,
RegExp, NaN, Array.length mismatches, etc).

Externalize dequal in ESM/CJS so consumers dedupe the dependency, but
bundle it into the UMD output so the script-tag distribution stays
self-contained.
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.

2 participants