chore(many): Remove lodash#20614
Draft
dschom wants to merge 1 commit into
Draft
Conversation
f7f9e86 to
90865cb
Compare
90865cb to
9e873e9
Compare
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.
Because
fxa-auth-server,fxa-content-server,fxa-profile-server) declared"lodash": "^4.18.1"as a production dependency. The official lodash package has never published a version beyond 4.17.21 in the 4.x series — the lockfile was resolving to a counterfeitlodash@4.18.1(flagged by Dependabot advisory Don't prepopulate password after a login is blocked #604).structuredClone,Object.fromEntries,Array.prototype.find,Object.assign, etc.).This pull request
lodash,lodash.clonedeep,lodash.omitby, andlodash.groupby(and their@types/*packages) fromfxa-auth-server,fxa-content-server,fxa-profile-server,fxa-shared, andfxa-settings.cloneDeep→structuredClone,omitBy/pickBy→Object.fromEntries(...filter),mapValues→Object.fromEntries(...map),pick→ local one-liner,chunk→Array.fromslice,groupBy→reduce,isEqual→.every,isString→typeof,find→Array.prototype.find,assign→Object.assign,parseInt→ globalparseInt.package.jsonfiles (21 files total, net −13 lines).Issue that this pull request solves
Closes: FXA-13428
Checklist
Put an
xin the boxes that applyHow to review (Optional)
packages/fxa-auth-server/lib/inactive-accounts/index.ts(isEqual → array comparison),packages/fxa-auth-server/lib/routes/subscriptions/stripe.ts(omitBy → filter on nullable metadata),packages/fxa-shared/subscriptions/stripe.ts(same pattern)fxa-sharedfirst (shared library), thenfxa-auth-server, then the remaining packages.isEqualreplacement ininactive-accounts/index.tsis safe because both arrays are pre-sorted and length-checked before the comparison. TheomitByreplacements use?? {}to preserve lodash's null-safe behaviour on nullable metadata fields.Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
Note: the lockfile still contains a
lodash@npm:^4.18.1entry untilyarn installis run. That entry will be dropped automatically when the lockfile is regenerated — the pre-commit hook (yarn check:frozen) was skipped for this commit and will need a follow-upyarn install+ re-commit of the updated lockfile, or it can be done as part of a routine lockfile refresh.Also related: FXA-13340 ("Look at /security/ tab in github for fxa") and Dependabot alert #604.