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

Avoid loading full lodash #10308

Merged
merged 6 commits into from
Jun 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ module.exports = {
],
'react/jsx-uses-vars': 'error',
'react/jsx-uses-react': 'error',
'no-restricted-imports': ['error', { "paths": ["lodash"] }],
Copy link
Contributor

@DonJayamanne DonJayamanne Jun 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add rxjs as well, as thats big as well.
Never mind, that can be a separate PR

'import/no-restricted-paths': [
'error',
{
Expand Down
2 changes: 1 addition & 1 deletion src/kernels/jupyter/preferredRemoteKernelIdProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

import { inject, injectable, named } from 'inversify';
import { cloneDeep } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import { Memento, Uri } from 'vscode';
import { traceInfo, traceVerbose } from '../../platform/logging';
import { getDisplayPath } from '../../platform/common/platform/fs-paths';
Expand Down
2 changes: 1 addition & 1 deletion src/kernels/jupyter/serverSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'use strict';

import { inject, injectable } from 'inversify';
import { isNil } from 'lodash';
import isNil from 'lodash/isNil';
import { EventEmitter, QuickPickItem, ThemeIcon, Uri } from 'vscode';
import { IApplicationShell, IClipboard } from '../../platform/common/application/types';
import { traceDecoratorError, traceError, traceWarning } from '../../platform/logging';
Expand Down
2 changes: 1 addition & 1 deletion src/notebooks/controllers/remoteSwitcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

import { inject, injectable } from 'inversify';
import { noop } from 'lodash';
import noop from 'lodash/noop';
import { StatusBarAlignment, StatusBarItem } from 'vscode';
import { IExtensionSingleActivationService } from '../../platform/activation/types';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/notebooks/execution/notebookUpdater.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import { noop } from 'lodash';
import noop from 'lodash/noop';
import { isPromise } from 'rxjs/internal-compatibility';
import { NotebookDocument, NotebookEditor, workspace, WorkspaceEdit, window } from 'vscode';
import { createDeferred } from '../../platform/common/utils/async';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from 'chai';
import { cloneDeep } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import * as sinon from 'sinon';
import * as path from '../../../platform/vscode-path/path';
import * as vscode from 'vscode';
Expand Down
2 changes: 1 addition & 1 deletion src/test/datascience/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import * as vscode from 'vscode';
import { getFilePath } from '../../platform/common/platform/fs-paths';
import { traceInfo } from '../../platform/logging';
import { noop } from 'lodash';
import noop from 'lodash/noop';
import { IPythonApiProvider } from '../../platform/api/types';
import { IJupyterSettings, Resource } from '../../platform/common/types';
import { InteractiveWindow } from '../../interactive-window/interactiveWindow';
Expand Down
2 changes: 1 addition & 1 deletion src/test/datascience/mockCommandManager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import { noop } from 'lodash';
import noop from 'lodash/noop';
import { Disposable, TextEditor, TextEditorEdit } from 'vscode';

import { ICommandNameArgumentTypeMapping } from '../../platform/common/application/commands';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { inject, injectable } from 'inversify';

import { captureTelemetry } from '../../../telemetry';
import { IDataViewer, IDataViewerDataProvider, IDataViewerFactory } from './types';
import { debounce } from 'lodash';
import debounce from 'lodash/debounce';
import { ICommandManager } from '../../../platform/common/application/types';
import { ContextKey } from '../../../platform/common/contextKey';
import { IAsyncDisposable, IAsyncDisposableRegistry, IDisposableRegistry } from '../../../platform/common/types';
Expand Down
2 changes: 1 addition & 1 deletion src/webviews/webview-side/data-explorer/mainPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { generateTestData } from './testData';
import '../react-common/codicon/codicon.css';
import '../react-common/seti/seti.less';
import { SliceControl } from './sliceControl';
import { debounce } from 'lodash';
import debounce from 'lodash/debounce';
import * as uuid from 'uuid/v4';

import { initializeIcons } from '@fluentui/react';
Expand Down