Skip to content

Commit 6a58309

Browse files
authored
perf(editor): SchemaView performance improvement by β‰ˆ90% πŸš€ (#12180)
1 parent 07a6ae1 commit 6a58309

15 files changed

+13
-3764
lines changed

β€Žcypress/e2e/14-mapping.cy.ts

-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ describe('Data mapping', () => {
185185
workflowPage.actions.openNode('Set1');
186186

187187
ndv.actions.executePrevious();
188-
ndv.actions.expandSchemaViewNode(SCHEDULE_TRIGGER_NODE_NAME);
189188

190189
const dataPill = ndv.getters
191190
.inputDataContainer()

β€Žcypress/e2e/5-ndv.cy.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('NDV', () => {
7777

7878
workflowPage.actions.openNode('Switch');
7979
cy.get('.cm-line').realMouseMove(100, 100);
80-
cy.get('.fa-angle-down').click();
80+
cy.get('.fa-angle-down').first().click();
8181
ndv.getters.backToCanvas().click();
8282
workflowPage.actions.executeWorkflow();
8383
workflowPage.actions.openNode('Merge');
@@ -204,7 +204,7 @@ describe('NDV', () => {
204204
.contains(key)
205205
.should('be.visible');
206206
});
207-
getObjectValueItem().find('label').click({ force: true });
207+
getObjectValueItem().find('.toggle').click({ force: true });
208208
expandedObjectProps.forEach((key) => {
209209
ndv.getters
210210
.outputPanel()
@@ -245,8 +245,8 @@ describe('NDV', () => {
245245
ndv.getters.outputPanel().find('[class*=_pagination]').should('not.exist');
246246
ndv.getters
247247
.outputPanel()
248-
.find('[data-test-id=run-data-schema-item] [data-test-id=run-data-schema-item]')
249-
.should('have.length', 20);
248+
.find('[data-test-id=run-data-schema-item]')
249+
.should('have.length.above', 10);
250250
});
251251
});
252252

β€Žcypress/pages/ndv.ts

-3
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,6 @@ export class NDV extends BasePage {
227227
this.getters.inputSelect().find('.el-select').click();
228228
this.getters.inputOption().contains(nodeName).click();
229229
},
230-
expandSchemaViewNode: (nodeName: string) => {
231-
this.getters.schemaViewNodeName().contains(nodeName).click();
232-
},
233230
addDefaultPinnedData: () => {
234231
this.actions.editPinnedData();
235232
this.actions.savePinnedData();

β€Žpackages/@n8n/api-types/src/frontend-settings.ts

-1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,5 @@ export interface FrontendSettings {
172172
blockFileAccessToN8nFiles: boolean;
173173
};
174174
betaFeatures: FrontendBetaFeatures[];
175-
virtualSchemaView: boolean;
176175
easyAIWorkflowOnboarded: boolean;
177176
}

β€Žpackages/cli/src/config/schema.ts

-7
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,4 @@ export const schema = {
405405
doc: 'Set this to 1 to enable the new partial execution logic by default.',
406406
},
407407
},
408-
409-
virtualSchemaView: {
410-
doc: 'Whether to display the virtualized schema view',
411-
format: Boolean,
412-
default: false,
413-
env: 'N8N_VIRTUAL_SCHEMA_VIEW',
414-
},
415408
};

β€Žpackages/cli/src/services/frontend.service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ export class FrontendService {
231231
blockFileAccessToN8nFiles: this.securityConfig.blockFileAccessToN8nFiles,
232232
},
233233
betaFeatures: this.frontendConfig.betaFeatures,
234-
virtualSchemaView: config.getEnv('virtualSchemaView'),
235234
easyAIWorkflowOnboarded: false,
236235
};
237236
}

β€Žpackages/editor-ui/src/__tests__/defaults.ts

-1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,5 @@ export const defaultSettings: FrontendSettings = {
126126
enabled: false,
127127
},
128128
betaFeatures: [],
129-
virtualSchemaView: false,
130129
easyAIWorkflowOnboarded: false,
131130
};

β€Žpackages/editor-ui/src/components/ExpressionEditModal.vue

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type { INodeProperties } from 'n8n-workflow';
1414
import { NodeConnectionType } from 'n8n-workflow';
1515
import { outputTheme } from './ExpressionEditorModal/theme';
1616
import ExpressionOutput from './InlineExpressionEditor/ExpressionOutput.vue';
17-
import RunDataSchema from './RunDataSchema.vue';
17+
import VirtualSchema from '@/components/VirtualSchema.vue';
1818
import OutputItemSelect from './InlineExpressionEditor/OutputItemSelect.vue';
1919
import { useI18n } from '@/composables/useI18n';
2020
import { useDebounce } from '@/composables/useDebounce';
@@ -167,14 +167,13 @@ const onResizeThrottle = useThrottleFn(onResize, 10);
167167
</template>
168168
</N8nInput>
169169

170-
<RunDataSchema
170+
<VirtualSchema
171171
:class="$style.schema"
172172
:search="appliedSearch"
173173
:nodes="parentNodes"
174174
:mapping-enabled="!isReadOnly"
175175
:connection-type="NodeConnectionType.Main"
176176
pane-type="input"
177-
context="modal"
178177
/>
179178
</div>
180179
</N8nResizeWrapper>

β€Žpackages/editor-ui/src/components/RunData.vue

+2-5
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import { useExternalHooks } from '@/composables/useExternalHooks';
4646
import { useI18n } from '@/composables/useI18n';
4747
import { useNodeHelpers } from '@/composables/useNodeHelpers';
4848
import { useNodeType } from '@/composables/useNodeType';
49-
import { useSettingsStore } from '@/stores/settings.store';
5049
import type { PinDataSource, UnpinDataSource } from '@/composables/usePinnedData';
5150
import { usePinnedData } from '@/composables/usePinnedData';
5251
import { useTelemetry } from '@/composables/useTelemetry';
@@ -88,10 +87,8 @@ const LazyRunDataJson = defineAsyncComponent(
8887
async () => await import('@/components/RunDataJson.vue'),
8988
);
9089
91-
const LazyRunDataSchema = defineAsyncComponent(async () =>
92-
useSettingsStore().settings.virtualSchemaView
93-
? await import('@/components/VirtualSchema.vue')
94-
: await import('@/components/RunDataSchema.vue'),
90+
const LazyRunDataSchema = defineAsyncComponent(
91+
async () => await import('@/components/VirtualSchema.vue'),
9592
);
9693
const LazyRunDataHtml = defineAsyncComponent(
9794
async () => await import('@/components/RunDataHtml.vue'),

0 commit comments

Comments
Β (0)