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

Migrate all lodash' per-method-packages usage to lodash. #4274

Merged
merged 7 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/@uppy/companion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
"helmet": "^4.6.0",
"ipaddr.js": "^2.0.1",
"jsonwebtoken": "8.5.1",
"lodash.merge": "^4.6.2",
"lodash.throttle": "^4.1.1",
"lodash": "^4.17.21",
"mime-types": "2.1.35",
"moment": "^2.29.2",
"moment-timezone": "^0.5.31",
Expand All @@ -75,7 +74,7 @@
"@types/eslint": "^8.2.0",
"@types/express-session": "1.17.3",
"@types/jsonwebtoken": "8.3.7",
"@types/lodash.merge": "4.6.6",
"@types/lodash": "4.14.191",
"@types/morgan": "1.7.37",
"@types/ms": "0.7.31",
"@types/node": "^18.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/companion/src/companion.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const express = require('express')
const Grant = require('grant').default.express()
const merge = require('lodash.merge')
const merge = require('lodash/merge')
const cookieParser = require('cookie-parser')
const interceptor = require('express-interceptor')
const { randomUUID } = require('node:crypto')
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/companion/src/server/Uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { join } = require('node:path')
const fs = require('node:fs')
const { promisify } = require('node:util')
const FormData = require('form-data')
const throttle = require('lodash.throttle')
const throttle = require('lodash/throttle')

// TODO move to `require('streams/promises').pipeline` when dropping support for Node.js 14.x.
const pipeline = promisify(pipelineCb)
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/companion/src/standalone/helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require('node:fs')
const merge = require('lodash.merge')
const merge = require('lodash/merge')
const stripIndent = require('common-tags/lib/stripIndent')
const crypto = require('node:crypto')

Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@transloadit/prettier-bytes": "0.0.9",
"@uppy/store-default": "workspace:^",
"@uppy/utils": "workspace:^",
"lodash.throttle": "^4.1.1",
"lodash": "^4.17.21",
"mime-match": "^1.0.2",
"namespace-emitter": "^2.0.1",
"nanoid": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/core/src/Uppy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import Translator from '@uppy/utils/lib/Translator'
import ee from 'namespace-emitter'
import { nanoid } from 'nanoid/non-secure'
import throttle from 'lodash.throttle'
import throttle from 'lodash/throttle'
import DefaultStore from '@uppy/store-default'
import getFileType from '@uppy/utils/lib/getFileType'
import getFileNameAndExtension from '@uppy/utils/lib/getFileNameAndExtension'
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@uppy/utils": "workspace:^",
"classnames": "^2.2.6",
"is-shallow-equal": "^1.0.1",
"lodash.debounce": "^4.0.8",
"lodash": "^4.17.21",
"memoize-one": "^6.0.0",
"nanoid": "^4.0.0",
"preact": "^10.5.13"
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/dashboard/src/utils/createSuperFocus.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import debounce from 'lodash.debounce'
import debounce from 'lodash/debounce'
import FOCUSABLE_ELEMENTS from '@uppy/utils/lib/FOCUSABLE_ELEMENTS'
import getActiveOverlayEl from './getActiveOverlayEl.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/golden-retriever/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@transloadit/prettier-bytes": "0.0.9",
"@uppy/utils": "workspace:^",
"lodash.throttle": "^4.1.1"
"lodash": "^4.17.21"
},
"peerDependencies": {
"@uppy/core": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/golden-retriever/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import throttle from 'lodash.throttle'
import throttle from 'lodash/throttle'
import BasePlugin from '@uppy/core/lib/BasePlugin.js'
import ServiceWorkerStore from './ServiceWorkerStore.js'
import IndexedDBStore from './IndexedDBStore.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/status-bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@transloadit/prettier-bytes": "0.0.9",
"@uppy/utils": "workspace:^",
"classnames": "^2.2.6",
"lodash.throttle": "^4.1.1",
"lodash": "^4.17.21",
"preact": "^10.5.13"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/status-bar/src/Components.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { h } from 'preact'
import classNames from 'classnames'
import throttle from 'lodash.throttle'
import throttle from 'lodash/throttle'
import prettierBytes from '@transloadit/prettier-bytes'
import prettyETA from '@uppy/utils/lib/prettyETA'

Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"./src/microtip.scss": "./src/microtip.scss"
},
"dependencies": {
"lodash.throttle": "^4.1.1"
"lodash": "^4.17.21"
},
"devDependencies": {
"@jest/globals": "^29.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/utils/src/emitSocketProgress.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import throttle from 'lodash.throttle'
import throttle from 'lodash/throttle'

function emitSocketProgress (uploader, progressData, file) {
const { progress, bytesUploaded, bytesTotal } = progressData
Expand Down
27 changes: 12 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8001,16 +8001,14 @@ __metadata:
languageName: node
linkType: hard

"@types/lodash.merge@npm:4.6.6":
version: 4.6.6
resolution: "@types/lodash.merge@npm:4.6.6"
dependencies:
"@types/lodash": "*"
checksum: 62ec56f14b3077f7174497856e9b277db811943cd11b1d67d2a8e51a1803bd49319e8aaf62e745c696af972354a575dbb8a85d3aecf4ae774caf062dc31ac46e
"@types/lodash@npm:4.14.191":
version: 4.14.191
resolution: "@types/lodash@npm:4.14.191"
checksum: ba0d5434e10690869f32d5ea49095250157cae502f10d57de0a723fd72229ce6c6a4979576f0f13e0aa9fbe3ce2457bfb9fa7d4ec3d6daba56730a51906d1491
languageName: node
linkType: hard

"@types/lodash@npm:*, @types/lodash@npm:^4.14.167":
"@types/lodash@npm:^4.14.167":
version: 4.14.184
resolution: "@types/lodash@npm:4.14.184"
checksum: 6d9a4d67f7f9d0ec3fd21174f3dd3d00629dc1227eb469450eace53adbc1f7e2330699c28d0fe093e5f0fef0f0e763098be1f779268857213224af082b62be21
Expand Down Expand Up @@ -9302,7 +9300,7 @@ __metadata:
"@types/eslint": ^8.2.0
"@types/express-session": 1.17.3
"@types/jsonwebtoken": 8.3.7
"@types/lodash.merge": 4.6.6
"@types/lodash": 4.14.191
"@types/morgan": 1.7.37
"@types/ms": 0.7.31
"@types/node": ^18.0.3
Expand Down Expand Up @@ -9334,8 +9332,7 @@ __metadata:
ipaddr.js: ^2.0.1
jest: ^29.0.0
jsonwebtoken: 8.5.1
lodash.merge: ^4.6.2
lodash.throttle: ^4.1.1
lodash: ^4.17.21
mime-types: 2.1.35
moment: ^2.29.2
moment-timezone: ^0.5.31
Expand Down Expand Up @@ -9380,7 +9377,7 @@ __metadata:
"@transloadit/prettier-bytes": 0.0.9
"@uppy/store-default": "workspace:^"
"@uppy/utils": "workspace:^"
lodash.throttle: ^4.1.1
lodash: ^4.17.21
mime-match: ^1.0.2
namespace-emitter: ^2.0.1
nanoid: ^4.0.0
Expand All @@ -9402,7 +9399,7 @@ __metadata:
"@uppy/utils": "workspace:^"
classnames: ^2.2.6
is-shallow-equal: ^1.0.1
lodash.debounce: ^4.0.8
lodash: ^4.17.21
memoize-one: ^6.0.0
nanoid: ^4.0.0
preact: ^10.5.13
Expand Down Expand Up @@ -9487,7 +9484,7 @@ __metadata:
dependencies:
"@transloadit/prettier-bytes": 0.0.9
"@uppy/utils": "workspace:^"
lodash.throttle: ^4.1.1
lodash: ^4.17.21
peerDependencies:
"@uppy/core": "workspace:^"
languageName: unknown
Expand Down Expand Up @@ -9680,7 +9677,7 @@ __metadata:
"@transloadit/prettier-bytes": 0.0.9
"@uppy/utils": "workspace:^"
classnames: ^2.2.6
lodash.throttle: ^4.1.1
lodash: ^4.17.21
preact: ^10.5.13
peerDependencies:
"@uppy/core": "workspace:^"
Expand Down Expand Up @@ -9800,7 +9797,7 @@ __metadata:
resolution: "@uppy/utils@workspace:packages/@uppy/utils"
dependencies:
"@jest/globals": ^29.0.0
lodash.throttle: ^4.1.1
lodash: ^4.17.21
languageName: unknown
linkType: soft

Expand Down