Skip to content

Commit

Permalink
perf(editor): SchemaView performance improvement by β‰ˆ90% πŸš€ (#12180)
Browse files Browse the repository at this point in the history
  • Loading branch information
r00gm authored Dec 12, 2024
1 parent 07a6ae1 commit 6a58309
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 3,764 deletions.
1 change: 0 additions & 1 deletion cypress/e2e/14-mapping.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ describe('Data mapping', () => {
workflowPage.actions.openNode('Set1');

ndv.actions.executePrevious();
ndv.actions.expandSchemaViewNode(SCHEDULE_TRIGGER_NODE_NAME);

const dataPill = ndv.getters
.inputDataContainer()
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/5-ndv.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('NDV', () => {

workflowPage.actions.openNode('Switch');
cy.get('.cm-line').realMouseMove(100, 100);
cy.get('.fa-angle-down').click();
cy.get('.fa-angle-down').first().click();
ndv.getters.backToCanvas().click();
workflowPage.actions.executeWorkflow();
workflowPage.actions.openNode('Merge');
Expand Down Expand Up @@ -204,7 +204,7 @@ describe('NDV', () => {
.contains(key)
.should('be.visible');
});
getObjectValueItem().find('label').click({ force: true });
getObjectValueItem().find('.toggle').click({ force: true });
expandedObjectProps.forEach((key) => {
ndv.getters
.outputPanel()
Expand Down Expand Up @@ -245,8 +245,8 @@ describe('NDV', () => {
ndv.getters.outputPanel().find('[class*=_pagination]').should('not.exist');
ndv.getters
.outputPanel()
.find('[data-test-id=run-data-schema-item] [data-test-id=run-data-schema-item]')
.should('have.length', 20);
.find('[data-test-id=run-data-schema-item]')
.should('have.length.above', 10);
});
});

Expand Down
3 changes: 0 additions & 3 deletions cypress/pages/ndv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@ export class NDV extends BasePage {
this.getters.inputSelect().find('.el-select').click();
this.getters.inputOption().contains(nodeName).click();
},
expandSchemaViewNode: (nodeName: string) => {
this.getters.schemaViewNodeName().contains(nodeName).click();
},
addDefaultPinnedData: () => {
this.actions.editPinnedData();
this.actions.savePinnedData();
Expand Down
1 change: 0 additions & 1 deletion packages/@n8n/api-types/src/frontend-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,5 @@ export interface FrontendSettings {
blockFileAccessToN8nFiles: boolean;
};
betaFeatures: FrontendBetaFeatures[];
virtualSchemaView: boolean;
easyAIWorkflowOnboarded: boolean;
}
7 changes: 0 additions & 7 deletions packages/cli/src/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,4 @@ export const schema = {
doc: 'Set this to 1 to enable the new partial execution logic by default.',
},
},

virtualSchemaView: {
doc: 'Whether to display the virtualized schema view',
format: Boolean,
default: false,
env: 'N8N_VIRTUAL_SCHEMA_VIEW',
},
};
1 change: 0 additions & 1 deletion packages/cli/src/services/frontend.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ export class FrontendService {
blockFileAccessToN8nFiles: this.securityConfig.blockFileAccessToN8nFiles,
},
betaFeatures: this.frontendConfig.betaFeatures,
virtualSchemaView: config.getEnv('virtualSchemaView'),
easyAIWorkflowOnboarded: false,
};
}
Expand Down
1 change: 0 additions & 1 deletion packages/editor-ui/src/__tests__/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,5 @@ export const defaultSettings: FrontendSettings = {
enabled: false,
},
betaFeatures: [],
virtualSchemaView: false,
easyAIWorkflowOnboarded: false,
};
5 changes: 2 additions & 3 deletions packages/editor-ui/src/components/ExpressionEditModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { INodeProperties } from 'n8n-workflow';
import { NodeConnectionType } from 'n8n-workflow';
import { outputTheme } from './ExpressionEditorModal/theme';
import ExpressionOutput from './InlineExpressionEditor/ExpressionOutput.vue';
import RunDataSchema from './RunDataSchema.vue';
import VirtualSchema from '@/components/VirtualSchema.vue';
import OutputItemSelect from './InlineExpressionEditor/OutputItemSelect.vue';
import { useI18n } from '@/composables/useI18n';
import { useDebounce } from '@/composables/useDebounce';
Expand Down Expand Up @@ -167,14 +167,13 @@ const onResizeThrottle = useThrottleFn(onResize, 10);
</template>
</N8nInput>

<RunDataSchema
<VirtualSchema
:class="$style.schema"
:search="appliedSearch"
:nodes="parentNodes"
:mapping-enabled="!isReadOnly"
:connection-type="NodeConnectionType.Main"
pane-type="input"
context="modal"
/>
</div>
</N8nResizeWrapper>
Expand Down
7 changes: 2 additions & 5 deletions packages/editor-ui/src/components/RunData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import { useExternalHooks } from '@/composables/useExternalHooks';
import { useI18n } from '@/composables/useI18n';
import { useNodeHelpers } from '@/composables/useNodeHelpers';
import { useNodeType } from '@/composables/useNodeType';
import { useSettingsStore } from '@/stores/settings.store';
import type { PinDataSource, UnpinDataSource } from '@/composables/usePinnedData';
import { usePinnedData } from '@/composables/usePinnedData';
import { useTelemetry } from '@/composables/useTelemetry';
Expand Down Expand Up @@ -88,10 +87,8 @@ const LazyRunDataJson = defineAsyncComponent(
async () => await import('@/components/RunDataJson.vue'),
);
const LazyRunDataSchema = defineAsyncComponent(async () =>
useSettingsStore().settings.virtualSchemaView
? await import('@/components/VirtualSchema.vue')
: await import('@/components/RunDataSchema.vue'),
const LazyRunDataSchema = defineAsyncComponent(
async () => await import('@/components/VirtualSchema.vue'),
);
const LazyRunDataHtml = defineAsyncComponent(
async () => await import('@/components/RunDataHtml.vue'),
Expand Down
Loading

0 comments on commit 6a58309

Please # to comment.