Skip to content

Replaces the lodash library with es-toolkit #2977

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "grpc-examples",
"version": "0.1.0",
"dependencies": {
"@grpc/proto-loader": "^0.6.0",
"async": "^1.5.2",
"google-protobuf": "^3.0.0",
"@grpc/grpc-js": "^1.10.2",
"@grpc/grpc-js-xds": "^1.10.0",
"@grpc/proto-loader": "^0.6.0",
"@grpc/reflection": "^1.0.0",
"lodash": "^4.6.1",
"async": "^1.5.2",
"es-toolkit": "^1.39.7",
"google-protobuf": "^3.0.0",
"minimist": "^1.2.0"
}
}
2 changes: 1 addition & 1 deletion examples/routeguide/dynamic_codegen/route_guide_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var async = require('async');
var fs = require('fs');
var parseArgs = require('minimist');
var path = require('path');
var _ = require('lodash');
var _ = require('es-toolkit/compat');
var grpc = require('@grpc/grpc-js');
var protoLoader = require('@grpc/proto-loader');
var packageDefinition = protoLoader.loadSync(
Expand Down
2 changes: 1 addition & 1 deletion examples/routeguide/dynamic_codegen/route_guide_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var PROTO_PATH = __dirname + '/../../protos/route_guide.proto';
var fs = require('fs');
var parseArgs = require('minimist');
var path = require('path');
var _ = require('lodash');
var _ = require('es-toolkit/compat');
var grpc = require('@grpc/grpc-js');
var protoLoader = require('@grpc/proto-loader');
var packageDefinition = protoLoader.loadSync(
Expand Down
2 changes: 1 addition & 1 deletion examples/routeguide/static_codegen/route_guide_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var async = require('async');
var fs = require('fs');
var parseArgs = require('minimist');
var path = require('path');
var _ = require('lodash');
var _ = require('es-toolkit/compat');
var grpc = require('@grpc/grpc-js');

var client = new services.RouteGuideClient('localhost:50051',
Expand Down
2 changes: 1 addition & 1 deletion examples/routeguide/static_codegen/route_guide_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var services = require('./route_guide_grpc_pb');
var fs = require('fs');
var parseArgs = require('minimist');
var path = require('path');
var _ = require('lodash');
var _ = require('es-toolkit/compat');
var grpc = require('@grpc/grpc-js');

var COORD_FACTOR = 1e7;
Expand Down
3 changes: 1 addition & 2 deletions packages/grpc-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"@grpc/proto-loader": "file:../proto-loader",
"@types/gulp": "^4.0.17",
"@types/gulp-mocha": "0.0.37",
"@types/lodash": "^4.14.202",
"@types/mocha": "^10.0.6",
"@types/ncp": "^2.0.8",
"@types/node": ">=20.11.20",
Expand All @@ -28,14 +27,14 @@
"@typescript-eslint/parser": "^7.1.0",
"@typescript-eslint/typescript-estree": "^7.1.0",
"clang-format": "^1.8.0",
"es-toolkit": "^1.39.7",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"execa": "^2.0.3",
"gulp": "^4.0.2",
"gulp-mocha": "^6.0.0",
"lodash": "^4.17.21",
"madge": "^5.0.1",
"mocha-jenkins-reporter": "^0.4.1",
"ncp": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/grpc-js/test/test-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import * as assert from 'assert';
import * as http2 from 'http2';
import { range } from 'lodash';
import { range } from 'es-toolkit/compat';
import { Metadata, MetadataObject, MetadataValue } from '../src/metadata';

class TestMetadata extends Metadata {
Expand Down
2 changes: 1 addition & 1 deletion packages/proto-loader/bin/proto-loader-gen-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import * as path from 'path';
import * as Protobuf from 'protobufjs';
import * as yargs from 'yargs';

import camelCase = require('lodash.camelcase');
import { camelCase } from 'es-toolkit/compat';
import { loadProtosWithOptions, addCommonProtos } from '../src/util';

const templateStr = "%s";
Expand Down
3 changes: 1 addition & 2 deletions packages/proto-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,12 @@
"proto-loader-gen-types": "./build/bin/proto-loader-gen-types.js"
},
"dependencies": {
"lodash.camelcase": "^4.3.0",
"es-toolkit": "^1.39.7",
"long": "^5.0.0",
"protobufjs": "^7.5.3",
"yargs": "^17.7.2"
},
"devDependencies": {
"@types/lodash.camelcase": "^4.3.4",
"@types/mkdirp": "^1.0.1",
"@types/mocha": "^5.2.7",
"@types/node": "^10.17.26",
Expand Down
2 changes: 1 addition & 1 deletion packages/proto-loader/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*/

import camelCase = require('lodash.camelcase');
import { camelCase } from 'es-toolkit/compat';
import * as Protobuf from 'protobufjs';
import * as descriptor from 'protobufjs/ext/descriptor';

Expand Down
2 changes: 1 addition & 1 deletion test/any_grpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// a single object, the tests should be re-written in a way that makes it clear
// that two separate implementations are being tested against one another.

const _ = require('lodash');
const _ = require('es-toolkit/compat');

function getImplementation(globalField) {
const impl = global[globalField] ?? 'js';
Expand Down
2 changes: 1 addition & 1 deletion test/api/client_interceptors_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const options = {
defaults: true,
oneofs: true
};
var _ = require('lodash');
var _ = require('es-toolkit/compat');
var assert = require('assert');
const anyGrpc = require('../any_grpc');
const clientGrpc = anyGrpc.client
Expand Down
2 changes: 1 addition & 1 deletion test/api/connectivity_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const options = {
const path = require('path');
const fs = require('fs');
const assert = require('assert');
const _ = require('lodash');
const _ = require('es-toolkit/compat');
const anyGrpc = require('../any_grpc');
const clientGrpc = anyGrpc.client;
const serverGrpc = anyGrpc.server;
Expand Down
2 changes: 1 addition & 1 deletion test/api/error_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const options = {
oneofs: true
};
const assert = require('assert');
const _ = require('lodash');
const _ = require('es-toolkit/compat');
const anyGrpc = require('../any_grpc');
const clientGrpc = anyGrpc.client;
const serverGrpc = anyGrpc.server;
Expand Down
2 changes: 1 addition & 1 deletion test/interop/async_delay_queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

'use strict';

var _ = require('lodash');
var _ = require('es-toolkit/compat');

/**
* This class represents a queue of callbacks that must happen sequentially,
Expand Down
2 changes: 1 addition & 1 deletion test/interop/interop_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
var assert = require('assert');
var fs = require('fs');
var path = require('path');
var _ = require('lodash');
var _ = require('es-toolkit/compat');
var AsyncDelayQueue = require('./async_delay_queue');
var grpc = require('../any_grpc').server;
// TODO(murgatroid99): do this import more cleanly
Expand Down
2 changes: 1 addition & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
}
],
"dependencies": {
"es-toolkit": "^1.39.7",
"express": "^4.16.3",
"google-auth-library": "^6.1.0",
"lodash": "^4.17.4",
"poisson-process": "^1.0.0"
},
"optionalDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion test/performance/benchmark_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var util = require('util');
var EventEmitter = require('events');

var async = require('async');
var _ = require('lodash');
var _ = require('es-toolkit/compat');
var PoissonProcess = require('poisson-process');
var Histogram = require('./histogram');

Expand Down
2 changes: 1 addition & 1 deletion test/performance/benchmark_client_express.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var http = require('http');
var https = require('https');

var async = require('async');
var _ = require('lodash');
var _ = require('es-toolkit/compat');
var PoissonProcess = require('poisson-process');
var Histogram = require('./histogram');

Expand Down
2 changes: 1 addition & 1 deletion test/performance/generic_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*/

var _ = require('lodash');
var _ = require('es-toolkit/compat');

module.exports = {
'unaryCall' : {
Expand Down
2 changes: 1 addition & 1 deletion test/stress/metrics_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

'use strict';

var _ = require('lodash');
var _ = require('es-toolkit/compat');

// TODO(murgatroid99): use multiple grpc implementations
var grpc = require('grpc');
Expand Down
2 changes: 1 addition & 1 deletion test/stress/stress_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

'use strict';

var _ = require('lodash');
var _ = require('es-toolkit/compat');

// TODO(murgatroid99): use multiple grpc implementations
var grpc = require('grpc');
Expand Down