Skip to content
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

node_modules: switch from deep_equal to dequal #20659

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

jelly
Copy link
Member

@jelly jelly commented Jun 25, 2024

Fixes #20646

package.json Outdated Show resolved Hide resolved
@martinpitt
Copy link
Member

Nice, works! Except for this missing types thing:

pkg/lib/hooks.ts(22,24): error TS7016: Could not find a declaration file for module 'dequal/lite'. '/work/make-checkout-workdir/node_modules/dequal/lite/index.js' implicitly has an 'any' type.

@jelly
Copy link
Member Author

jelly commented Jun 26, 2024

Nice, works! Except for this missing types thing:

pkg/lib/hooks.ts(22,24): error TS7016: Could not find a declaration file for module 'dequal/lite'. '/work/make-checkout-workdir/node_modules/dequal/lite/index.js' implicitly has an 'any' type.

Apparently it is typed but in (dequal and not dequal/lite) , but it is not working obviously. This is not worthwhile to spend time on imo we should drop this user as no one uses useDeepEqualMemo

@jelly
Copy link
Member Author

jelly commented Jun 26, 2024

Nice, works! Except for this missing types thing:

pkg/lib/hooks.ts(22,24): error TS7016: Could not find a declaration file for module 'dequal/lite'. '/work/make-checkout-workdir/node_modules/dequal/lite/index.js' implicitly has an 'any' type.

Nothing I can do about it, what works is:

import { dequal } from 'dequal';

@martinpitt
Copy link
Member

Dropping useDeepEqualMemo seems fine to me, if that helps. Two other places use deep_equal directly. Also, this function is so simple, it'd also be fine to just copy it to pkg/lib/utils.tsx.

pkg/lib/hooks.ts Outdated Show resolved Hide resolved
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy bots, happy pitti! Thanks!

@martinpitt martinpitt marked this pull request as ready for review June 26, 2024 08:51
@jelly
Copy link
Member Author

jelly commented Jun 26, 2024

Note, cockpit-machines depends on deep-equal so needs to be fixed.

@jelly jelly merged commit d6c6ed6 into cockpit-project:main Jun 26, 2024
82 checks passed
@jelly jelly deleted the dequal-tryout branch June 26, 2024 12:56
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.

Consider switching to dequal
2 participants