Skip to content

Replace lodash.merge with a small local helper#2468

Open
soulgalore wants to merge 1 commit into
mainfrom
browsertime-drop-lodash-merge
Open

Replace lodash.merge with a small local helper#2468
soulgalore wants to merge 1 commit into
mainfrom
browsertime-drop-lodash-merge

Conversation

@soulgalore
Copy link
Copy Markdown
Member

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

  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
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.

1 participant