Replace lodash.merge with a small local helper#2468
Open
soulgalore wants to merge 1 commit into
Open
Conversation
Finishes the lodash unbundling here the same way sitespeed.io did (sitespeedio/sitespeed.io#4742): a 40-line merge() in lib/support/util.js alongside the existing getProperty/setProperty helpers, no new file. The helper matches lodash's actual semantics — arrays merged by index, undefined source values skipped unless the key is missing on the target, Date/RegExp/class instances passed by reference, prototype-pollution keys rejected — which were the behaviors any of the call sites here relied on (engine/seleniumRunner defaults, HAR log merge, screenshot config, measure result/extras, WebPageReplay options, bin/browsertime.js script discovery). Dropping the direct dep means browsertime no longer pulls lodash.merge itself; eslint still brings it in transitively, which is fine. Co-authored-by: Claude noreply@anthropic.com Change-Id: I00e4737b05c626d56a5c90ae80fb544482141dad
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.
Finishes the lodash unbundling here the same way sitespeed.io did
(sitespeedio/sitespeed.io#4742): a 40-line merge() in
lib/support/util.js alongside the existing getProperty/setProperty
helpers, no new file. The helper matches lodash's actual semantics —
arrays merged by index, undefined source values skipped unless the
key is missing on the target, Date/RegExp/class instances passed by
reference, prototype-pollution keys rejected — which were the
behaviors any of the call sites here relied on (engine/seleniumRunner
defaults, HAR log merge, screenshot config, measure result/extras,
WebPageReplay options, bin/browsertime.js script discovery).
Dropping the direct dep means browsertime no longer pulls lodash.merge
itself; eslint still brings it in transitively, which is fine.
Co-authored-by: Claude noreply@anthropic.com
Change-Id: I00e4737b05c626d56a5c90ae80fb544482141dad