Skip to content

Commit 6fe4fd1

Browse files
authored
Merge pull request #553 from zxrys/feature/fix-frontend-lag-issue
perf: frontend lag issue
2 parents 410b811 + 8112e22 commit 6fe4fd1

File tree

2 files changed

+117
-88
lines changed

2 files changed

+117
-88
lines changed

frontend/src/components/FormGenerator.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,15 +297,19 @@ const setBaseYamlFromSource = (source) => {
297297
}
298298
try {
299299
let parsed = source
300+
let yamlString = ''
300301
if (typeof source === 'string') {
302+
yamlString = source
301303
parsed = yaml.load(source) || {}
302304
} else if (typeof source === 'object') {
303305
parsed = JSON.parse(JSON.stringify(source))
304306
} else {
305307
parsed = {}
306308
}
307309
baseYamlObject.value = parsed
308-
baseYamlString.value = yaml.dump(parsed ?? null, yamlDumpOptions)
310+
// Avoid expensive dump on modal open for object sources.
311+
// Save path will generate YAML from current object when needed.
312+
baseYamlString.value = yamlString
309313
} catch (error) {
310314
console.error('Failed to set base YAML from provided source:', error)
311315
baseYamlObject.value = null
@@ -1046,7 +1050,7 @@ watch(() => props.initialYaml, (newValue) => {
10461050
baseYamlObject.value = null
10471051
baseYamlString.value = ''
10481052
}
1049-
}, { immediate: true, deep: true })
1053+
}, { immediate: true })
10501054
10511055
watch(() => props.workflowName, async (newName, oldName) => {
10521056
if (!newName) {

0 commit comments

Comments
 (0)