mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Refactor some imports to reduce baseline memory usage (#15916)
This commit is contained in:
committed by
GitHub
parent
8abd556597
commit
7c806ff532
@@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event';
|
||||
import Assignment from './Assignment.vue';
|
||||
import { defaultSettings } from '@/__tests__/defaults';
|
||||
import { STORES } from '@n8n/stores';
|
||||
import { merge } from 'lodash-es';
|
||||
import merge from 'lodash/merge';
|
||||
import { cleanupAppModals, createAppModals } from '@/__tests__/utils';
|
||||
|
||||
const DEFAULT_SETUP = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { isObject } from 'lodash-es';
|
||||
import isObject from 'lodash/isObject';
|
||||
import type { AssignmentValue, IDataObject } from 'n8n-workflow';
|
||||
import { resolveParameter } from '@/composables/useWorkflowHelpers';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { merge } from 'lodash-es';
|
||||
import merge from 'lodash/merge';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
|
||||
import { SETTINGS_STORE_DEFAULT_STATE } from '@/__tests__/utils';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { computed, nextTick, useTemplateRef, watch } from 'vue';
|
||||
import { N8nButton, N8nIcon, N8nIconButton, N8nText } from '@n8n/design-system';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
import { upperFirst } from 'lodash-es';
|
||||
import upperFirst from 'lodash/upperFirst';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import LogsViewConsumedTokenCountText from '@/components/CanvasChat/future/components/LogsViewConsumedTokenCountText.vue';
|
||||
import { I18nT } from 'vue-i18n';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useI18n } from '@n8n/i18n';
|
||||
import { type LlmTokenUsageData } from '@/Interface';
|
||||
import { N8nText } from '@n8n/design-system';
|
||||
import { useTimestamp } from '@vueuse/core';
|
||||
import { upperFirst } from 'lodash-es';
|
||||
import upperFirst from 'lodash/upperFirst';
|
||||
import { type ExecutionStatus } from 'n8n-workflow';
|
||||
import { computed } from 'vue';
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { CHAT_TRIGGER_NODE_TYPE, MANUAL_CHAT_TRIGGER_NODE_TYPE } from '@/constants';
|
||||
import { type IExecutionResponse, type INodeUi, type IWorkflowDb } from '@/Interface';
|
||||
import { type ChatMessage } from '@n8n/chat/types';
|
||||
import { get, isEmpty } from 'lodash-es';
|
||||
import get from 'lodash/get';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import { NodeConnectionTypes, type IDataObject, type IRunExecutionData } from 'n8n-workflow';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { snakeCase } from 'lodash-es';
|
||||
import snakeCase from 'lodash/snakeCase';
|
||||
import { useSessionStorage } from '@vueuse/core';
|
||||
|
||||
import { N8nButton, N8nInput, N8nTooltip } from '@n8n/design-system/components';
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
} from 'n8n-workflow';
|
||||
import { deepCopy } from 'n8n-workflow';
|
||||
|
||||
import { get } from 'lodash-es';
|
||||
import get from 'lodash/get';
|
||||
|
||||
import { useNDVStore } from '@/stores/ndv.store';
|
||||
import { useNodeHelpers } from '@/composables/useNodeHelpers';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { merge } from 'lodash-es';
|
||||
import merge from 'lodash/merge';
|
||||
|
||||
import { SETTINGS_STORE_DEFAULT_STATE } from '@/__tests__/utils';
|
||||
import { STORES } from '@n8n/stores';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { N8nIcon, N8nTooltip } from '@n8n/design-system';
|
||||
import type { TableInstance } from 'element-plus';
|
||||
import { ElTable, ElTableColumn } from 'element-plus';
|
||||
import { isEqual } from 'lodash-es';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import { nextTick, ref, watch } from 'vue';
|
||||
import type { RouteLocationRaw } from 'vue-router';
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import { createTestingPinia } from '@pinia/testing';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { within, waitFor } from '@testing-library/vue';
|
||||
import { getFilterOperator } from './utils';
|
||||
import { get } from 'lodash-es';
|
||||
import get from 'lodash/get';
|
||||
|
||||
const DEFAULT_SETUP = {
|
||||
pinia: createTestingPinia({
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { isEmpty, isEqual } from 'lodash-es';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
|
||||
import {
|
||||
type FilterConditionValue,
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { IUpdateInformation } from '@/Interface';
|
||||
import type { INodeParameters, INodeProperties, NodeParameterValueType } from 'n8n-workflow';
|
||||
import { deepCopy, isINodePropertyCollectionList } from 'n8n-workflow';
|
||||
|
||||
import { get } from 'lodash-es';
|
||||
import get from 'lodash/get';
|
||||
|
||||
import { computed, ref, watch, onBeforeMount } from 'vue';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
|
||||
@@ -11,7 +11,7 @@ import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { useNDVStore } from '@/stores/ndv.store';
|
||||
import { waitingNodeTooltip } from '@/utils/executionUtils';
|
||||
import { uniqBy } from 'lodash-es';
|
||||
import uniqBy from 'lodash/uniqBy';
|
||||
import { N8nIcon, N8nRadioButtons, N8nText, N8nTooltip } from '@n8n/design-system';
|
||||
import {
|
||||
type INodeInputConfiguration,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { describe, it, expect, vi } from 'vitest';
|
||||
import { waitFor } from '@testing-library/vue';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import { merge } from 'lodash-es';
|
||||
import merge from 'lodash/merge';
|
||||
import { SOURCE_CONTROL_PULL_MODAL_KEY, SOURCE_CONTROL_PUSH_MODAL_KEY } from '@/constants';
|
||||
import { STORES } from '@n8n/stores';
|
||||
import { SETTINGS_STORE_DEFAULT_STATE } from '@/__tests__/utils';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, computed } from 'vue';
|
||||
import { get } from 'lodash-es';
|
||||
import get from 'lodash/get';
|
||||
import type { INodeParameters, INodeProperties } from 'n8n-workflow';
|
||||
import { deepCopy } from 'n8n-workflow';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { SubcategoryItemProps } from '@/Interface';
|
||||
import { camelCase } from 'lodash-es';
|
||||
import camelCase from 'lodash/camelCase';
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import type { BaseTextKey } from '@n8n/i18n';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { camelCase } from 'lodash-es';
|
||||
import camelCase from 'lodash/camelCase';
|
||||
import { computed } from 'vue';
|
||||
import type {
|
||||
ActionTypeDescription,
|
||||
|
||||
@@ -6,7 +6,8 @@ import {
|
||||
CUSTOM_API_CALL_KEY,
|
||||
HTTP_REQUEST_NODE_TYPE,
|
||||
} from '@/constants';
|
||||
import { memoize, startCase } from 'lodash-es';
|
||||
import memoize from 'lodash/memoize';
|
||||
import startCase from 'lodash/startCase';
|
||||
import type {
|
||||
ICredentialType,
|
||||
INodeProperties,
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
import { defineStore } from 'pinia';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { computed, nextTick, ref } from 'vue';
|
||||
import difference from 'lodash-es/difference';
|
||||
import difference from 'lodash/difference';
|
||||
|
||||
import { useNodeCreatorStore } from '@/stores/nodeCreator.store';
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import { v4 as uuidv4 } from 'uuid';
|
||||
import { sublimeSearch } from '@n8n/utils/search/sublimeSearch';
|
||||
import type { NodeViewItemSection } from './viewsData';
|
||||
import { i18n } from '@n8n/i18n';
|
||||
import { sortBy } from 'lodash-es';
|
||||
import sortBy from 'lodash/sortBy';
|
||||
import * as changeCase from 'change-case';
|
||||
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
|
||||
@@ -65,7 +65,7 @@ import type { INodeTypeDescription, NodeConnectionType, Themed } from 'n8n-workf
|
||||
import { EVALUATION_TRIGGER_NODE_TYPE, NodeConnectionTypes } from 'n8n-workflow';
|
||||
import { useTemplatesStore } from '@/stores/templates.store';
|
||||
import type { BaseTextKey } from '@n8n/i18n';
|
||||
import { camelCase } from 'lodash-es';
|
||||
import camelCase from 'lodash/camelCase';
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
import { useEvaluationStore } from '@/stores/evaluation.store.ee';
|
||||
export interface NodeViewItemSection {
|
||||
|
||||
@@ -32,7 +32,9 @@ import NodeCredentials from '@/components/NodeCredentials.vue';
|
||||
import NodeSettingsTabs from '@/components/NodeSettingsTabs.vue';
|
||||
import NodeWebhooks from '@/components/NodeWebhooks.vue';
|
||||
import NDVSubConnections from '@/components/NDVSubConnections.vue';
|
||||
import { get, set, unset } from 'lodash-es';
|
||||
import get from 'lodash/get';
|
||||
import set from 'lodash/set';
|
||||
import unset from 'lodash/unset';
|
||||
|
||||
import NodeExecuteButton from './NodeExecuteButton.vue';
|
||||
import { isCommunityPackageName } from '@/utils/nodeTypesUtils';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, onBeforeUnmount, onMounted, onUpdated, ref, watch } from 'vue';
|
||||
|
||||
import { get } from 'lodash-es';
|
||||
import get from 'lodash/get';
|
||||
|
||||
import type {
|
||||
INodeUi,
|
||||
|
||||
@@ -36,7 +36,8 @@ import {
|
||||
} from '@/utils/nodeTypesUtils';
|
||||
import { captureException } from '@sentry/vue';
|
||||
import { computedWithControl } from '@vueuse/core';
|
||||
import { get, set } from 'lodash-es';
|
||||
import get from 'lodash/get';
|
||||
import set from 'lodash/set';
|
||||
import { N8nIcon, N8nIconButton, N8nInputLabel, N8nNotice, N8nText } from '@n8n/design-system';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { storeToRefs } from 'pinia';
|
||||
|
||||
@@ -29,7 +29,7 @@ import { useNDVStore } from '@/stores/ndv.store';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { useDocumentVisibility } from '@/composables/useDocumentVisibility';
|
||||
import { N8nButton, N8nCallout, N8nNotice } from '@n8n/design-system';
|
||||
import { isEqual } from 'lodash-es';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
|
||||
type Props = {
|
||||
parameter: INodeProperties;
|
||||
|
||||
@@ -68,7 +68,8 @@ import { executionDataToJson } from '@/utils/nodeTypesUtils';
|
||||
import { getGenericHints } from '@/utils/nodeViewUtils';
|
||||
import { searchInObject } from '@/utils/objectUtils';
|
||||
import { clearJsonKey, isEmpty, isPresent } from '@/utils/typesUtils';
|
||||
import { isEqual, isObject } from 'lodash-es';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isObject from 'lodash/isObject';
|
||||
import {
|
||||
N8nBlockUi,
|
||||
N8nButton,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { IAiDataContent } from '@/Interface';
|
||||
import { capitalize } from 'lodash-es';
|
||||
import capitalize from 'lodash/capitalize';
|
||||
import { computed, ref } from 'vue';
|
||||
import { NodeConnectionTypes } from 'n8n-workflow';
|
||||
import type { NodeConnectionType, NodeError } from 'n8n-workflow';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import { merge } from 'lodash-es';
|
||||
import merge from 'lodash/merge';
|
||||
import SSOLogin from '@/components/SSOLogin.vue';
|
||||
import { STORES } from '@n8n/stores';
|
||||
import { useSSOStore } from '@/stores/sso.store';
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { get, set, unset } from 'lodash-es';
|
||||
import get from 'lodash/get';
|
||||
import set from 'lodash/set';
|
||||
import unset from 'lodash/unset';
|
||||
import type {
|
||||
IDataObject,
|
||||
NodeParameterValue,
|
||||
|
||||
@@ -9,7 +9,8 @@ import { useSourceControlStore } from '@/stores/sourceControl.store';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
import { computed } from 'vue';
|
||||
import { sourceControlEventBus } from '@/event-bus/source-control';
|
||||
import { orderBy, groupBy } from 'lodash-es';
|
||||
import groupBy from 'lodash/groupBy';
|
||||
import orderBy from 'lodash/orderBy';
|
||||
import { N8nBadge, N8nText, N8nLink, N8nButton } from '@n8n/design-system';
|
||||
import { RouterLink } from 'vue-router';
|
||||
import {
|
||||
|
||||
@@ -35,7 +35,8 @@ import {
|
||||
SOURCE_CONTROL_FILE_TYPE,
|
||||
SOURCE_CONTROL_FILE_LOCATION,
|
||||
} from '@n8n/api-types';
|
||||
import { orderBy, groupBy } from 'lodash-es';
|
||||
import groupBy from 'lodash/groupBy';
|
||||
import orderBy from 'lodash/orderBy';
|
||||
import { getStatusText, getStatusTheme, getPushPriorityByStatus } from '@/utils/sourceControlUtils';
|
||||
import { useTelemetry } from '@/composables/useTelemetry';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { ITag } from '@/Interface';
|
||||
import IntersectionObserver from './IntersectionObserver.vue';
|
||||
import IntersectionObserved from './IntersectionObserved.vue';
|
||||
import { createEventBus } from '@n8n/utils/event-bus';
|
||||
import { debounce } from 'lodash-es';
|
||||
import debounce from 'lodash/debounce';
|
||||
|
||||
interface TagsContainerProps {
|
||||
tagIds: string[];
|
||||
|
||||
@@ -42,7 +42,7 @@ import { useSettingsStore } from '@/stores/settings.store';
|
||||
import { isEmpty } from '@/utils/typesUtils';
|
||||
import { asyncComputed } from '@vueuse/core';
|
||||
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css';
|
||||
import { pick } from 'lodash-es';
|
||||
import pick from 'lodash/pick';
|
||||
import { DateTime } from 'luxon';
|
||||
import NodeExecuteButton from './NodeExecuteButton.vue';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import WorkflowExtractionNameModal from '@/components/WorkflowExtractionNameModa
|
||||
import { WORKFLOW_EXTRACTION_NAME_MODAL_KEY } from '@/constants';
|
||||
import type { INodeUi } from '@/Interface';
|
||||
import type { ExtractableSubgraphData } from 'n8n-workflow';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import { createComponentRenderer } from '@/__tests__/render';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ref, computed } from 'vue';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { sortBy } from 'lodash-es';
|
||||
import sortBy from 'lodash/sortBy';
|
||||
import type { Router } from 'vue-router';
|
||||
import { VIEWS } from '@/constants';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { SETTINGS_STORE_DEFAULT_STATE } from '@/__tests__/utils';
|
||||
import { STORES } from '@n8n/stores';
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import { merge } from 'lodash-es';
|
||||
import merge from 'lodash/merge';
|
||||
import type { ResourceMapperFields, ResourceMapperValue } from 'n8n-workflow';
|
||||
|
||||
export const NODE_PARAMETER_VALUES = {
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
} from '@/utils/canvasUtils';
|
||||
import type { EventBus } from '@n8n/utils/event-bus';
|
||||
import { createEventBus } from '@n8n/utils/event-bus';
|
||||
import { isEqual } from 'lodash-es';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import CanvasNodeTrigger from '@/components/canvas/elements/nodes/render-types/parts/CanvasNodeTrigger.vue';
|
||||
|
||||
type Props = NodeProps<CanvasNodeData> & {
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { IWorkflowShortResponse, ExecutionFilterType } from '@/Interface';
|
||||
import { createComponentRenderer } from '@/__tests__/render';
|
||||
import * as telemetryModule from '@/composables/useTelemetry';
|
||||
import type { Telemetry } from '@/plugins/telemetry';
|
||||
import { merge } from 'lodash-es';
|
||||
import merge from 'lodash/merge';
|
||||
|
||||
const defaultFilterState: ExecutionFilterType = {
|
||||
status: 'all',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { vi, describe, it, expect } from 'vitest';
|
||||
import { merge } from 'lodash-es';
|
||||
import merge from 'lodash/merge';
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { faker } from '@faker-js/faker';
|
||||
|
||||
@@ -5,7 +5,7 @@ import WorkflowExecutionsSidebar from '@/components/executions/workflow/Workflow
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
import { mockedStore, SETTINGS_STORE_DEFAULT_STATE } from '@/__tests__/utils';
|
||||
import { STORES } from '@n8n/stores';
|
||||
import { merge } from 'lodash-es';
|
||||
import merge from 'lodash/merge';
|
||||
import { expect, it } from 'vitest';
|
||||
|
||||
vi.mock('vue-router', () => {
|
||||
|
||||
Reference in New Issue
Block a user