-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Replace third party deep-equal library with native implementation #5509
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed a few places where deep-equal should be removed (such as the whitelist): https://github.com/prebid/Prebid.js/search?q=deep-equal&unscoped_q=deep-equal
other than that, looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than what Rich mentioned, LGTM
@snapwich @idettman Thanks for the review. @snapwich, Good catch, I forgot to replace the reference from It runs in node environment and throws an error if I try to require the utils.js file because the utils file uses import statements which are not recognized by node. I tried few solutions, like:
None of these approaches work. So, in the end, I had to add back the If you have any better solution to how I can import utils in a file running in node env, let me know, or we can merge this. |
Imports and exports support In Node.js 12 requires both:
I'm guessing you're missing the |
@idettman I tried the approach that you suggested, using the flag
We can copy the implementation of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think moving deep-equal to a devDependency is perfectly acceptable
Type of change
Description of change
deep-equal module is replaced by a native implementation for deeply checking object equality.
This function is mainly used by the
sizeMappingV2.js
module, which is tested and working fine after the replacement. This implementation is simple, but should mostly work for our use cases.Also,
prebid- core.js
is now almost40kb
lighter after removal of this module.