Replace custom deepEqual with dequal/lite#64
Draft
Pearce-Ropion wants to merge 3 commits into
Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deepEqualutility withdequal/lite. The library is tiny (~300B) and correctly handles cases the custom implementation didn't (e.g.Date,RegExp,NaN, array length mismatches).dequalis 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.deepEqual.tsand its test file.Implementation notes
dequalis added todependenciesof@sigmacomputing/plugin, which makes tsdown externalize it by default in every format.packages/plugin-sdk/tsdown.config.tsoverrides this for the UMD format viaformat.umd.deps.alwaysBundle, forcingdequalanddequal/liteto be inlined into the UMD bundle.Verification
yarn typespasses.yarn buildproduces:dist/esm/index.js→import { dequal } from "dequal/lite";dist/cjs/index.cjs→require("dequal/lite")dist/umd/sigmacomputing-plugin.umd.js→ dequal inlined (norequire('dequal'))Test plan
yarn installyarn build— inspectdist/esm/index.js,dist/cjs/index.cjs, anddist/umd/sigmacomputing-plugin.umd.jsto confirm externalization vs. inlining.yarn test(browser tests via Playwright) — confirmuseEditorPanelConfigstill avoids re-configuring on equal inputs.yarn typesGenerated by Claude Code